Language

JniRuntime.JniValueManager Class

Definition

Defines managed peer registration, lifetime control, and JNI value conversion.

public abstract class JniRuntime.JniValueManager : IDisposable
type JniRuntime.JniValueManager = class
    interface JniRuntime.ISetRuntime
    interface IDisposable
Inheritance
JniRuntime.JniValueManager
Derived
Implements

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Name Description
JniRuntime.JniValueManager()

Initializes the value manager base class.

Properties

Name Description
Runtime

Gets the runtime assigned to this value manager.

Methods

Name Description
ActivatePeer(IJavaPeerable, JniObjectReference, ConstructorInfo, Object[])

Provides the legacy activation hook with an optional existing managed peer.

ActivatePeer(JniObjectReference, Type, ConstructorInfo, Object[])

Activates a managed peer for a Java instance through the derived implementation.

AddPeer(IJavaPeerable)

Registers a managed peer in the Java-to-managed mapping.

CollectPeers()

Requests peer collection through the runtime-specific implementation.

ConstructPeer(IJavaPeerable, JniObjectReference, JniObjectReferenceOptions)

Initializes a managed peer. In .NET 11 for Android, delegates initialization to ConstructPeerCore.

ConstructPeerCore(IJavaPeerable, JniObjectReference, JniObjectReferenceOptions)

Defines the implementation's peer construction and reference-transfer policy.

CreateLocalObjectReferenceArgument(Type, Object)

Creates a local JNI argument reference through the implementation hook.

CreateLocalObjectReferenceArgumentCore(Type, Object)

Defines creation of a local JNI object-reference argument.

CreatePeer(JniObjectReference, JniObjectReferenceOptions, Type)

Creates a managed peer wrapper for a JNI reference.

CreateValue(JniObjectReference, JniObjectReferenceOptions, Type)

Creates a managed value after checking manager disposal. In .NET 11 for Android, delegates creation to the creation hook.

CreateValue<T>(JniObjectReference, JniObjectReferenceOptions, Type)

Creates a typed managed value. In .NET 11 for Android, delegates creation to the creation hook.

CreateValueCore(JniObjectReference, JniObjectReferenceOptions, Type)

Defines non-generic managed value creation from a JNI reference.

CreateValueCore<T>(JniObjectReference, JniObjectReferenceOptions, Type)

Defines typed managed value creation from a JNI reference.

Dispose()

Calls managed disposal and suppresses finalization.

Dispose(Boolean)

Marks the manager as disposed.

DisposePeer(IJavaPeerable)

In the base implementation, notifies a peer with a valid JNI reference and removes its mapping. If the reference is still valid after those calls, it disposes the reference.

DisposePeerUnlessReferenced(IJavaPeerable)

In the base implementation, starts disposal when the peer has a valid reference and is not mapped to the same instance.

EnsureNotDisposed()

Throws ObjectDisposedException when the base disposal method has marked the manager as disposed.

FinalizePeer(IJavaPeerable)

Applies the runtime-specific finalization policy to a managed peer.

GetJniIdentityHashCode(JniObjectReference)

Gets the Java identity hash through the runtime's System helper.

GetPeer(JniObjectReference, Type)

Reuses a compatible mapped peer or creates one with Copy transfer options.

GetSurfacedPeers()

Gets diagnostic information about the implementation's surfaced peer mappings.

GetValue(JniObjectReference, JniObjectReferenceOptions, Type)

Looks up or converts a managed value. In .NET 11 for Android, delegates lookup to the lookup hook.

GetValue<T>(IntPtr)

Looks up or converts a raw JNI handle with Copy transfer options.

GetValue<T>(JniObjectReference, JniObjectReferenceOptions, Type)

Looks up or converts a typed managed value. In .NET 11 for Android, delegates lookup to the lookup hook.

GetValueCore(JniObjectReference, JniObjectReferenceOptions, Type)

Defines non-generic managed value lookup and conversion.

GetValueCore<T>(JniObjectReference, JniObjectReferenceOptions, Type)

Defines typed managed value lookup and conversion.

GetValueMarshaler(Type)

Gets a marshaler for a managed type. In .NET 11 for Android, delegates lookup to the type-based hook.

GetValueMarshaler<T>()

Gets a typed marshaler. In .NET 11 for Android, delegates lookup to the generic hook.

GetValueMarshalerCore(Type)

Defines the type-based value-marshaler lookup policy.

GetValueMarshalerCore<T>()

Defines the generic value-marshaler lookup policy.

OnSetRuntime(JniRuntime)

Associates the manager with a runtime after checking disposal.

PeekPeer(JniObjectReference)

Looks up an existing managed peer without creating one.

PeekValue(JniObjectReference)

Looks up a peer and unwraps known managed proxy values.

RemovePeer(IJavaPeerable)

Removes a peer mapping without defining JNI reference disposal.

TryConstructPeer(IJavaPeerable, JniObjectReference, JniObjectReferenceOptions, Type)

Invokes an activation constructor on an existing managed peer when one is found.

TryUnboxPeerObject(IJavaPeerable, Object)

Unwraps the built-in managed-object and exception proxy types.

WaitForGCBridgeProcessing()

Provides the GC-bridge coordination hook used before JNI callbacks.

Applies to