Codemesh Runtime v3 C++ API Reference  3.9.205
Public Member Functions | Protected Member Functions | List of all members
xmog_jvm_options Class Reference

A class abstracting the maintenance and initialization of JVM configuration options. More...

#include <xmog_jvm_options.h>

Inheritance diagram for xmog_jvm_options:
Inheritance graph
[legend]

Public Member Functions

 xmog_jvm_options (const char *filename, XMOGVERSION vers, XMOGCONFIG conf, XMOGVERSION reserved0, bool bEnvOverrides=true)
 Creates an options object. More...
 
virtual void * getInitArgs (jint jniVersion)
 Returns a pointer to an object that can be used to initialize a JVM. More...
 
virtual int readJvmOptions (const char *file, XMOGVERSION vers=NULL, XMOGCONFIG conf=NULL, XMOGVERSION reserved0=NULL)
 Reads the JVM initialization options from a configuration file or the Windows registry. More...
 
virtual void reset ()
 Reestablishes the default (uninitialized) values. More...
 
virtual void setJniVersion (jint version)
 Sets the JNI version that is going to be used (in JRE 1.2.x or higher only). More...
 
virtual void setJniVersion (const char *version)
 Sets the JNI version that is going to be used (in JRE 1.2.x or higher only). More...
 
virtual jint getJniVersion ()
 Returns the configured JNI version. More...
 
virtual void setIgnoreUnrecognized (bool ignore)
 Sets whether or not unrecognized initialization options should be ignored or not. More...
 
virtual void setIgnoreUnrecognized (const char *ignore)
 Sets whether or not unrecognized initialization options should be ignored or not. More...
 
virtual bool getIgnoreUnrecognized ()
 Returns whether or not unrecognized initialization options are ignored or not. More...
 
virtual void setStackSizeInKB (jint ss)
 Sets the stack size for Java threads in kB. More...
 
virtual void setStackSize (const char *ss)
 Sets the stack size for Java threads. More...
 
virtual jint getStackSizeInKB ()
 Returns the stack size for Java threads in kB.
 
virtual void setInitialHeapSizeInMB (jint ihs)
 Sets the initial heap size for Java threads in MB. More...
 
virtual void setInitialHeapSize (const char *ihs)
 Sets the initial heap size. More...
 
virtual jint getInitialHeapSizeInMB ()
 Returns the initial heapsize in MB.
 
virtual void setMaximumHeapSizeInMB (jint mhs)
 Sets the maximum heap size in MB. More...
 
virtual void setMaximumHeapSize (const char *mhs)
 Sets the maximum heap size. More...
 
virtual jint getMaximumHeapSizeInMB ()
 Returns the configured maximum heap size in MB or 0 if none is configured.
 
virtual void setDashDOption (const char *name, const char *value=0)
 Sets a -D option (a system property). More...
 
virtual char * getDashDOption (const char *name)
 Returns the value of a -D option (a system property) or NULL if the option is undefined. More...
 
virtual void removeDashDOption (const char *name)
 Removes a -D option (a system property) from the configuration. More...
 
virtual void setDashXOption (const char *name, const char *value=0)
 Sets a -X option (a generic JVM option). More...
 
virtual char * getDashXOption (const char *name)
 Returns the value of a -X option (a generic JVM option) or NULL if the option is undefined. More...
 
virtual void removeDashXOption (const char *name)
 Removes a -X option (a generic JVM option) from the configuration. More...
 
virtual void setOtherOption (const char *namevalue, void *ptr=0)
 Allows the specification of a JVM option that is neither a -D nor a -X option. More...
 
virtual void * getOtherOption (const char *name)
 Allows the querying of a JVM option that is neither a -D nor a -X option. More...
 
virtual void removeOtherOption (const char *name)
 Removes a JVM option that is neither a -D nor a -X option. More...
 
virtual void setClassPath (const char *cp)
 Sets the system classpath. More...
 
virtual void appendToClassPath (const char *cp)
 Appends a string to the system classpath. More...
 
virtual void prependToClassPath (const char *cp)
 Prepends a string to the system classpath. More...
 
virtual char * getClassPath ()
 Returns the configured system classpath.
 
virtual void setLibraryPath (const char *lp)
 Sets the path on which the JVM searches for native libraries. More...
 
virtual void appendToLibraryPath (const char *lp)
 Appends a string to the library search path. More...
 
virtual char * getLibraryPath ()
 Returns the configured library search path.
 
virtual void setExtensionsDirectories (const char *ed)
 Sets the path on which the JVM searches for jarfiles that are treated like system types. More...
 
virtual void appendToExtensionsDirectories (const char *ed)
 Appends a directory to the extensions path. More...
 
virtual char * getExtensionsDirectories ()
 Returns the configured extensions directories.
 
virtual void setSecurityManager (const char *sm)
 Sets the class that is the security manager for the application. More...
 
virtual char * getSecurityManager ()
 Returns the classname of the application's security manager. More...
 
virtual void setSecurityPolicy (const char *policyFile)
 Sets the policy file containing security settings for the application. More...
 
virtual char * getSecurityPolicy ()
 Returns the filename of the application's security policy. More...
 
virtual void setVfprintf (XMOG_VFPRINTF vfp)
 Sets the vfprintf callback that the JVM uses for reporting JVM information. More...
 
virtual void setVfprintf (const char *vfp)
 Sets the vfprintf callback that the JVM uses for reporting JVM information. More...
 
virtual XMOG_VFPRINTF getVfprintf ()
 Returns the vfprintf callback that the JVM uses for reporting JVM information. More...
 
virtual void setExit (XMOG_EXIT ex)
 Sets the callback that the JVM calls before
exiting. More...
 
virtual void setExit (const char *ex)
 Sets the callback that the JVM calls before
exiting. More...
 
virtual XMOG_EXIT getExit ()
 Returns the exit callback that the JVM calls before exiting. More...
 
virtual void setAbort (XMOG_ABORT ab)
 Sets the callback that the JVM calls before
