Click or drag to resize

JVMBridgeListener Class

Base class managing events from JVM. Implements IJVMBridgeBase. Extend this base class to manage events from the JVM
Inheritance Hierarchy
SystemObject
  System.DynamicDynamicObject
    MASES.JCOBridge.C2JBridgeJVMBridgeBase
      MASES.JCOBridge.C2JBridgeJVMBridgeBaseJVMBridgeListener
        MASES.JCOBridge.C2JBridgeJVMBridgeListener

Namespace:  MASES.JCOBridge.C2JBridge
Assembly:  C2JBridge (in C2JBridge.dll) Version: 2.4.14.220818-82c2bf79b6e60a4d98fb4d1695305d68a91adf44
Syntax
public class JVMBridgeListener : JVMBridgeBase<JVMBridgeListener>

The JVMBridgeListener type exposes the following members.

Constructors
  NameDescription
Public methodJVMBridgeListener
Initialize a new instance of CLRListener
Top
Properties
  NameDescription
Public propertyAutoInit
Set to to externally initialize this JVMBridgeListener instance using InitializeListener(IJVMBridgeBase)
Public propertyClassName
Java class name to be instantiated
(Overrides JVMBridgeBaseClassName.)
Public propertyDynInstance
The dynamic accessor to Instance
(Inherited from JVMBridgeBase.)
Public propertyDynListener Obsolete.
Local reference for JVM Listener, it shall be used as input for all Java methods which need the interface e.g. addActionListener
Public propertyInstance
The IJavaObject instance
(Inherited from JVMBridgeBase.)
Public propertyIsAbstract
if the ClassName is an abstract class, i.e. cannot be created an instance
(Inherited from JVMBridgeBase.)
Public propertyIsCloseable
if the ClassName implements Closeable
(Overrides JVMBridgeBaseIsCloseable.)
Public propertyIsInterface
if the ClassName is an interface, i.e. does not have any public constructor
(Inherited from JVMBridgeBase.)
Public propertyIsListener
if the ClassName follows the listener pattern of JCOBridge: the ClassName extends a JCListener or implements IJCListener
(Overrides JVMBridgeBaseIsListener.)
Public propertyIsStatic
if the ClassName is a static class, i.e. does not have any public constructor
(Overrides JVMBridgeBaseIsStatic.)
Public propertyListener Obsolete.
Local reference for JVM JCListener instance, it shall be used as input for all Java methods which need the interface e.g. addActionListener
Top
Methods
  NameDescription
Protected methodAddEventHandler(String, EventHandler)
Adds an handler to manage events from JVM
Protected methodAddEventHandlerTDataClass(String, EventHandlerCLRListenerEventArgsTDataClass)
Adds an handler to manage events from JVM
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Overrides JVMBridgeBaseDispose.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from JVMBridgeBase.)
Public methodExecuteT(T)
Executes the code
(Inherited from JVMBridgeBase.)
Public methodExecuteT(T)
Executes the code
(Inherited from JVMBridgeBaseTClass.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from JVMBridgeBase.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIExecute(String, Object)
Executes an instance method
(Inherited from JVMBridgeBase.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodNewTNewClass(String, Object) Obsolete.
Executes an instance method
(Inherited from JVMBridgeBase.)
Public methodToString
Returns a string that represents the current object.
(Inherited from JVMBridgeBase.)
Top
Extension Methods
Examples
The following is the implementation of the Java ActionListener interface managed from the object JCActionListener (see Java help for implementation)
It use CLRActionEventData as typeparam of the generic CLRListenerEventArgsTDataClass
C#
public sealed class CLRActionListener : JVMBridgeListener
{
    public override string ClassName { get { return "org.mases.jcobridge.specialized.JCActionListener"; } } // the full name of class, in the JVM counterpart, of the Java class implementing the event

    public CLRActionListener(EventHandler<CLRListenerEventArgs<CLRActionEventData>> handler) // the handler with the expected type
    {
        AddEventHandler("actionPerformed", handler); // allocate the event handler associated to the action the Java interface to be managed in C#
    }
}
See Also