Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

xmog_options.h

00001 /*
00002  * Copyright 1999-2006 by Codemesh, Inc.  ALL RIGHTS RESERVED.
00003  */
00004 
00005 #ifndef xmog_options_inc
00006 #define xmog_options_inc
00007 
00008 
00009 #include "xmog_tracer.h"
00010 
00102 
00130 typedef jint (JNICALL *XMOG_ECB)( jthrowable t, int error_code, char * msg );
00131 
00132 
00139 enum xmog_exception_policy
00140 {
00141     IgnoreAndContinue = 0, 
00142     TypedException = 1,
00143     GenericException = 2,
00144     FatalError = 3,
00145     ExceptionCallback = 4
00146 };
00147 
00148 
00239 class XMOG_DECLSPEC xmog_options : public xmog_tracer
00240 {
00241 protected:
00242 
00248     xmog_options( bool bEnvOverrides = true );
00249 
00256     xmog_options( const char * filename, bool bEnvOverrides = true );
00257 
00270     xmog_options( const char * filename, XMOGVERSION vers, XMOGCONFIG conf, XMOGVERSION reserved0, bool bEnvOverrides = true );
00271 
00284     xmog_options( XMOGVERSION vers, XMOGCONFIG conf, XMOGVERSION reserved0, bool bEnvOverrides = true );
00285 
00294     xmog_options( int argc, char * argv[], bool bEnvOverrides = true );
00295 
00299     virtual ~xmog_options();
00300 
00301 public:
00302 
00313     virtual int                 readOptions( const char * file, XMOGVERSION vers = NULL, XMOGCONFIG conf = NULL, XMOGVERSION reserved0 = NULL );
00314 
00322     virtual void                setCOMExceptionMessages( const char * ce );
00323 
00331     virtual void                setCOMExceptionMessages( bool ce );
00332 
00338     virtual bool                getCOMExceptionMessages();
00339 
00345     virtual void                setUseCodemeshSecurityManager( const char * ce );
00346 
00352     virtual void                setUseCodemeshSecurityManager( bool ce );
00353 
00357     virtual bool                getUseCodemeshSecurityManager();
00358 
00365     virtual void                setJvmPath( const char * jvmPath );
00366 
00370     virtual char *              getJvmPath();
00371 
00383     virtual void                setNoshutdownProcessing( bool noshut );
00384 
00396     virtual void                setNoshutdownProcessing( const char * noshut );
00397 
00401     virtual bool                getNoshutdownProcessing();
00402 
00411     virtual void                setTracing( xmog_trace_facility fac, int level );
00412 
00421     virtual void                setTracing( xmog_trace_facility fac, xmog_trace_level level );
00422 
00431     virtual void                setTracing( xmog_trace_facility fac, const char * level );
00432 
00440     virtual void                setTracing( const char * facAndLevel );
00441 
00447     virtual xmog_trace_level    getTracing( xmog_trace_facility fac );
00448 
00459     virtual void                setTraceFile( const char * traceFile );
00460 
00464     virtual char *              getTraceFile();
00465 
00469     virtual void                setTraceMethod( const char * traceMethod );
00470 
00474     virtual void                setTraceMethod( XMOG_TRACE traceMethod );
00475 
00479     virtual XMOG_TRACE          getTraceMethod();
00480 
00488     virtual void                trace( xmog_trace_facility fac, xmog_trace_level level, const char * format, ... );
00489 
00497     virtual void                trace( int fac, xmog_trace_level level, const char * format, ... );
00498 
00507     virtual void                setDefaultEncoding( const char * enc );
00508 
00514     virtual char *              getDefaultEncoding();
00515 
00519     virtual void                setExceptionPolicy( const char * pol );
00520 
00524     virtual void                setExceptionPolicy( xmog_exception_policy pol, XMOG_ECB exccb = 0 );
00525 
00529     virtual xmog_exception_policy getExceptionPolicy();
00530 
00534     virtual void                setExceptionCallback( const char * exccb );
00535 
00539     virtual void                setExceptionCallback( XMOG_ECB exccb );
00540 
00544     virtual XMOG_ECB            getExceptionCallback();
00545 
00554     virtual void                setRemote( bool remote );
00555 
00564     virtual void                setRemote( const char * remote );
00565 
00569     virtual bool                getRemote();
00570 
00576     virtual void                setServer( bool server );
00577 
00583     virtual bool                getServer();
00584 
00592     void                        printJvmPathAndExit();
00593 
00599     char *                      getLdLibraryPath();
00600 
00610     void                        setLdLibraryPath( const char * path );
00611 
00616     void                        printLdLibraryPathAndExit();
00617 
00618 protected:
00619 
00623     void                init();
00624 
00628     void                env_override();
00629 
00633     void                reset();
00634 
00635 private:
00636 
00637     int                 readOptionsFromRegistry( XMOGVERSION vers, XMOGCONFIG conf, XMOGVERSION reserved0 );
00638 
00639     int                 readOptionsInJunction20Format( const char * file, XMOGVERSION vers, XMOGCONFIG conf, XMOGVERSION reserved0 );
00640 
00641     int                 readOptionsInXmlFormat( const char * file );
00642 
00643     void                inner_trace( const char * format, xmog_trace_level level, va_list args );
00644 
00645     char *              jvmPath;
00646 
00647     char *              defaultEncoding;
00648 
00649     int                 tlJvm;
00650 
00651     int                 tlThread;
00652 
00653     int                 tlJNI;
00654 
00655     int                 tlRemote;
00656 
00657     int                 tlMax;
00658 
00659     char *              traceFile;
00660 
00661     FILE *              fpTraceFile;
00662 
00663     XMOG_TRACE          traceMethod;
00664 
00665     xmog_exception_policy excPolicy;
00666 
00667     XMOG_ECB            exceptionCallback;
00668 
00669     bool                noshutdown;
00670 
00671     bool                envOverrides;
00672 
00673     bool                bRemote;
00674 
00675     bool                bServer;
00676 
00677     bool                bCEM; // COMExceptionMessages for .NET support
00678 
00679     bool                bUCMSM; // Codemesh security manager
00680 };
00681 
00682 
00683 #endif /* xmog_options_inc */

Generated on Fri Jun 16 10:18:58 2006 for JMS Courier for C++ by  doxygen 1.4.1