aborting. More...
 
virtual void setAbort (const char *ab)
 Sets the callback that the JVM calls before
aborting. More...
 
virtual XMOG_ABORT getAbort ()
 Returns the abort callback that the JVM calls before aborting. More...
 
virtual void setDisableClassGC (bool dcgc)
 Sets the value of the -Xnoclassgc option. More...
 
virtual void setDisableClassGC (const char *dcgc)
 Sets the value of the -Xnoclassgc option. More...
 
virtual bool getDisableClassGC ()
 Returns the value of the -Xnoclassgc option. More...
 
virtual void setEnableClassGC (bool ecgc)
 Sets the opposite of the value of the -Xnoclassgc option. More...
 
virtual void setEnableClassGC (const char *ecgc)
 Sets the opposite of the value of the -Xnoclassgc option. More...
 
virtual bool getEnableClassGC ()
 Returns the opposite of the value of the -Xnoclassgc option. More...
 
virtual void setEnableVerboseGC (bool evgc)
 
virtual void setEnableVerboseGC (const char *evgc)
 
virtual bool getEnableVerboseGC ()
 
virtual void setEnabledAssertions (const char *ea)
 
virtual void appendToEnabledAssertions (const char *ea)
 
virtual char * getEnabledAssertions ()
 
virtual void setDisabledAssertions (const char *da)
 
virtual void appendToDisabledAssertions (const char *da)
 
virtual char * getDisabledAssertions ()
 
virtual void setEnableSystemAssertions (bool esa)
 
virtual void setEnableSystemAssertions (const char *esa)
 
virtual bool getEnableSystemAssertions ()
 
virtual void setDisableSystemAssertions (bool dsa)
 
virtual void setDisableSystemAssertions (const char *dsa)
 
virtual bool getDisableSystemAssertions ()
 
virtual void setVerbosity (int v)
 
virtual void setVerbosity (const char *v)
 
virtual void setVerbosity (xmog_jvm_verbosity v)
 
virtual xmog_jvm_verbosity getVerbosity ()
 Returns the configured JVM verbosity. More...
 
virtual void setMixedMode (bool m)
 Sets the value of the -Xmixed option. More...
 
virtual void setMixedMode (const char *m)
 Sets the value of the -Xmixed option. More...
 
virtual bool getMixedMode ()
 Returns the value of the -Xmixed option. More...
 
virtual void setInterpretedMode (bool i)
 Sets the value of the -Xint option. More...
 
virtual void setInterpretedMode (const char *i)
 Sets the value of the -Xint option. More...
 
virtual bool getInterpretedMode ()
 Returns the value of the -Xint option. More...
 
virtual void setAppendBootClassPath (const char *cp)
 Sets the value of the -Xbootclasspath/a: option. More...
 
virtual void appendToAppendBootClassPath (const char *cp)
 Appends a classpath root to the current value of the -Xbootclasspath/a: option. More...
 
virtual char * getAppendBootClassPath ()
 Returns the value of the -Xbootclasspath/a: option. More...
 
virtual void setPrependBootClassPath (const char *cp)
 Sets the value of the -Xbootclasspath/p: option. More...
 
virtual void appendToPrependBootClassPath (const char *cp)
 Appends a classpath root to the current value of the -Xbootclasspath/p: option. More...
 
virtual char * getPrependBootClassPath ()
 Returns the value of the -Xbootclasspath/p: option. More...
 
virtual void setBootClassPath (const char *cp)
 Sets the value of the -Xbootclasspath: option. More...
 
virtual void appendToBootClassPath (const char *cp)
 Appends a new classpath root to the value of the -Xbootclasspath: option. More...
 
virtual char * getBootClassPath ()
 Returns the value of the -Xbootclasspath: option. More...
 
virtual void setIncrementalGC (bool i)
 Enables or disables incremental garbage collection. More...
 
virtual void setIncrementalGC (const char *i)
 Enables or disables incremental garbage collection. More...
 
virtual bool getIncrementalGC ()
 Returns the value of the incremental garbage collection option. More...
 
virtual void setLogGCFile (const char *file)
 Sets the log file used by the JVM. More...
 
virtual char * getLogGCFile ()
 Returns the value of the garbage collection log file option. More...
 
virtual void setBatchMode (bool b)
 Sets or clears the -Xbatch option. More...
 
virtual void setBatchMode (const char *b)
 Sets or clears the -Xbatch option. More...
 
virtual bool getBatchMode ()
 Returns true if the -Xbatch option is set, false otherwise.
 
virtual void setProf (bool p)
 Sets the -Xprof option if true. More...
 
virtual void setProf (const char *p)
 Sets the -Xprof option if "true". More...
 
virtual bool getProf ()
 Returns true if the -Xprof options is used.
 
virtual void setRun (const char *runopts)
 Sets the -Xrun option. More...
 
virtual char * getRun ()
 Returns the value of the -Xrun option.
 
virtual void setDebug (bool d)
 Sets or clears the -Xdebug option. More...
 
virtual void setDebug (const char *d)
 Sets or clears the -Xdebug option. More...
 
virtual bool getDebug ()
 Returns true if the -Xdebug option is set, false otherwise.
 
virtual void setNoagent (bool na)
 Sets or clears the -Xnoagent option. More...
 
virtual void setNoagent (const char *na)
 Sets or clears the -Xnoagent option. More...
 
virtual bool getNoagent ()
 Returns true if the -Xnoagent option is set, false otherwise.
 
virtual void setReduceSignals (bool rs)
 Sets or clears the -Xrs option. More...
 
virtual void setReduceSignals (const char *rs)
 Sets or clears the -Xrs option. More...
 
virtual bool getReduceSignals ()
 Returns true if the -Xrs option is set, false otherwise.
 
virtual void setCheckJni (bool cjni)
 Sets or clears the -Xcheck:jni option. More...
 
virtual void setCheckJni (const char *cjni)
 Sets or clears the -Xcheck:jni option. More...
 
