Click or drag to resize

SetupJVMWrapperT Class

Main entry point for JVM languages setup and execution.
Extend this class to use external threading
Inheritance Hierarchy
SystemObject
  MASES.JCOBridge.C2JBridgeSetupJVMWrapper
    MASES.JCOBridge.C2JBridgeSetupJVMWrapperT

Namespace: MASES.JCOBridge.C2JBridge
Assembly: C2JBridge (in C2JBridge.dll) Version: 2.5.21.241219-a6a144ea07c497c3a9a1be842408e852afb458be
Syntax
public class SetupJVMWrapper<T> : SetupJVMWrapper
where T : SetupJVMWrapper

Type Parameters

T
The class extending SetupJVMWrapper

The SetupJVMWrapperT type exposes the following members.

Constructors
 NameDescription
Public methodSetupJVMWrapperTInitializes a new instance of the SetupJVMWrapperT class
Top
Properties
 NameDescription
Public propertyClassPath The starting JVM class path. Further path can be added later.
(Inherited from SetupJVMWrapper)
Public propertyDebugSuspendFlag Enables Debug
(Inherited from SetupJVMWrapper)
Public propertyCode exampleDynJVM The dynamic entry point for JVM operations. It permits to write code in .NET languages using a syntax not far from the one available in Java.
(Inherited from SetupJVMWrapper)
Public propertyEnableCriticalMethods Always enable/disable use of critical methods within JNI interface, to get/set native type arrays, single wrapper for EnableCriticalMethodsOnGet and EnableCriticalMethodsOnSet
(Inherited from SetupJVMWrapper)
Public propertyEnableCriticalMethodsOnGet Always enable/disable use of critical methods, within JNI interface, to get native type arrays
(Inherited from SetupJVMWrapper)
Public propertyEnableCriticalMethodsOnGetThreshold Enable/Disable use of critical methods, within JNI interface, to get native type arrays if the length is over the EnableCriticalMethodsOnSetThreshold. Default is MaxValue
(Inherited from SetupJVMWrapper)
Public propertyEnableCriticalMethodsOnSet Always enable/disable use of critical methods, within JNI interface, to set native type arrays
(Inherited from SetupJVMWrapper)
Public propertyEnableCriticalMethodsOnSetThreshold Enable/Disable use of critical methods, within JNI interface, to set native type arrays if the length is over the EnableCriticalMethodsOnSetThreshold. Default is MaxValue
(Inherited from SetupJVMWrapper)
Public propertyEnableDebug Enables Debug
(Inherited from SetupJVMWrapper)
Public propertyFeatureLevel Reports the feature level of the JVM in use
(Inherited from SetupJVMWrapper)
Public propertyGlobalHeapSize Sets the global heap size
(Inherited from SetupJVMWrapper)
Public propertyStatic memberGlobalInstance Create and return a singleton global instance of T
Public propertyGlobalize Set to to do not globilize the instance. Default is
(Inherited from SetupJVMWrapper)
Public propertyStatic memberHasGlobalInstance Return if a singleton global instance of T was previously created, otherwise
Public propertyInitialHeapSize Sets the initial heap size
(Inherited from SetupJVMWrapper)
Public propertyJavaDebugOpts Java Debug options used if EnableDebug is true
(Inherited from SetupJVMWrapper)
Public propertyJavaDebugPort Java Debug Port
(Inherited from SetupJVMWrapper)
Public propertyJDKHome The path where is located the JRE of the installed JDK
(Inherited from SetupJVMWrapper)
Public propertyJmxPort The JMX Port to use
(Inherited from SetupJVMWrapper)
Public propertyJNIOutputFile The path where the JNI verbose info will be written. The file will be opened in append mode.
(Inherited from SetupJVMWrapper)
Public propertyJNIVerbosity Sets the verbosity of the JNI interface. See oracle documentation.
(Inherited from SetupJVMWrapper)
Public propertyJVM The entry point for direct JVM operations. Use DynJVM to write code like you made in Java
(Inherited from SetupJVMWrapper)
Public propertyJVMOptions The options to pass to the JVM when a JVM will be created
(Inherited from SetupJVMWrapper)
Public propertyJVMPackages The list of packages on startup. Further packages can be added later
(Inherited from SetupJVMWrapper)
Public propertyJVMPath The path to the JRE ennvironment or full path to (jvm.dll/libjvm.so). If not set the library try to find a suitable version on the system.
(Inherited from SetupJVMWrapper)
Protected propertyJVMStats The entry point for JVM statistics
(Inherited from SetupJVMWrapper)
Public propertyLastBindingException Last Exception raised from C# to Java interface. Useful to identify the real exception behind a RuntimeBinderException raised when DynJVM accessor is in use.
(Inherited from SetupJVMWrapper)
Public propertyLicensePath The path where is located the license file
(Inherited from SetupJVMWrapper)
Public propertyManagement The entry point for management operations
(Inherited from SetupJVMWrapper)
Public propertyModulePath The starting JVM module path. Further path can be added later.
(Inherited from SetupJVMWrapper)
Protected propertyRemoteBridge Direct accessor to the JCOBridge class in the JVM context
(Inherited from SetupJVMWrapper)
Protected propertyRemoteJCOBridge Dynamic accessor to the JCOBridge class in the JVM context
(Inherited from SetupJVMWrapper)
Public propertySuppressFinalize to suppress finalization of the class instance inherited from SetupJVMWrapper when the instance is created using CreateGlobalInstance, the instance is globalized using Globalize(IJVMBridgeCore, Boolean) or GlobalizeTClass. Default value is .
(Inherited from SetupJVMWrapper)
Top
Methods
 NameDescription
