Click or drag to resize

SetupJVMWrapper Class

Main entry point for JVM languages setup and execution.
Inheritance Hierarchy

Namespace:  MASES.JCOBridge.C2JBridge
Assembly:  C2JBridge (in C2JBridge.dll) Version: 2.4.14.220818-82c2bf79b6e60a4d98fb4d1695305d68a91adf44
Syntax
public class SetupJVMWrapper : IJVMWrapperManagement, 
	IJVMBridgeCore

The SetupJVMWrapper type exposes the following members.

Constructors
  NameDescription
Public methodSetupJVMWrapper
Initialize a new instance of SetupJVMWrapper
Public methodSetupJVMWrapper(String)
Initialize a new instance of SetupJVMWrapper
Top
Properties
  NameDescription
Public propertyClassPath
The starting JVM class path. Further path can be added later.
Public propertyDebugSuspendFlag
Enables Debug
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.
Public propertyEnableDebug
Enables Debug
Public propertyStatic memberFilteredArgs
The remaining arguments after parsing of JCOBridge arguments. Useful when invoked application does not accept arguments related to JCOBridge.
Public propertyGlobalHeapSize
Sets the global heap size
Public propertyInitialHeapSize
Sets the initial heap size
Public propertyJavaDebugOpts
Java Debug options used if EnableDebug is true
Public propertyJavaDebugPort
Java Debug Port
Public propertyJDKHome
The path where is located the JRE of the installed JDK
Public propertyJmxPort
The JMX Port to use
Public propertyJNIOutputFile
The path where the JNI verbose info will be written. The file will be opened in append mode.
Public propertyJNIVerbosity
Sets the verbosity of the JNI interface. See oracle documentation.
Public propertyJVM
The entry point for direct JVM operations. Use DynJVM to write code like you made in Java
Public propertyJVMOptions
The options to pass to the JVM when a JVM will be created
Public propertyJVMPackages
The list of packages on startup. Further packages can be added later
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.
Protected propertyJVMStats
The entry point for JVM statistics
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.
Public propertyLicensePath
The path where is located the license file
Public propertyManagement
The entry point for management operations
Protected propertyRemoteBridge
Direct accessor to the JCOBridge class in the JVM context
Protected propertyRemoteJCOBridge
Dynamic accessor to the JCOBridge class in the JVM context
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Finalize an instance of SetupJVMWrapper
(Overrides ObjectFinalize.)
Public methodGetCLRGlobal
Get previously registered Object from CLR global mapper
Public methodGetHashCode
Serves 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
Public methodGetJCGraphicContainer(String, Boolean)
Requests to allocate a remote graphic container to host the Component with class name className
Public methodGetJVMGlobal
Get previously registered IJavaObject from JVM global mapper
Public methodGetListener
Returns the IJVMBridgeBase listener reference associated to the JVM reference
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodCode exampleImportPackage
Imports a Java package to be used within the program
Protected methodInitialize
Public methodInitializeListener
Request the initialization of the Listener from the JVM. The listener is a new class which inherits from CLRListener or JVMBridgeListener
Protected methodInitializeRemote
Call Initialize(String) on remote environment
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodProcessCommandLine
Process command line arguments
Public methodRegisterCLRGlobal
Register the object into the global CLR mapper.
Public methodReleaseJCGraphicContainer
Reelase a IJCGraphicContainer from the JVM
Public methodReleaseListener
Release a IJVMBridgeBase listener reference from the JVM
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUnregisterCLRGlobal
Unregister the object from the global CLR mapper.
Public methodUnwrapAndDemonizeOnT
Creates and unwrap the JVM instance as daemon
Public methodUnwrapOnT
Creates and unwrap the JVM instance
Top
Extension Methods
  NameDescription
Public Extension MethodConvertTReturn
Converts a generic object
(Defined by JCOBridgeExtensions.)
Public Extension MethodGlobalize
Creates a new global instance pointer
(Defined by JCOBridge.)
Public Extension MethodToNative
Converts a generic input to an object manageable from the JVM
(Defined by JCOBridgeExtensions.)
Top
Examples
This is a basic example showing SetupJVMWrapper class usage
C#
class JVMWrapperApp : SetupJVMWrapper
{
    public void Execute()
    {
         ImportPackage("java.lang");
         ImportPackage("java.util");

         var str = DynJVM.String.@new();
         str = str.concat("HELLO WORLD FROM JVM!!!"); // this command is executed within the JVM context
         Console.WriteLine("Output from JVM: {0}", str);
     }
}
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