virtual bool getCheckJni ()
 Returns true if the -Xcheck:jni option is set, false otherwise.
 
virtual void setFuture (bool future)
 Sets or clears the -Xfuture option. More...
 
virtual void setFuture (const char *future)
 Sets or clears the -Xfuture option. More...
 
virtual bool getFuture ()
 Returns true if the -Xfuture option is set, false otherwise.
 
virtual void addAgentLib (const char *pAgentLib)
 Add an -agentlib: option to the settings. More...
 
virtual void addAgentPath (const char *pAgentPath)
 Add an -agentpath: option to the settings. More...
 
virtual void addJavaAgent (const char *pJavaAgent)
 Add an -javaagent: option to the settings. More...
 
virtual void mergeWithDefaults (JDK1_1InitArgs &iargs11)
 A deprecated JNI 1.1 option.
 
virtual void setCheckSource (bool cs)
 A deprecated JNI 1.1 option.
 
virtual bool getCheckSource ()
 A deprecated JNI 1.1 option.
 
virtual void setNativeStackSizeInKB (jint nss)
 A deprecated JNI 1.1 option.
 
virtual jint getNativeStackSizeInKB ()
 A deprecated JNI 1.1 option.
 
virtual void setVerifyMode (xmog_bytecode_verification ver)
 A deprecated JNI 1.1 option.
 
virtual xmog_bytecode_verification getVerifyMode ()
 A deprecated JNI 1.1 option.
 
virtual void setDisableAsyncGC (bool dagc)
 A deprecated JNI 1.1 option.
 
virtual bool getDisableAsyncGC ()
 A deprecated JNI 1.1 option.
 
virtual void addModules (const char *pMdules)
 Add an –add-modules option to the setings. More...
 
virtual void setModulePath (const char *mp)
 Sets the module path. More...
 
virtual void appendToModulePath (const char *mp)
 Appends a string to the module path. More...
 
virtual void prependToModulePath (const char *mp)
 Prepends a string to the module path. More...
 
virtual char * getModulePath ()
 Returns the configured module path. More...
 
virtual void addOpens (const char *pMod, const char *pPackage, const char *pReadingModule="ALL-UNNAMED")
 Opens a package to a module. More...
 
virtual void addExports (const char *pMod, const char *pPackage, const char *pReadingModule="ALL-UNNAMED")
 Exports a package to a module. More...
 
virtual void addReads (const char *pModule, const char *pModules)
 Enables a module to use public types from one or more other modules. More...
 

Protected Member Functions

 xmog_jvm_options (bool bEnvOverrides=true)
 
 xmog_jvm_options (const char *filename, bool bEnvOverrides=true)
 
 xmog_jvm_options (XMOGVERSION vers, XMOGCONFIG conf, XMOGVERSION reserved0, bool bEnvOverrides=true)
 
 xmog_jvm_options (int argc, char *argv[], bool bEnvOverrides=true)
 
void env_override ()
 

Detailed Description

A class abstracting the maintenance and initialization of JVM configuration options.

This class is usually used via inheritance, through the xmog_jvm_loader type, which acts as a factory for an xmog_jvm instance. The derived type inherits all the methods for getting and setting JVM initialization settings like system properties or memory options. This type supports the following settings:

Setting File or Registry CLI Environment Description
Abort callback Abort -abort XMOG_ABORT The abort callback function.
AppendBootclasspath AppendBootClasspath -bootclasspath/a: XMOG_BOOT_CLASS_PATH The append bootclasspath to be used. This corresponds with the -Xbootclasspath/a: option.
Bootclasspath BootClasspath -bootclasspath: XMOG_BOOT_CLASS_PATH The bootclasspath to be used. This corresponds with the -Xbootclasspath: option.
Check JNI CheckJni -check:jni XMOG_CHECK_JNI Run extra validation code on JNI arguments and calls. Much slower than normal operation; should only be used in debugging scenarios. This corresponds with the -Xcheck:jni option.
Classpath Classpath -classpath CLASSPATH The classpath to be used. This corresponds with the Java -cp option.
-D Options Add a generic -D option. This corresponds with the Java -D option.
Debug Debug -debug XMOG_DEBUG Run the JVM in debug mode. This corresponds with the Java -Xdebug option.
Ignore unrecognized IgnoreUnrecognized     Boolean value which specifies whether we're ignoring unrecognized JNI options or whether we're failing JVM initialization in such a case.
Initial heapsize InitialHeapSize   XMOG_INITIAL_HEAPSIZE Corresponds with the Java -Xms option.
JNI version JNIVersion     Set the version number of the JNIEnv that we're requesting.
Maximum heapsize MaximumHeapSize   XMOG_MAXIMUM_HEAPSIZE Corresponds with the Java -Xmx option.
Profiling Prof -prof XMOG_PROF Add "prof" options, for example for profiling or debugging. This corresponds with the Java -Xprof option.
Run option Run -run XMOG_RUN Add "run" options, for example for profiling or debugging. This corresponds with the Java -Xrun option.
Stack size StackSize   XMOG_STACKSIZE Corresponds with the Java -Xss option.
-X Options Add a generic -X option. This corresponds with the Java -X option.

Constructor & Destructor Documentation

◆ xmog_jvm_options()

xmog_jvm_options::xmog_jvm_options ( const char *  filename,
XMOGVERSION  vers,
XMOGCONFIG  conf,
XMOGVERSION  reserved0,
bool  bEnvOverrides = true 
)

Creates an options object.

Parameters
filenamethe name of the file containing the configuration data. May be NULL to signal the registry on Windows.
versthe version number. May be NULL if old-style file format is not used.
confthe configuration name. May be NULL if old-style file format is not used.
reserved0Unused.
bEnvOverridetrue if environment variables can be used to override settings. Defaults to true.

Member Function Documentation

◆ addAgentLib()

virtual void xmog_jvm_options::addAgentLib ( const char *  pAgentLib)
virtual

