Share via


ConstantCallSite Constructors

Definition

Overloads

ConstantCallSite(MethodHandle)

Creates a call site with a permanent target.

ConstantCallSite(MethodType, MethodHandle)

Creates a call site with a permanent target, possibly bound to the call site itself.

ConstantCallSite(IntPtr, JniHandleOwnership)

ConstantCallSite(MethodHandle)

Creates a call site with a permanent target.

[Android.Runtime.Register(".ctor", "(Ljava/lang/invoke/MethodHandle;)V", "", ApiSince=26)]
public ConstantCallSite (Java.Lang.Invoke.MethodHandle? target);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/invoke/MethodHandle;)V", "", ApiSince=26)>]
new Java.Lang.Invoke.ConstantCallSite : Java.Lang.Invoke.MethodHandle -> Java.Lang.Invoke.ConstantCallSite

Parameters

target
MethodHandle

the target to be permanently associated with this call site

Attributes

Remarks

Creates a call site with a permanent target.

Java documentation for java.lang.invoke.ConstantCallSite.ConstantCallSite(java.lang.invoke.MethodHandle).

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.

Applies to

ConstantCallSite(MethodType, MethodHandle)

Creates a call site with a permanent target, possibly bound to the call site itself.

[Android.Runtime.Register(".ctor", "(Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;)V", "", ApiSince=26)]
protected ConstantCallSite (Java.Lang.Invoke.MethodType? targetType, Java.Lang.Invoke.MethodHandle? createTargetHook);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;)V", "", ApiSince=26)>]
new Java.Lang.Invoke.ConstantCallSite : Java.Lang.Invoke.MethodType * Java.Lang.Invoke.MethodHandle -> Java.Lang.Invoke.ConstantCallSite

Parameters

targetType
MethodType

the type of the method handle to be permanently associated with this call site

createTargetHook
MethodHandle

a method handle to invoke (on the call site) to produce the call site's target

Attributes

Remarks

Creates a call site with a permanent target, possibly bound to the call site itself.

During construction of the call site, the createTargetHook is invoked to produce the actual target, as if by a call of the form (MethodHandle) createTargetHook.invoke(this).

Note that user code cannot perform such an action directly in a subclass constructor, since the target must be fixed before the ConstantCallSite constructor returns.

The hook is said to bind the call site to a target method handle, and a typical action would be someTarget.bindTo(this). However, the hook is free to take any action whatever, including ignoring the call site and returning a constant target.

The result returned by the hook must be a method handle of exactly the same type as the call site.

While the hook is being called, the new ConstantCallSite object is in a partially constructed state. In this state, a call to getTarget, or any other attempt to use the target, will result in an IllegalStateException. It is legal at all times to obtain the call site's type using the type method.

Java documentation for java.lang.invoke.ConstantCallSite.ConstantCallSite(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle).

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.

Applies to

ConstantCallSite(IntPtr, JniHandleOwnership)

protected ConstantCallSite (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Java.Lang.Invoke.ConstantCallSite : nativeint * Android.Runtime.JniHandleOwnership -> Java.Lang.Invoke.ConstantCallSite

Parameters

javaReference
IntPtr

nativeint

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.

Applies to