Codemesh Runtime v3 C++ API Reference  3.9.205
xmog_options.h
1 //
2 // Copyright (c) 1999-2020 by Codemesh, Inc.. ALL RIGHTS RESERVED.
3 //
4 
5 
6 #ifndef xmog_options_inc
7 #define xmog_options_inc
8 
9 
10 #include "xmog_tracer.h"
11 
103 
131 typedef jint (JNICALL *XMOG_ECB)( jthrowable t, int error_code, char * msg );
132 
133 
141 {
147 };
148 
149 
258 class XMOG_DECLSPEC xmog_options : public xmog_tracer
259 {
260 protected:
261 
267  xmog_options( bool bEnvOverrides = true );
268 
275  xmog_options( const char * filename, bool bEnvOverrides = true );
276 
289  xmog_options( const char * filename, XMOGVERSION vers, XMOGCONFIG conf, XMOGVERSION reserved0, bool bEnvOverrides = true );
290 
303  xmog_options( XMOGVERSION vers, XMOGCONFIG conf, XMOGVERSION reserved0, bool bEnvOverrides = true );
304 
313  xmog_options( int argc, char * argv[], bool bEnvOverrides = true );
314 
318  virtual ~xmog_options();
319 
320 public:
321 
332  virtual int readOptions( const char * file, XMOGVERSION vers = NULL, XMOGCONFIG conf = NULL, XMOGVERSION reserved0 = NULL );
333 
341  virtual void setSkipTypeAnalysisForTheseAssemblies( const char * skip );
342 
348  virtual const char * getSkipTypeAnalysisForTheseAssemblies();
349 
357  virtual void setPerformTypeAnalysisForTheseAssemblies( const char * perform );
358 
364  virtual const char * getPerformTypeAnalysisForTheseAssemblies();
365 
373  virtual void setCOMExceptionMessages( const char * ce );
374 
382  virtual void setCOMExceptionMessages( bool ce );
383 
389  virtual bool getCOMExceptionMessages();
390 
396  virtual void setUseCodemeshSecurityManager( const char * ce );
397 
403  virtual void setUseCodemeshSecurityManager( bool ce );
404 
408  virtual bool getUseCodemeshSecurityManager();
409 
416  virtual void setJvmPath( const char * jvmPath );
417 
421  virtual char * getJvmPath();
422 
434  virtual void setNoshutdownProcessing( bool noshut );
435 
447  virtual void setNoshutdownProcessing( const char * noshut );
448 
459  virtual void setNativeLibraryMode( bool native );
460 
476  virtual void setNativeLibraryMode( const char * native );
477 
483  virtual bool getNativeLibraryMode();
484 
488  virtual bool getNoshutdownProcessing();
489 
498  virtual void setTracing( xmog_trace_facility fac, int level );
499 
508  virtual void setTracing( xmog_trace_facility fac, xmog_trace_level level );
509 
518  virtual void setTracing( xmog_trace_facility fac, const char * level );
519 
527  virtual void setTracing( const char * facAndLevel );
528 
534  virtual xmog_trace_level getTracing( xmog_trace_facility fac );
535 
547  virtual void setTraceFileCount( int traceFileCount );
548 
560  virtual void setTraceFileCount( const char * traceFileCount );
561 
565  virtual int getTraceFileCount();
566 
583  virtual void setTraceFile( const char * traceFile );
584 
599  virtual void setTraceFile( const char * traceFile, int numTraceFiles );
600 
604  virtual char * getTraceFile();
605 
609  virtual void setTraceMethod( const char * traceMethod );
610 
614  virtual void setTraceMethod( XMOG_TRACE traceMethod );
615 
619  virtual XMOG_TRACE getTraceMethod();
620 
628  virtual void trace( xmog_trace_facility fac, xmog_trace_level level, const char * format, ... );
629 
637  virtual void trace( int fac, xmog_trace_level level, const char * format, ... );
638 
647  virtual void setDefaultEncoding( const char * enc );
648 
654  virtual char * getDefaultEncoding();
655 
659  virtual void setExceptionPolicy( const char * pol );
660 
664  virtual void setExceptionPolicy( xmog_exception_policy pol, XMOG_ECB exccb = 0 );
665 
669  virtual xmog_exception_policy getExceptionPolicy();
670 
674  virtual void setExceptionCallback( const char * exccb );
675 
679  virtual void setExceptionCallback( XMOG_ECB exccb );
680 
684  virtual XMOG_ECB getExceptionCallback();
685 
694  virtual void setRemote( bool remote );
695 
704  virtual void setRemote( const char * remote );
705 
709  virtual bool getRemote();
710 
716  virtual void setServer( bool server );
717 
723  virtual bool getServer();
724 
732  void printJvmPathAndExit();
733 
739  char * getLdLibraryPath();
740 
750  void setLdLibraryPath( const char * path );
751 
756  void printLdLibraryPathAndExit();
757 
766  virtual void setNumMilliSecondsToForcedGC( int ms );
767 
775  virtual void setNumMilliSecondsToForcedGC( const char * ms );
776 
782  virtual int getNumMilliSecondsToForcedGC();
783 
792  virtual void setNumObjectsToForcedGC( int ms );
793 
802  virtual void setNumObjectsToForcedGC( const char * ms );
803 
809  virtual int getNumObjectsToForcedGC();
810 
811 protected:
812 
816  void init();
817 
821  void env_override();
822 
826  void reset();
827 
828 private:
829 
830  int readOptionsFromRegistry( XMOGVERSION vers, XMOGCONFIG conf, XMOGVERSION reserved0 );
831 
832  int readOptionsInJunction20Format( const char * file, XMOGVERSION vers, XMOGCONFIG conf, XMOGVERSION reserved0 );
833 
834  int readOptionsInXmlFormat( const char * file );
835 
836  void inner_trace( const char * format, xmog_trace_level level, va_list args );
837 
838  static void XMOG_ATEXIT_MODIFIER closeTraceFile();
839 
840  char * jvmPath;
841 
842  char * defaultEncoding;
843 
844  int tlJvm;
845 
846  int tlThread;
847 
848  int tlJNI;
849 
850  int tlRemote;
851 
852  int tlCallbacks;
853 
854  int tlMax;
855 
856  int millisToForcedGC;
857 
858  int proxiesToForcedGC;
859 
860  int traceFileCount;
861 
862  char * traceFile;
863 
864  FILE * fpTraceFile;
865 
866  XMOG_TRACE traceMethod;
867 
868  xmog_exception_policy excPolicy;
869 
870  XMOG_ECB exceptionCallback;
871 
872  bool noshutdown;
873 
874  bool nativemode;
875 
876  bool envOverrides;
877 
878  bool bRemote;
879 
880  bool bServer;
881 
882  bool bCEM; // COMExceptionMessages for .NET support
883 
884  bool bUCMSM; // Codemesh security manager
885 
886  char * skipAnalysis; // performance tweaking for .NET support
887 
888  char * performAnalysis; // performance tweaking for .NET support
889 };
890 
891 
892 #endif /* xmog_options_inc */
xmog_exception_policy
xmog_exception_policy
The exception handling policy.
Definition: xmog_options.h:140
ExceptionCallback
@ ExceptionCallback
Call a callback method that was registered with the framework.
Definition: xmog_options.h:146
xmog_trace_level
xmog_trace_level
Tracing levels for the runtime.
Definition: xmog_tracer.h:72
GenericException
@ GenericException
Throw an xmog_exception_impl instance that wraps around the Java exception.
Definition: xmog_options.h:144
XMOG_ECB
jint(JNICALL * XMOG_ECB)(jthrowable t, int error_code, char *msg)
The method signature that an errorhandling callback has to conform to in the case of an ExceptionCall...
Definition: xmog_options.h:131
IgnoreAndContinue
@ IgnoreAndContinue
Clear the exception from the JVM and continue without doing anything about it.
Definition: xmog_options.h:142
xmog_trace_facility
xmog_trace_facility
Tracing facilities for the runtime.
Definition: xmog_tracer.h:53
xmog_options
This class wraps around options that govern the overall behavior of the runtime library with respect ...
Definition: xmog_options.h:258
xmog_tracer
An interface that provides a tracing facility for the runtime library.
Definition: xmog_tracer.h:139
TypedException
@ TypedException
Find the best matching proxy type for the Java exception and throw an instance of it....
Definition: xmog_options.h:143
XMOG_TRACE
void(JNICALL * XMOG_TRACE)(FILE *fpTrace, int traceLevel, const char *format, va_list args)
A function type that can be used to trace to arbitrary file handles.
Definition: xmog_tracer.h:94
xmog_tracer::trace
virtual void trace(int fac, xmog_trace_level level, const char *format,...)=0
Trace a message if its level at the configured facility is appropriate.
FatalError
@ FatalError
Terminate the JVM by calling the JNI function FatalError.
Definition: xmog_options.h:145

Copyright (c) 1999-2020 by Codemesh, Inc., ALL RIGHTS RESERVED.