Add an -agentlib: option to the settings.

Parameters
pAgentLibthe value of the option that should contain everything following the leading -agentlib: string.

◆ addAgentPath()

virtual void xmog_jvm_options::addAgentPath ( const char *  pAgentPath)
virtual

Add an -agentpath: option to the settings.

Parameters
pAgentPaththe value of the option that should contain everything following the leading -agentpath: string.

◆ addExports()

virtual void xmog_jvm_options::addExports ( const char *  pMod,
const char *  pPackage,
const char *  pReadingModule = "ALL-UNNAMED" 
)
virtual

Exports a package to a module.

This option corresponds with the –add-exports commandline option.

This option should only be used with Java9 or higher, so if you are uncertain about your JRE you probably should not use it.

Since
3.9
Parameters
pModthe module in which the package we want to export resides.
pPackagethe package we want to make accessible.
pReadingModulethe module to which we want to open the package. This defaults to ALL-UNNAMED, meaning that the package is opened to all types on the legacy classpath.

◆ addJavaAgent()

virtual void xmog_jvm_options::addJavaAgent ( const char *  pJavaAgent)
virtual

Add an -javaagent: option to the settings.

Parameters
pJavaAgentthe value of the option that should contain everything following the leading -javaagent: string.

◆ addModules()

virtual void xmog_jvm_options::addModules ( const char *  pMdules)
virtual

Add an –add-modules option to the setings.

This setting should only be used with Java9 or higher, so if you are uncertain about your JRE you probably should not use it.

Since
3.9
Parameters
pModulesthe value of the option that should contain anything following the space after –add-modules used from the launcher's commandline. This is usually a comma-separated list of module names or ALL-DEFAULT, ALL-SYSTEM, or ALL-MODULE-PATH.

◆ addOpens()

virtual void xmog_jvm_options::addOpens ( const char *  pMod,
const char *  pPackage,
const char *  pReadingModule = "ALL-UNNAMED" 
)
virtual

Opens a package to a module.

This option corresponds with the –add-opens commandline option.

This option should only be used with Java9 or higher, so if you are uncertain about your JRE you probably should not use it.

Since
3.9
Parameters
pModthe module in which the package we want to open resides.
pPackagethe package we want to make accessible.
pReadingModulethe module to which we want to open the package. This defaults to ALL-UNNAMED, meaning that the package is opened to all types on the legacy classpath.

◆ addReads()

virtual void xmog_jvm_options::addReads ( const char *  pModule,
const char *  pModules 
)
virtual

Enables a module to use public types from one or more other modules.

This option corresponds with the –add-reads commandline option.

Multiple invocations with the same accessing module name will cause the accessed modules to be appended into a comma-separated list This option should only be used with Java9 or higher, so if you are uncertain about your JRE you probably should not use it.

Since
3.9
Parameters
pModulethe module which wants access to some public types in other modules.
pModulesthe modules we want to access.

◆ appendToAppendBootClassPath()

virtual void xmog_jvm_options::appendToAppendBootClassPath ( const char *  cp)
virtual

Appends a classpath root to the current value of the -Xbootclasspath/a: option.

Parameters
cpthe classpath root to append to the append-bootclasspath.

◆ appendToBootClassPath()

virtual void xmog_jvm_options::appendToBootClassPath ( const char *  cp)
virtual

Appends a new classpath root to the value of the -Xbootclasspath: option.

The bootclasspath has been removed from JVMs starting with Java9. You can still use the appendbootclasspath and the prepentbootclasspath settings. Using the bootclasspath with a Java9+ JVM will cause a launch failure.

Parameters
cpthe new classpath root that is appended to the bootclasspath.

◆ appendToClassPath()

virtual void xmog_jvm_options::appendToClassPath ( const char *  cp)
virtual

Appends a string to the system classpath.

Since runtime version 3.7 this option supports a trailing asterisk and embedded environment variables in notation.

Parameters
cpan additional classpath root for the system classpath.

◆ appendToExtensionsDirectories()

virtual void xmog_jvm_options::appendToExtensionsDirectories ( const char *  ed)
virtual

Appends a directory to the extensions path.

Parameters
edan additional root for the extensions path.

◆ appendToLibraryPath()

virtual void xmog_jvm_options::appendToLibraryPath ( const char *  lp)
virtual

Appends a string to the library search path.

Parameters
lpan additional root for the library search path.

◆ appendToModulePath()

virtual void xmog_jvm_options::appendToModulePath ( const char *  mp)
virtual

Appends a string to the module path.

Since
3.9
Parameters
mpan additional module path root for the module path

◆ appendToPrependBootClassPath()

virtual void xmog_jvm_options::appendToPrependBootClassPath ( const char *  cp)
virtual

Appends a classpath root to the current value of the -Xbootclasspath/p: option.

Parameters
cpthe classpath root to append to the prepend-bootclasspath.

◆ getAbort()

virtual XMOG_ABORT xmog_jvm_options::getAbort ( )
virtual

Returns the abort callback that the JVM calls before aborting.

◆ getAppendBootClassPath()

virtual char* xmog_jvm_options::getAppendBootClassPath ( )
virtual

Returns the value of the -Xbootclasspath/a: option.

Returns
the configured path or NULL if none is configured.

◆ getBootClassPath()

virtual char* xmog_jvm_options::getBootClassPath ( )
virtual

Returns the value of the -Xbootclasspath: option.

The bootclasspath has been removed from JVMs starting with Java9. You can still use the appendbootclasspath and the prepentbootclasspath settings. Using the bootclasspath with a Java9+ JVM will cause a launch failure.

Returns
the configured path or NULL if none is configured.

◆ getDashDOption()

virtual char* xmog_jvm_options::getDashDOption ( const char *  name)
virtual

Returns the value of a -D option (a system property) or NULL if the option is undefined.

Parameters
namethe property's name.

◆ getDashXOption()

virtual char* xmog_jvm_options::getDashXOption ( const char *  name)
virtual

