Share via


MutableCallSite.Target Property

Definition

Returns the target method of the call site, which behaves like a normal field of the MutableCallSite. -or- Updates the target method of this call site, as a normal variable.

public override Java.Lang.Invoke.MethodHandle? Target { [Android.Runtime.Register("getTarget", "()Ljava/lang/invoke/MethodHandle;", "", ApiSince=26)] get; [Android.Runtime.Register("setTarget", "(Ljava/lang/invoke/MethodHandle;)V", "GetSetTarget_Ljava_lang_invoke_MethodHandle_Handler", ApiSince=26)] set; }
[<get: Android.Runtime.Register("getTarget", "()Ljava/lang/invoke/MethodHandle;", "", ApiSince=26)>]
[<set: Android.Runtime.Register("setTarget", "(Ljava/lang/invoke/MethodHandle;)V", "GetSetTarget_Ljava_lang_invoke_MethodHandle_Handler", ApiSince=26)>]
member this.Target : Java.Lang.Invoke.MethodHandle with get, set

Property Value

the linkage state of this call site, a method handle which can change over time

Attributes

Remarks

Property getter documentation:

Returns the target method of the call site, which behaves like a normal field of the MutableCallSite.

The interactions of getTarget with memory are the same as of a read from an ordinary variable, such as an array element or a non-volatile, non-final field.

In particular, the current thread may choose to reuse the result of a previous read of the target from memory, and may fail to see a recent update to the target by another thread.

Java documentation for java.lang.invoke.MutableCallSite.getTarget().

Property setter documentation:

Updates the target method of this call site, as a normal variable. The type of the new target must agree with the type of the old target.

The interactions with memory are the same as of a write to an ordinary variable, such as an array element or a non-volatile, non-final field.

In particular, unrelated threads may fail to see the updated target until they perform a read from memory. Stronger guarantees can be created by putting appropriate operations into the bootstrap method and/or the target methods used at any given call site.

Java documentation for java.lang.invoke.MutableCallSite.setTarget(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