Click or drag to resize

MASES.JCOBridge.C2JBridge Namespace

Contains interfaces and base classes to access JVM from CLR context
Classes
 ClassDescription
Public classCode exampleClassPathBuilder An helper class to build ClassPath
Public classCode exampleCLREventData Base class for event information. Extend this to manage event associated data
Public classCLREventDataTObject A class for event information, it extends CLREventData, adding management of simple object like bool, string, byte, and so on/>
Public classCLRListenerEventArgsTDataClass Generic event args used by AddEventHandlerTDataClass(String, EventHandlerCLRListenerEventArgsTDataClass)
Public classEventOrExceptionEventArgs A class containing the information to be reported in the
Public classJCOBridge General helper class
Public classJCOBridgeDirectBufferT A class to manage shared memory between .NET and JVM using a memory region created in the CLR and shared with the JVM using https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html
Public classJCOBridgeExtensions General class with helpers for JVM initialization
Public classJCWindowsManager Class to manage windows initialization and positioning, it is the input of Initialize(JCWindowsManager)
Public classJVMBridgeAutoLock Helper class to automatically release lock by a using clause
Public classJVMBridgeBase Public entry point of JVMBridgeBase
Public classCode exampleJVMBridgeBaseTClass Public entry point of JVMBridgeBaseTClass
Public classCode exampleJVMBridgeBaseTClass, TInterface Public entry point of JVMBridgeBaseTClass
Public classCode exampleJVMBridgeBaseEnumerableTClass A generic IEnumerable used to manage Java Iterable
Public classCode exampleJVMBridgeBaseEnumerableTClass, TObject A generic IEnumerableT used to manage Java Iterable
Public classJVMBridgeBaseEnumerator A generic enumerator used to manage Java Iterator
Public classJVMBridgeBaseEnumeratorTObject A generic enumerator used to manage Java Iterator
Public classJVMBridgeBasePrefetchableEnumerator A generic enumerator used to manage Java Iterator able to prefetch data
Public classJVMBridgeBasePrefetchableEnumeratorTObject A generic enumerator used to manage Java Iterator
Public classJVMBridgeCore Public entry point of JVMBridgeCore
Public classCode exampleJVMBridgeCoreTClass Public entry point of JVMBridgeCoreTClass
Public classCode exampleJVMBridgeCoreTClass, TInterface Public entry point of JVMBridgeCoreTClass
Public classCode exampleJVMBridgeCoreDisposable Helper class to add IDisposable behavior on classes based on JVMBridgeCore. This class has two different usages:
  • Using the Dispose method, the class invokes close method on JVM object and immediately release the reference. JVMBridgeCore lost the possibility to immediately release the JVM reference and the JVM object shall wait the .NET Garbage Collector
  • In some operating conditions, mainly under heavy GC pressure, the CLR can retires the underlying object (as explained in previous point); With JVMBridgeBase classes it is possible to use the IDisposable pattern to avoid early reference retirement. With JVMBridgeCore based classes the previous pattern cannot be applied and something like the following shall be used to avoid the invocation of the finalizer:
    C#
    class TheClass : JVMBridgeCore<TheClass>
    {
        public override string BridgeClassName => "org.company.TheClass";
    
        public TheClass()
        {
        }
    }
    
    var cls = new TheClass();
    System.GC.SuppressFinalize(cls);
    try
    {
        // use cls
    }
    finally
    {
        System.GC.ReRegisterForFinalize(cls);
    }
    As a general approach, the object shall be alive, from the point of view of the .NET Garbage Collector, to avoid potential NullPointerException in the JVM: https://jnet.masesgroup.com/articles/usage.html#suppressfinalizereregisterforfinalize-pattern
Public classJVMBridgeException Java Exception base class
Public classJVMBridgeExceptionTException Java Exception class extending JVMBridgeException
Public classCode exampleJVMBridgeListener Base class managing events from JVM. Implements IJVMBridgeBase. Extend this base class to manage events from the JVM
Public classJVMBridgeListenerCLRListenerWrapper Internal class
Public classCode exampleJVMBridgeMainTClass Execute directly the class implementing the Java "main" method
Obsolete
Public classCode exampleJVMBridgeMainExtensibleTClass Execute directly the class implementing the Java "main" method
Public classJVMBridgeRunnerTClass Runs directly the class implementing the Java "main" method
Public classCode exampleSetupJVMWrapper Main entry point for JVM languages setup and execution.
Public classCode exampleSetupJVMWrapperT Main entry point for JVM languages setup and execution.
Extend this class to use external threading
Interfaces
 InterfaceDescription
Public interfaceIConverterBridge Interface used from IEnumerableExtension for type conversion
Public interfaceIEnumerableExtension Interface used to extend functionalities of IEnumerable
Public interfaceIJCGraphicContainer The interface which manages interaction with remote Graphic Container. It is the main interface to insert a Java Control within a WPF/WinForms application
Public interfaceIJVMBridgeBase Generic interface containing accessor of every JVMBridgeBase
Public interfaceIJVMBridgeBaseConvertTIn, TOut Generic interface containing accessor for IJavaType of every typed JVMBridgeBase
Public interfaceIJVMBridgeBaseInitializer Generic interface used in initialization of every instance of JVMBridgeBase class
Public interfaceIJVMBridgeBaseStatic Generic interface containing accessor for IJavaType of every typed JVMBridgeBase
Public interfaceIJVMBridgeCore Generic interface for every Java bridged class
Public interfaceIJVMBridgeDefinition Generic interface containing definition of every JVMBridgeBase
Public interfaceIJVMBridgeMain Public interface to identify a class which is a Main-Class
Enumerations