Returns the value of a -X option (a generic JVM option) or NULL if the option is undefined.

Parameters
namethe option's name.

◆ getDisableClassGC()

virtual bool xmog_jvm_options::getDisableClassGC ( )
virtual

Returns the value of the -Xnoclassgc option.

Returns
true if the JVM will be configured to disable garbage collection of classes.

◆ getEnableClassGC()

virtual bool xmog_jvm_options::getEnableClassGC ( )
virtual

Returns the opposite of the value of the -Xnoclassgc option.

Returns
true if the JVM will not be configured to disable garbage collection of classes.

◆ getExit()

virtual XMOG_EXIT xmog_jvm_options::getExit ( )
virtual

Returns the exit callback that the JVM calls before exiting.

◆ getIgnoreUnrecognized()

virtual bool xmog_jvm_options::getIgnoreUnrecognized ( )
virtual

Returns whether or not unrecognized initialization options are ignored or not.

See also
setIgnoreUnrecognized()

◆ getIncrementalGC()

virtual bool xmog_jvm_options::getIncrementalGC ( )
virtual

Returns the value of the incremental garbage collection option.

This method returns true if the -Xincgc commandline option would be used.

Returns
true if the -Xincgc options would be used.

◆ getInitArgs()

virtual void* xmog_jvm_options::getInitArgs ( jint  jniVersion)
virtual

Returns a pointer to an object that can be used to initialize a JVM.

The caller does not have to delete the returned value because the instance is maintained internally.

Parameters
jniVersionthe JNI version for which we want an initializing object. Different versions of JREs require different types of initialization types. The JNI version number is used to distinguish between the different requirements. Use 0x00010001 for JRE 1.1.x, 0x00010002 for JRE 1.2 and higher, 0x00010004 for JRE 1.4.x or higher. Using an unnecesarily small value will work, but it will restrict the runtime's ability to use more advanced JNI features.
Returns
an internally maintained instance of a JVM initialization object. The caller does not have to perform any cleanup.

◆ getInterpretedMode()

virtual bool xmog_jvm_options::getInterpretedMode ( )
virtual

Returns the value of the -Xint option.

Returns
true if the JVM will be configured to only support interpreted mode execution.

◆ getJniVersion()

virtual jint xmog_jvm_options::getJniVersion ( )
virtual

Returns the configured JNI version.

The default value is 0x00010002 (65538), representing JRE 1.2.

◆ getLogGCFile()

virtual char* xmog_jvm_options::getLogGCFile ( )
virtual

Returns the value of the garbage collection log file option.

This method returns the value of the -Xloggc commandline option (null if the setting is not being used.)

Returns
NULL or the name of the log file.

◆ getMixedMode()

virtual bool xmog_jvm_options::getMixedMode ( )
virtual

Returns the value of the -Xmixed option.

Returns
true if the JVM will be configured to support mixed mode execution.

◆ getModulePath()

virtual char* xmog_jvm_options::getModulePath ( )
virtual

Returns the configured module path.

Since
3.9

◆ getOtherOption()

virtual void* xmog_jvm_options::getOtherOption ( const char *  name)
virtual

Allows the querying of a JVM option that is neither a -D nor a -X option.

Parameters
namethe entire option, name and value together.

◆ getPrependBootClassPath()

virtual char* xmog_jvm_options::getPrependBootClassPath ( )
virtual

Returns the value of the -Xbootclasspath/p: option.

Returns
the configured path or NULL if none is configured.

◆ getSecurityManager()

virtual char* xmog_jvm_options::getSecurityManager ( )
virtual

Returns the classname of the application's security manager.

◆ getSecurityPolicy()

virtual char* xmog_jvm_options::getSecurityPolicy ( )
virtual

Returns the filename of the application's security policy.

◆ getVerbosity()

virtual xmog_jvm_verbosity xmog_jvm_options::getVerbosity ( )
virtual

Returns the configured JVM verbosity.

Returns
the configured JVM verbosity.

◆ getVfprintf()

virtual XMOG_VFPRINTF xmog_jvm_options::getVfprintf ( )
virtual

Returns the vfprintf callback that the JVM uses for reporting JVM information.

◆ prependToClassPath()

virtual void xmog_jvm_options::prependToClassPath ( const char *  cp)
virtual

Prepends a string to the system classpath.

Prepending is implemented as appending the original classpath to the given path. This is an unimportant implementation detail but it might confuse you if you look at the tracing output of this method.

Since runtime version 3.7 this option supports a trailing asterisk and embedded environment variables in notation.

Parameters
cpan additional classpath root for the system classpath.

◆ prependToModulePath()

virtual void xmog_jvm_options::prependToModulePath ( const char *  mp)
virtual

Prepends a string to the module path.

Prepending is implemented as appending the original module path to the given path. This is an unimportant implementation detail but it might confuse you if you look at the tracing output of this method.

Since
3.9
Parameters
mpan additional classpath root for the module path.

◆ readJvmOptions()

virtual int xmog_jvm_options::readJvmOptions ( const char *  file,
XMOGVERSION  vers = NULL,
XMOGCONFIG  conf = NULL,
XMOGVERSION  reserved0 = NULL 
)
virtual

Reads the JVM initialization options from a configuration file or the Windows registry.

This method is used to load the JVM initialization options from a file or from the Windows registry. Currently, old-style JunC++ion configuration files are supported as well as .NET-style configuration files.

Parameters
filethe configuration file that is to be read. This value may be NULL on Windows, but then the optional vers and conf arguments need to be provided. In the NULL case, the runtime is going to attempt reading the initialization values from the registry. In the non-NULL case, the configuration file may either be an old-style JunC++ion configuration file or a new-style .NET configuration file. The runtime is going to pick one based on the first character of the configuration file. If it is an '<', the .NET XML format is going to be expected, otherwise the old JunC++ion format is going to be expected.
versan optional argument providing the old-style JunC++ion version number. This argument is required for registry-based and old-style JunC++ion based configuration. Always use "2.0" here.
confan optional argument providing the old-style JunC++ion configuration name. This argument is required for registry-based and old-style JunC++ion based configuration. It represents your application's unique configuration identifier that allows multiple JunC++ion-enabled applications to co-reside on one host.
reserved0an optional argument that should always be NULL.

