Codemesh Runtime v3 C++ API Reference
3.9.205
|
This class wraps around options that govern the overall behavior of the runtime library with respect to logging, tracing, errorhandling, etc. More...
#include <xmog_options.h>
Public Member Functions | |
virtual int | readOptions (const char *file, XMOGVERSION vers=NULL, XMOGCONFIG conf=NULL, XMOGVERSION reserved0=NULL) |
Reads a configuration file and initializes the instance with the found settings. More... | |
virtual void | setSkipTypeAnalysisForTheseAssemblies (const char *skip) |
Sets the assemblies for which no type analysis is performed. More... | |
virtual const char * | getSkipTypeAnalysisForTheseAssemblies () |
Returns the assembly name fragments for which no type analysis is performed. More... | |
virtual void | setPerformTypeAnalysisForTheseAssemblies (const char *perform) |
Sets the assemblies for which type analysis is performed. More... | |
virtual const char * | getPerformTypeAnalysisForTheseAssemblies () |
Returns the assembly name fragments for which type analysis is performed. More... | |
virtual void | setCOMExceptionMessages (const char *ce) |
Sets the flag controlling whether COM exception support should be turned on. More... | |
virtual void | setCOMExceptionMessages (bool ce) |
Sets the flag controlling whether COM exception support should be turned on. More... | |
virtual bool | getCOMExceptionMessages () |
Returns whether COM exception support is turned on. More... | |
virtual void | setUseCodemeshSecurityManager (const char *ce) |
Sets the flag controlling whether a Codemesh SecurityManager should be used. More... | |
virtual void | setUseCodemeshSecurityManager (bool ce) |
Sets the flag controlling whether a Codemesh SecurityManager should be used. More... | |
virtual bool | getUseCodemeshSecurityManager () |
Returns whether the Codemesh security manager should be used. | |
virtual void | setJvmPath (const char *jvmPath) |
Sets the JVM path that is to be used. More... | |
virtual char * | getJvmPath () |
Returns the JVM path used by the in-process JNI implementation. | |
virtual void | setNoshutdownProcessing (bool noshut) |
Sets the shutdown policy. More... | |
virtual void | setNoshutdownProcessing (const char *noshut) |
Sets the shutdown policy. More... | |
virtual void | setNativeLibraryMode (bool native) |
Sets the runtime mode. More... | |
virtual void | setNativeLibraryMode (const char *native) |
Sets the runtime mode. More... | |
virtual bool | getNativeLibraryMode () |
Returns the native library mode of the runtime. More... | |
virtual bool | getNoshutdownProcessing () |
Returns the shutdown policy. | |
virtual void | setTracing (xmog_trace_facility fac, int level) |
Sets the tracing level for a given tracing category. More... | |
virtual void | setTracing (xmog_trace_facility fac, xmog_trace_level level) |
Sets the tracing level for a given tracing category. More... | |
virtual void | setTracing (xmog_trace_facility fac, const char *level) |
Sets the tracing level for a given tracing category. More... | |
virtual void | setTracing (const char *facAndLevel) |
Sets the tracing level for a given tracing category. More... | |
virtual xmog_trace_level | getTracing (xmog_trace_facility fac) |
Returns the tracing level for a given category. More... | |
virtual void | setTraceFileCount (int traceFileCount) |
Sets the number of trace files to be retained. More... | |
virtual void | setTraceFileCount (const char *traceFileCount) |
Sets the number of trace files to be retained. More... | |
virtual int | getTraceFileCount () |
Returns the number of trace files to be retained. | |
virtual void | setTraceFile (const char *traceFile) |
Sets the trace file. More... | |
virtual void | setTraceFile (const char *traceFile, int numTraceFiles) |
Sets the trace file and the file ring size. More... | |
virtual char * | getTraceFile () |
Returns the name of the trace file. | |
virtual void | setTraceMethod (const char *traceMethod) |
Sets the trace method. | |
virtual void | setTraceMethod (XMOG_TRACE traceMethod) |
Sets the trace method. | |
virtual XMOG_TRACE | getTraceMethod () |
Returns the trace method. | |
virtual void | trace (xmog_trace_facility fac, xmog_trace_level level, const char *format,...) |
Trace a certain message belonging to a certain category at a certain level. More... | |
virtual void | trace (int fac, xmog_trace_level level, const char *format,...) |
Trace a certain message belonging to a certain category at a certain level. More... | |
virtual void | setDefaultEncoding (const char *enc) |
Sets the default encoding that is used by newly created threads that are attached to the JVM. More... | |
virtual char * | getDefaultEncoding () |
Returns the name of the default encoding that is to be used for the new JVM. More... | |
virtual void | setExceptionPolicy (const char *pol) |
Sets the errorhandling policy. | |
virtual void | setExceptionPolicy (xmog_exception_policy pol, XMOG_ECB exccb=0) |
Sets the errorhandling policy. | |
virtual xmog_exception_policy | getExceptionPolicy () |
Returns the errorhandling policy. | |
virtual void | setExceptionCallback (const char *exccb) |
Sets the errorhandling callback method. | |
virtual void | setExceptionCallback (XMOG_ECB exccb) |
Sets the errorhandling callback method. | |
virtual XMOG_ECB | getExceptionCallback () |
Returns the errorhandling callback method. | |
virtual void | setRemote (bool remote) |
Sets the remote flag. More... | |
virtual void | setRemote (const char *remote) |
Sets the remote flag. More... | |
virtual bool | getRemote () |
Returns the remote flag. | |
virtual void | setServer (bool server) |
Sets the server flag. More... | |
virtual bool | getServer () |
Returns the value of the server flag. More... | |
void | printJvmPathAndExit () |
Prints the configured JvmPath to stdout and exits. More... | |
char * | getLdLibraryPath () |
Returns a path that is proper for the configured JVM. More... | |
void | setLdLibraryPath (const char *path) |
Sets the environment variable that is responsible for specifying the path on which shared libraries are searched for. More... | |
void | printLdLibraryPathAndExit () |
Prints to stdout the PATH components that are probably required to be on the platform loader's library search path and then exits. | |
virtual void | setNumMilliSecondsToForcedGC (int ms) |
Sets the number of milliseconds between forced GCs in .NET. More... | |
virtual void | setNumMilliSecondsToForcedGC (const char *ms) |
Sets the flag controlling whether COM exception support should be turned on. More... | |
virtual int | getNumMilliSecondsToForcedGC () |
Returns the number of milliseconds between forced GCs in .NET. More... | |
virtual void | setNumObjectsToForcedGC (int ms) |
Sets the number of proxy object creations before a forced .NET GC. More... | |
virtual void | setNumObjectsToForcedGC (const char *ms) |
Sets the number of proxy object creations before a forced .NET GC. More... | |
virtual int | getNumObjectsToForcedGC () |
Returns the number of proxy object creations before a forced .NET GC. More... | |
Protected Member Functions | |
xmog_options (bool bEnvOverrides=true) | |
Creates an xmog_options instance that might be initialized from the environment. More... | |
xmog_options (const char *filename, bool bEnvOverrides=true) | |
Creates an xmog_options instance that might be initialized from a file and/or the environment. More... | |
xmog_options (const char *filename, XMOGVERSION vers, XMOGCONFIG conf, XMOGVERSION reserved0, bool bEnvOverrides=true) | |
Creates an xmog_options instance that might be initialized from a file and/or the environment. More... | |
xmog_options (XMOGVERSION vers, XMOGCONFIG conf, XMOGVERSION reserved0, bool bEnvOverrides=true) | |
Creates an xmog_options instance that might be initialized from a file the registry and/or the environment. More... | |
xmog_options (int argc, char *argv[], bool bEnvOverrides=true) | |
Creates an xmog_options instance that might be initialized from command line arguments and/or the environment. More... | |
virtual | ~xmog_options () |
Cleans up behind the instance. | |
void | init () |
Initializes the instance. | |
void | env_override () |
Initializes the options data from the environment variables. | |
void | reset () |
Resets the instance to its initial defaults. | |
Additional Inherited Members | |
Static Public Member Functions inherited from xmog_tracer | |
static void JNICALL | traceOutputDebugString (FILE *fpTrace, int traceLevel, const char *format, va_list args) |
Trace a message using the Windows platform API DebugOutputString function. More... | |
static void JNICALL | traceEventLog (FILE *fpTrace, int traceLevel, const char *format, va_list args) |
Trace a message using the Windows event log. More... | |
This class wraps around options that govern the overall behavior of the runtime library with respect to logging, tracing, errorhandling, etc.
This class supports the following properties:
Setting | File or Registry | CLI | Environment | Description |
Special COM support | COMExceptionMessages | -cem | XMOG_CEM | Enable special handling of exceptions that makes error reporting easier for COM clients. This feature is usually only used from .NET via generated C# bindings. |
Special .NET support | MillisecondsToForcedGC | -msgc | XMOG_MSGC | Specifies a time interval after which the runtime forces a .NET garbage collection. This feature helps significantly reduce the likelihood of a Java OutOfMemoryError due to the .NET garbage collector not collecting proxy objects. It generally has a negative impact on performance. |
Special .NET support | NumObjectsToForcedGC | -ogc | XMOG_OGC | Specifies a number of proxy object creations after which the runtime forces a .NET garbage collection. This feature helps significantly reduce the likelihood of a Java OutOfMemoryError due to the .NET garbage collector not collecting proxy objects. It generally has a negative impact on performance. |
Default Encoding | DefaultEncoding | -enc | XMOG_DEFAULT_ENCODING | The default character set that is used for conversions between Java strings and native strings, for example "US-ASCII" .
|
Errorhandling policy | ExceptionHandling | -exc | XMOG_EXCEPTION_POLICY | The default errorhandling policy, for example "TypedException" .
|
Errorhandling callback | ExceptionCallback | -exccb | XMOG_EXCEPTION_CALLBACK | The callback to be used for the "ExceptionCallback" policy. |
JVM | RuntimeLib | -jvm | XMOG_JVM_PATH | The runtime library to be used. |
Shutdown processing | NoShutdown | -noshut | XMOG_NO_SHUT | true if normal shutdown processing is to be suppressed. |
Remote | Remote | -remote | XMOG_REMOTE | true if a remote connection to a shared JVM is to be used, false if in-process JNI should be used. |
Custom trace file | TraceFile | -tracefile | XMOG_TRACE_FILE | The file to which all tracing output is sent. |
Tracing level at which messages are logged | TraceLevel | -tracelevel | XMOG_TRACE_LEVEL | The tracelevel for all trace facilities. Use the string form of the value, for example TraceInfo or TraceVerbose . |
Custom trace method | TraceMethod | -tracemethod | XMOG_TRACE_METHOD | The function to be used for tracing calls. |
Security Manager | UseCodemeshSecurityManager | -cmsm | XMOG_USE_CODEMESH_SECURITY_MANAGER | This feature causes Codemesh's security manager to be used in place of the configured one. The Codemesh security manager grants several privileges required by the runtime without you having to worry about it. It delegates other checks to the configured security manager.
|
|
protected |
Creates an xmog_options instance that might be initialized from the environment.
bEnvOverrides | true if environment variables are taken into account. |
|
protected |
Creates an xmog_options instance that might be initialized from a file and/or the environment.
filename | the name of the configuration file which contains runtime configuration settings. |
bEnvOverrides | true if environment variables are taken into account. |
|
protected |
Creates an xmog_options instance that might be initialized from a file and/or the environment.
This particular method takes old-style section selectors as input, giving it all information required to deal with old JunC++ion-style configuration files.
filename | the name of the configuration file which contains runtime configuration settings. |
vers | the version string we're looking for in the configfile. |
conf | the configuration name string we're looking for in the configfile. |
reserved0 | should always be NULL . |
bEnvOverrides | true if environment variables are taken into account. |
|
protected |
Creates an xmog_options instance that might be initialized from a file the registry and/or the environment.
This particular method takes old-style section selectors as input, giving it all information required to deal with the old JunC++ion-style configuration files or registry settings.
vers | the version string we're looking for in the configfile. |
conf | the configuration name string we're looking for in the configfile. |
reserved0 | should always be NULL . |
bEnvOverrides | true if environment variables are taken into account. |
|
protected |
Creates an xmog_options instance that might be initialized from command line arguments and/or the environment.
argc | the number of arguments. |
argv | an array of string arguments. |
bEnvOverrides | true if environment variables are taken into account. |
|
virtual |
Returns whether COM exception support is turned on.
This method is a support method for the .NET bindings.
|
virtual |
Returns the name of the default encoding that is to be used for the new JVM.
char* xmog_options::getLdLibraryPath | ( | ) |
Returns a path that is proper for the configured JVM.
The caller is responsible for freeing the returned string.
|
virtual |
Returns the native library mode of the runtime.
Returns true
if the runtime is operating in native library mode.
|
virtual |
Returns the number of milliseconds between forced GCs in .NET.
This method is a support method for the .NET bindings.
|
virtual |
Returns the number of proxy object creations before a forced .NET GC.
This method is a support method for the .NET bindings.
|
virtual |
Returns the assembly name fragments for which type analysis is performed.
This method is a support method for the .NET bindings.
|
virtual |
Returns the value of the server flag.
|
virtual |
Returns the assembly name fragments for which no type analysis is performed.
This method is a support method for the .NET bindings.
|
virtual |
Returns the tracing level for a given category.
fac | the tracing facility for which we wish to know the current minimum level. |
void xmog_options::printJvmPathAndExit | ( | ) |
Prints the configured JvmPath to stdout and exits.
This function is useful to query an application's configured JVM and set up the LD_LIBRARY_PATH (LIBPATH,...) if the builtin function for that purpose does not work with the configured JVM.
|
virtual |
Reads a configuration file and initializes the instance with the found settings.
file | the name of the configuration file which contains runtime configuration settings. |
vers | the version string we're looking for in the configfile. |
conf | the configuration name string we're looking for in the configfile. |
reserved0 | should always be NULL . |
|
virtual |
Sets the flag controlling whether COM exception support should be turned on.
This method is a support method for the .NET bindings.
ce | true if COM exception support is to be turned on. |
|
virtual |
Sets the flag controlling whether COM exception support should be turned on.
This method is a support method for the .NET bindings.
ce | "true" if COM exception support is to be turned on. |
|
virtual |
Sets the default encoding that is used by newly created threads that are attached to the JVM.
enc | the encoding to be used. The following encodings are supported by all JVMs: US-ASCII , ISO-8859-1 , UTF-8 , UTF-16BE , UTF-16LE , and UTF-16 . Other encodings are supported as well. |
|
virtual |
Sets the JVM path that is to be used.
jvmPath | the path to the JVM that is to be used by the native process if in-process JNI is desired. |
void xmog_options::setLdLibraryPath | ( | const char * | path | ) |
Sets the environment variable that is responsible for specifying the path on which shared libraries are searched for.
This function is not the corresponding function to getLdLibraryPath(). This function allows the specification of an arbitrary path whereas the getLdLibraryPath() function returns the union of the already configured path and the directories required for the currently configured JVM.
|
virtual |
Sets the runtime mode.
In native library mode, the runtime library will assume that it is being used inside a Java process. This means that it will not attempt to load a JVM and it will also adjust certain initialization behaviors that would be required if the library were to lauch a JVM.
native | true if the library is used in "native library" mode, false otherwise. The default value is false . |
|
virtual |
Sets the runtime mode.
In native library mode, the runtime library will assume that it is being used inside a Java process. This means that it will not attempt to load a JVM and it will also adjust certain initialization behaviors that would be required if the library were to lauch a JVM.
This property, like most properties, has to be set before the runtime attempts to make a connection to the Java side. You can do this in a config hook that gets invoked before loading, in some static initialization code in your native library, or in an environment option.
native | "true" if the library is used in "native library" mode, "false" otherwise. The default value is false . |
|
virtual |
Sets the shutdown policy.
Sometimes the operating system unloads the JVM before the process has had a chance to call all the object destructors. In that case, the process will crash on exit. Setting the noshutdown flag to true
will prevent the destructors from executing and prevent the crash.
noshut | "true" to suppress JVM cleanup during shutdown processing, "false" otherwise. |
|
virtual |
Sets the shutdown policy.
Sometimes the operating system unloads the JVM before the process has had a chance to call all the object destructors. In that case, the process will crash on exit. Setting the noshutdown flag to true
will prevent the destructors from executing and prevent the crash.
noshut | "true" to suppress JVM cleanup during shutdown processing, "false" otherwise. |
|
virtual |
Sets the flag controlling whether COM exception support should be turned on.
This method is a support method for the .NET bindings.
ce | true if COM exception support is to be turned on. |
|
virtual |
Sets the number of milliseconds between forced GCs in .NET.
This method is a support method for the .NET bindings and does not have any usefulness for C++ applicaitons.
ms | the number of milliseconds. |
|
virtual |
Sets the number of proxy object creations before a forced .NET GC.
This method is a support method for the .NET bindings and does not have any usefulness for C++ applicaitons.
ms | string representing the number of proxy object creations. |
|
virtual |
Sets the number of proxy object creations before a forced .NET GC.
This method is a support method for the .NET bindings and does not have any usefulness for C++ applicaitons.
ms | the number of proxy object creations. |
|
virtual |
Sets the assemblies for which type analysis is performed.
This method is a support method for the .NET bindings.
perform | semicolon-separated list of assembly name fragments. |
|
virtual |
Sets the remote flag.
Use true
to use the remote connection settings to attempt connecting to an out-of-process JVM, false
for in-process JNI.
remote | true if remote execution is desired, false otherwise. |
|
virtual |
Sets the remote flag.
Use true
to use the remote connection settings to attempt connecting to an out-of-process JVM, false
for in-process JNI.
remote | "true" if remote execution is desired, "false" otherwise. |
|
virtual |
Sets the server flag.
|
virtual |
Sets the assemblies for which no type analysis is performed.
This method is a support method for the .NET bindings.
skip | semicolon-separated list of assembly name fragments. |
|
virtual |
Sets the trace file.
Allows tracing output to be rerouted to a file that is specified by name. The strings "stdout"
and "stderr"
refer to the console output and error output streams and are treated specially. NULL
will simply close a possibly open tracing stream and not open a new one.
This function delegates to the newer setTraceFile()
function that takes an additional integer argument that represents the trace file ring size. The default value for the ring size is 0, i.e. we don't retain any old trace files.
traceFile | the trace file to which we're printing trace messages. |
|
virtual |
Sets the trace file and the file ring size.
Allows tracing output to be rerouted to a file that is specified by name. The strings "stdout"
and "stderr"
refer to the console output and error output streams and are treated specially. NULL
will simply close a possibly open tracing stream and not open a new one.
The number of trace files is interpreted as a limit that prevents the creation of ever new trace files.
traceFile | the trace file to which we're printing trace messages. |
numTraceFiles | the number of old trace files that are retained. |
|
virtual |
Sets the number of trace files to be retained.
Trace files are overwritten each time the process starts afresh. Setting a non-zero value here allows you to specify the number of old files that you wish to retain. They get renamed by appending a period followed by an integer. The higher the integer, the older the file.
traceFileCount | a string containing a numeric value representing the number of trace files to retain. |
|
virtual |
Sets the number of trace files to be retained.
Trace files are overwritten each time the process starts afresh. Setting a non-zero value here allows you to specify the number of old files that you wish to retain. They get renamed by appending a period followed by an integer. The higher the integer, the older the file.
traceFileCount | a numeric value representing the number of trace files to retain. |
|
virtual |
Sets the tracing level for a given tracing category.
This method can be used to set the threshold level above which tracing messages will be used for a given facility.
facAndLevel | the tracing facility and level. |
|
virtual |
Sets the tracing level for a given tracing category.
This method can be used to set the threshold level above which tracing messages will be used for a given facility.
fac | the tracing facility for which we're setting the minimum level. |
level | the minimum level of importance that we're tracing. |
|
virtual |
Sets the tracing level for a given tracing category.
This method can be used to set the threshold level above which tracing messages will be used for a given facility.
fac | the tracing facility for which we're setting the minimum level. |
level | the minimum level of importance that we're tracing. |
|
virtual |
Sets the tracing level for a given tracing category.
This method can be used to set the threshold level above which tracing messages will be used for a given facility.
fac | the tracing facility for which we're setting the minimum level. |
level | the minimum level of importance that we're tracing. |
|
virtual |
Sets the flag controlling whether a Codemesh SecurityManager should be used.
ce | true if the Codemesh security manager should be used. |
|
virtual |
Sets the flag controlling whether a Codemesh SecurityManager should be used.
ce | "true" if the Codemesh security manager should be used. |
|
virtual |
Trace a certain message belonging to a certain category at a certain level.
fac | the trace facility(s) for which this message is relevant. |
level | the trace level of this message. |
format | the message or format string (in printf style). |
Implements xmog_tracer.
|
virtual |
Trace a certain message belonging to a certain category at a certain level.
fac | the trace facility for which this message is relevant. |
level | the trace level of this message. |
format | the message or format string (in printf style). |
Implements xmog_tracer.