IJavaPeerable Interface

Definition

Support for using Java object instances.

public interface IJavaPeerable : IDisposable
type IJavaPeerable = interface
    interface IDisposable
Derived
Implements

Remarks

The IJavaPeerable interface provides access to a Java object instance, invocation of members on that Java instance, control over the lifetime of that object instance, and callbacks for when the wrapper is being disposed or finalized. The following operations are permitted:

  • Object instance access is available through the PeerReference property. :
  • Member access and invocation is available through the JniPeerMembers property. :
  • Object lifetime control through Java.Interop.IJavaPeerable.Dispose and DisposeUnlessReferenced() methods. :
  • Value visibilty is controlled through Java.Interop.IJavaPeerable.DisposeUnlessRegistered. :
  • Disposal and finalization callbacks through the Disposed() and Finalized() methods. :

Properties

JniIdentityHashCode

Returns the value of java.lang.System.identityHashCode() for the wrapped instance.

JniManagedPeerState

State of the managed peer.

JniPeerMembers

Member access and invocation support.

PeerReference

Returns a JniObjectReference of the wrapped Java object instance.

Methods

Disposed()

Called when the instance has been disposed.

DisposeUnlessReferenced()

If there are no outstanding references to this instance, then calls Dispose(); otherwise, does nothing.

Finalized()

Called when the instance has been finalized.

SetJniIdentityHashCode(Int32)

Set the value returned by JniIdentityHashCode.

SetJniManagedPeerState(JniManagedPeerStates)
SetPeerReference(JniObjectReference)

Set the value returned by PeerReference.

UnregisterFromRuntime()

Unregister this instance so that the runtime will not return it from future Java.Interop.JniRuntime+JniValueManager.PeekValue invocations.

Extension Methods

GetJniTypeName(IJavaPeerable)

Applies to