◆ removeDashDOption()

virtual void xmog_jvm_options::removeDashDOption ( const char *  name)
virtual

Removes a -D option (a system property) from the configuration.

Parameters
namethe property's name.

◆ removeDashXOption()

virtual void xmog_jvm_options::removeDashXOption ( const char *  name)
virtual

Removes a -X option (a generic JVM option) from the configuration.

Parameters
namethe option's name.

◆ removeOtherOption()

virtual void xmog_jvm_options::removeOtherOption ( const char *  name)
virtual

Removes a JVM option that is neither a -D nor a -X option.

Using this method, you can only remove exactly matching options, i.e. name and value of the option have to be identical.

Parameters
namethe entire option, name and value together.

◆ reset()

virtual void xmog_jvm_options::reset ( )
virtual

Reestablishes the default (uninitialized) values.

This method may be useful if you started to configure the options before discovering that you need to start over with different values.

◆ setAbort() [1/2]

virtual void xmog_jvm_options::setAbort ( const char *  ab)
virtual

Sets the callback that the JVM calls before
aborting.

Parameters
aba persisted function pointer.

◆ setAbort() [2/2]

virtual void xmog_jvm_options::setAbort ( XMOG_ABORT  ab)
virtual

Sets the callback that the JVM calls before
aborting.

Parameters
aba function pointer of type XMOG_ABORT.

◆ setAppendBootClassPath()

virtual void xmog_jvm_options::setAppendBootClassPath ( const char *  cp)
virtual

Sets the value of the -Xbootclasspath/a: option.

Parameters
cpthe new append-bootclasspath.

◆ setBatchMode() [1/2]

virtual void xmog_jvm_options::setBatchMode ( bool  b)
virtual

Sets or clears the -Xbatch option.

Parameters
btrue if the -Xbatch option is to be used, false if not.

◆ setBatchMode() [2/2]

virtual void xmog_jvm_options::setBatchMode ( const char *  b)
virtual

Sets or clears the -Xbatch option.

Parameters
b"true" if the -Xbatch option is to be used, "false" if not.

◆ setBootClassPath()

virtual void xmog_jvm_options::setBootClassPath ( const char *  cp)
virtual

Sets the value of the -Xbootclasspath: option.

The bootclasspath has been removed from JVMs starting with Java9. You can still use the appendbootclasspath and the prepentbootclasspath settings. Using the bootclasspath with a Java9+ JVM will cause a launch failure.

Parameters
cpthe new bootclasspath.

◆ setCheckJni() [1/2]

virtual void xmog_jvm_options::setCheckJni ( bool  cjni)
virtual

Sets or clears the -Xcheck:jni option.

You usually won't need this option unless you're debugging your application and want to rule out JNI errors. Setting this option can dramatically slow down your application.

Parameters
cjnitrue if the -Xcheck:jni option is to be used, false if not.

◆ setCheckJni() [2/2]

virtual void xmog_jvm_options::setCheckJni ( const char *  cjni)
virtual

Sets or clears the -Xcheck:jni option.

You usually won't need this option unless you're debugging your application and want to rule out JNI errors. Setting this option can dramatically slow down your application.

Parameters
cjni"true" if the -Xcheck:jni option is to be used, "false" if not.

◆ setClassPath()

virtual void xmog_jvm_options::setClassPath ( const char *  cp)
virtual

Sets the system classpath.

This method should be avoided in deference to appendToClassPath() in order to avoid path separator portability issues and to allow configuration hooks to contribute to the classpath configuration.

This method corresponds with the -cp commandline option.

Since runtime version 3.7 this option supports a trailing asterisk and embedded environment variables in notation.

Parameters
cpthe system classpath.

◆ setDashDOption()

virtual void xmog_jvm_options::setDashDOption ( const char *  name,
const char *  value = 0 
)
virtual

Sets a -D option (a system property).

Parameters
namethe property's name.
valuethe optional property value. Not every property has to have a value, some properties are useful just by virtue of being defined.

◆ setDashXOption()

virtual void xmog_jvm_options::setDashXOption ( const char *  name,
const char *  value = 0 
)
virtual

Sets a -X option (a generic JVM option).

Most commonly used JVM options are available via more convenient wrapper functions, but you can use the option's raw name as well.

Parameters
namethe option's name.
valuethe optional option value. If specified, the value is concatenated to the name to form the complete setting. Breaking the option into a name and a value allows the correct overriding of -X options with new values.

◆ setDebug() [1/2]

virtual void xmog_jvm_options::setDebug ( bool  d)
virtual

Sets or clears the -Xdebug option.

Parameters
dtrue if the -Xdebug option is to be used, false if not.

◆ setDebug() [2/2]

virtual void xmog_jvm_options::setDebug ( const char *  d)
virtual

Sets or clears the -Xdebug option.

Parameters
d"true" if the -Xdebug option is to be used, "false" if not.

◆ setDisableClassGC() [1/2]

virtual void xmog_jvm_options::setDisableClassGC ( bool  dcgc)
virtual

Sets the value of the -Xnoclassgc option.

Parameters
dcgctrue if the JVM will be configured to disable garbage collection of classes.

◆ setDisableClassGC() [2/2]

virtual void xmog_jvm_options::setDisableClassGC ( const char *  dcgc)
virtual

Sets the value of the -Xnoclassgc option.

Parameters
dcgc"true" if the JVM will be configured to disable garbage collection of classes.

◆ setEnableClassGC() [1/2]

virtual void xmog_jvm_options::setEnableClassGC ( bool  ecgc)
virtual

Sets the opposite of the value of the -Xnoclassgc option.