Public methodStatic memberCreateGlobalInstance Create a singleton global instance of T
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalize Finalize an instance of SetupJVMWrapper
(Inherited from SetupJVMWrapper)
Public methodGetCLRGlobal Get previously registered Object from CLR global mapper
(Inherited from SetupJVMWrapper)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetJCGraphicContainer(IJavaObject, Boolean) Requests to allocate a remote graphic container to host the Component in graphicObject
(Inherited from SetupJVMWrapper)
Public methodGetJCGraphicContainer(String, Boolean) Requests to allocate a remote graphic container to host the Component with class name className
(Inherited from SetupJVMWrapper)
Public methodGetJVMGlobal Get previously registered IJavaObject from JVM global mapper
(Inherited from SetupJVMWrapper)
Public methodGetListener Returns the IJVMBridgeBase listener reference associated to the JVM reference
(Inherited from SetupJVMWrapper)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodCode exampleImportPackage Imports a Java package to be used within the program
(Inherited from SetupJVMWrapper)
Public methodInitializeListener Request the initialization of the Listener from the JVM. The listener is a new class which inherits from JVMBridgeListener or JVMBridgeListener
(Inherited from SetupJVMWrapper)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Protected methodProcessCommandLine Process command line arguments
(Inherited from SetupJVMWrapper)
Public methodRegisterCLRGlobal Register the object into the global CLR mapper.
(Inherited from SetupJVMWrapper)
Public methodReleaseJCGraphicContainer Reelase a IJCGraphicContainer from the JVM
(Inherited from SetupJVMWrapper)
Public methodReleaseListener Release a IJVMBridgeBase listener reference from the JVM
(Inherited from SetupJVMWrapper)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodUnregisterCLRGlobal Unregister the object from the global CLR mapper.
(Inherited from SetupJVMWrapper)
Public methodUnwrapAndDemonizeOn Creates and unwrap the JVM instance as daemon
Public methodUnwrapOn Creates and unwrap the JVM instance
Top
Extension Methods
 NameDescription
Public Extension MethodConvertTReturn Converts a generic object
(Defined by JCOBridgeExtensions)
Public Extension MethodToNative Converts a generic input to an object manageable from the JVM
(Defined by JCOBridgeExtensions)
Top
Example
This is a basic example showing SetupJVMWrapper class usage
C#
class JVMWrapperApp : SetupJVMWrapper<JVMWrapperApp<
{
    public void UnwrappedExecute(object args)
    {
        // put here the code to execute in a different JVM thread
    }

    public void Execute()
    {
         // use the following to execute the thread in JVM as deamon
         // the function returns a reference to the instance of the class allocated in the new thread
         // var jvmwrapperRefFromNewThread = UnwrapAndDemonizeOn(UnwrappedExecute);

         // use the following to execute the thread in JVM
         // the function returns a reference to the instance of the class allocated in the new thread
         // var jvmwrapperRefFromNewThread = UnwrapOn(UnwrappedExecute);

         // ... continue here with normal code; it will execute in parallel with unwrapped code
    }
}
To run use: applicationName --JVMPath:[ABSOLUTE PATH TO JRE LIBRARY (jvm.dll/libjvm.so)] Other command line switch are available on https://www.jcobridge.com/command-line-options/
See Also