Parameters
ecgctrue if the JVM will not be configured to disable garbage collection of classes.

◆ setEnableClassGC() [2/2]

virtual void xmog_jvm_options::setEnableClassGC ( const char *  ecgc)
virtual

Sets the opposite of the value of the -Xnoclassgc option.

Parameters
ecgc"true" if the JVM will not be configured to disable garbage collection of classes.

◆ setExit() [1/2]

virtual void xmog_jvm_options::setExit ( const char *  ex)
virtual

Sets the callback that the JVM calls before
exiting.

Parameters
exa persisted function pointer.

◆ setExit() [2/2]

virtual void xmog_jvm_options::setExit ( XMOG_EXIT  ex)
virtual

Sets the callback that the JVM calls before
exiting.

Parameters
exa function pointer of type XMOG_EXIT.

◆ setExtensionsDirectories()

virtual void xmog_jvm_options::setExtensionsDirectories ( const char *  ed)
virtual

Sets the path on which the JVM searches for jarfiles that are treated like system types.

This method should be avoided in deference to appendToExtensionsDirectories() in order to avoid path separator portability issues and to allow configuration hooks to contribute to the configuration.

This method corresponds with the -Djava.ext.dirs commandline option.

Parameters
edthe native library searchpath.

◆ setFuture() [1/2]

virtual void xmog_jvm_options::setFuture ( bool  future)
virtual

Sets or clears the -Xfuture option.

Parameters
futuretrue if the -Xfuture option is to be used, false if not.

◆ setFuture() [2/2]

virtual void xmog_jvm_options::setFuture ( const char *  future)
virtual

Sets or clears the -Xfuture option.

Parameters
future"true" if the -Xfuture option is to be used, "false" if not.

◆ setIgnoreUnrecognized() [1/2]

virtual void xmog_jvm_options::setIgnoreUnrecognized ( bool  ignore)
virtual

Sets whether or not unrecognized initialization options should be ignored or not.

If this is set to false , an illegal configuration option will prevent the JVM from loading successfully. The default is true .

See also
getIgnoreUnrecognized()

◆ setIgnoreUnrecognized() [2/2]

virtual void xmog_jvm_options::setIgnoreUnrecognized ( const char *  ignore)
virtual

Sets whether or not unrecognized initialization options should be ignored or not.

If this is set to false, an illegal configuration option will prevent the JVM from loading successfully. The default is "true" .

Parameters
ignorelegal values are "true" or "false" .
See also
getIgnoreUnrecognized()

◆ setIncrementalGC() [1/2]

virtual void xmog_jvm_options::setIncrementalGC ( bool  i)
virtual

Enables or disables incremental garbage collection.

This method corresponds with the -Xincgc commandline option.

Parameters
itrue or false.

◆ setIncrementalGC() [2/2]

virtual void xmog_jvm_options::setIncrementalGC ( const char *  i)
virtual

Enables or disables incremental garbage collection.

This method corresponds with the -Xincgc commandline option.

Parameters
i"true" or "false".

◆ setInitialHeapSize()

virtual void xmog_jvm_options::setInitialHeapSize ( const char *  ihs)
virtual

Sets the initial heap size.

This method corresponds with the following implicit initialization mechanisms:

  • Environment variable name: XMOG_INITIAL_HEAPSIZE
  • Old-style configuration: -Xms in Java2 section of named configuration.
  • New-style configuration: InitialHeapSize key in JVM settings section.
    Parameters
    ihsthe initial heap size as a string. The string format supports multipliers like 'm' or 'k', for example
      setInitialHeapSize( "4m" );
    

◆ setInitialHeapSizeInMB()

virtual void xmog_jvm_options::setInitialHeapSizeInMB ( jint  ihs)
virtual

Sets the initial heap size for Java threads in MB.

This method corresponds with the following implicit initialization mechanisms:

  • Environment variable name: XMOG_INITIAL_HEAPSIZE
  • Old-style configuration: -Xms in Java2 section of named configuration.
  • New-style configuration: InitialHeapSize key in JVM settings section.

◆ setInterpretedMode() [1/2]

virtual void xmog_jvm_options::setInterpretedMode ( bool  i)
virtual

Sets the value of the -Xint option.

Parameters
itrue if the JVM will be configured to only support interpreted mode execution.

◆ setInterpretedMode() [2/2]

virtual void xmog_jvm_options::setInterpretedMode ( const char *  i)
virtual

Sets the value of the -Xint option.

Parameters
i"true" if the JVM will be configured to only support interpreted mode execution.

◆ setJniVersion() [1/2]

virtual void xmog_jvm_options::setJniVersion ( const char *  version)
virtual

Sets the JNI version that is going to be used (in JRE 1.2.x or higher only).

See also
getJniVersion()

◆ setJniVersion() [2/2]

virtual void xmog_jvm_options::setJniVersion ( jint  version)
virtual

Sets the JNI version that is going to be used (in JRE 1.2.x or higher only).

See also
getJniVersion()

◆ setLibraryPath()

virtual void xmog_jvm_options::setLibraryPath ( const char *  lp)
virtual

Sets the path on which the JVM searches for native libraries.

This method should be avoided in deference to appendToLibraryPath() in order to avoid path separator portability issues and to allow configuration hooks to contribute to the configuration.

This method corresponds with the -Djava.library.path commandline option.

Parameters
lpthe native library searchpath.

◆ setLogGCFile()

virtual void xmog_jvm_options::setLogGCFile ( const char *  file)
virtual

Sets the log file used by the JVM.

This method corresponds with the -Xloggc:<file> commandline option.
This is a JVM configuration option, not a framework configuration option. The framework tracing mechanism is unaffected by this setting.

Parameters
filethe name of the log file.

◆ setMaximumHeapSize()

virtual void xmog_jvm_options::setMaximumHeapSize ( const char *  mhs)
virtual

Sets the maximum heap size.

This method corresponds with the following implicit initialization mechanisms:

  • Environment variable name: XMOG_MAXIMUM_HEAPSIZE
  • Old-style configuration: -Xmx in Java2 section of named configuration.
  • New-style configuration: MaximumHeapSize key in JVM settings section.
    Parameters
    ihsthe initial heap size as a string. The string format supports multipliers like 'm' or 'k', for example
      setMaximumHeapSize( "4m" );
    
    mhsthe maximum heapsize as a string.

◆ setMaximumHeapSizeInMB()

virtual void xmog_jvm_options::setMaximumHeapSizeInMB ( jint  mhs)
virtual

Sets the maximum heap size in MB.

This method corresponds with the following implicit initialization mechanisms:

  • Environment variable name: XMOG_MAXIMUM_HEAPSIZE
  • Old-style configuration: -Xmx in Java2 section of named configuration.
  • New-style configuration: MaximumHeapSize key in JVM settings section.

◆ setMixedMode() [1/2]

virtual void xmog_jvm_options::setMixedMode ( bool  m)
virtual

Sets the value of the -Xmixed option.

Parameters
mtrue if the JVM will be configured to support mixed mode execution.

◆ setMixedMode() [2/2]

virtual void xmog_jvm_options::setMixedMode ( const char *  m)
virtual

Sets the value of the -Xmixed option.

Parameters
m"true" if the JVM will be configured to support mixed mode execution.

◆ setModulePath()

virtual void xmog_jvm_options::setModulePath ( const char *  mp)
virtual

Sets the module path.

This method should be avoided in deference to appendToModulePath() in order to avoid path separator portability issues and to allow configuration hooks to contribute to the module path configuration.

Passing NULL to this method causes the module path option to be deleted.

Since
3.9

This method corresponds with the –module-path commandline option.

Parameters
mpthe module path.

◆ setNoagent() [1/2]

virtual void xmog_jvm_options::setNoagent ( bool  na)
virtual

Sets or clears the -Xnoagent option.

Parameters
natrue if the -Xnoagent option is to be used, false if not.

◆ setNoagent() [2/2]

virtual void xmog_jvm_options::setNoagent ( const char *  na)
virtual

Sets or clears the -Xnoagent option.

Parameters
na"true" if the -Xnoagent option is to be used, "false" if not.

◆ setOtherOption()

virtual void xmog_jvm_options::setOtherOption ( const char *  namevalue,
void *  ptr = 0 
)
virtual

Allows the specification of a JVM option that is neither a -D nor a -X option.

Parameters
namevaluethe entire option, name and value together.
ptran extra value (corresponding with the JNI extraInfo field).

◆ setPrependBootClassPath()

virtual void xmog_jvm_options::setPrependBootClassPath ( const char *  cp)
virtual

Sets the value of the -Xbootclasspath/p: option.

Parameters
cpthe new prepend-bootclasspath.

◆ setProf() [1/2]

virtual void xmog_jvm_options::setProf ( bool  p)
virtual

Sets the -Xprof option if true.

Parameters
penables profiling mode if true.

◆ setProf() [2/2]

virtual void xmog_jvm_options::setProf ( const char *  p)
virtual

Sets the -Xprof option if "true".

Parameters
penables profiling mode if "true".

◆ setReduceSignals() [1/2]

virtual void xmog_jvm_options::setReduceSignals ( bool  rs)
virtual

Sets or clears the -Xrs option.

You usually won't need this option unless you're running your application as a daemon or service.

Parameters
rstrue if the -Xrs option is to be used, false if not.

◆ setReduceSignals() [2/2]

virtual void xmog_jvm_options::setReduceSignals ( const char *  rs)
virtual

Sets or clears the -Xrs option.

You usually won't need this option unless you're running your application as a daemon or service.

Parameters
rs"true" if the -Xrs option is to be used, "false" if not.

◆ setRun()

virtual void xmog_jvm_options::setRun ( const char *  runopts)
virtual

Sets the -Xrun option.

Parameters
runoptsthe value of the option.

◆ setSecurityManager()

virtual void xmog_jvm_options::setSecurityManager ( const char *  sm)
virtual

Sets the class that is the security manager for the application.

This method corresponds with the -Djava.security.manager commandline option

Parameters
smthe classname of the type that will be used as security manager for the application. An empty string corresponds with the unparametrized -Djava.security.manager option and will result in the java.lang.SecurityManager being set. A NULL argument unsets the system property.

◆ setSecurityPolicy()

virtual void xmog_jvm_options::setSecurityPolicy ( const char *  policyFile)
virtual

Sets the policy file containing security settings for the application.

This method corresponds with the -Djava.security.policy commandline option

Parameters
policyFilethe name of the file that contains the security settings for the application. A simple filename (without path) is expected to refer to a file in the present working directory.

◆ setStackSize()

virtual void xmog_jvm_options::setStackSize ( const char *  ss)
virtual

Sets the stack size for Java threads.

Parameters
ssthe stack size as a string. The string format supports multipliers like 'm' or 'k', for example
  setStackSize( "100k" );

◆ setStackSizeInKB()

virtual void xmog_jvm_options::setStackSizeInKB ( jint  ss)
virtual

Sets the stack size for Java threads in kB.

This method corresponds with the following implicit initialization mechanisms:

  • Environment variable name: XMOG_STACKSIZE
  • Old-style configuration: -Xss in Java2 section of named configuration.
  • New-style configuration: StackSize key in JVM settings section.

◆ setVfprintf() [1/2]

virtual void xmog_jvm_options::setVfprintf ( const char *  vfp)
virtual

Sets the vfprintf callback that the JVM uses for reporting JVM information.

Parameters
vfpa persisted function pointer.

◆ setVfprintf() [2/2]

virtual void xmog_jvm_options::setVfprintf ( XMOG_VFPRINTF  vfp)
virtual

Sets the vfprintf callback that the JVM uses for reporting JVM information.

Parameters
vfpa function pointer of type XMOG_VFPRINTF.

The documentation for this class was generated from the following file:

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