APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.dynalink.support

public abstract Class AbstractRelinkableCallSite

extends MutableCallSite
implements RelinkableCallSite
Class Inheritance
All Implemented Interfaces
jdk.dynalink.RelinkableCallSite
Known Direct Subclasses
jdk.dynalink.support.ChainedCallSite, jdk.dynalink.support.SimpleRelinkableCallSite
Imports
java.lang.invoke.CallSite, .MethodHandle, .MutableCallSite, jdk.dynalink.CallSiteDescriptor, .RelinkableCallSite, jdk.dynalink.linker.GuardedInvocation

A basic implementation of the RelinkableCallSite as a MutableCallSite. It carries a CallSiteDescriptor passed in the constructor and provides the correct implementation of the initialize(MethodHandle) method. Subclasses must provide relink(GuardedInvocation, MethodHandle) and resetAndRelink(GuardedInvocation, MethodHandle) methods.
Since
9

Field Summary

Modifier and TypeField and Description
private final CallSiteDescriptor

Constructor Summary

AccessConstructor and Description
protected
AbstractRelinkableCallSite(final CallSiteDescriptor
the descriptor for this call site that will be returned from getDescriptor(). The call site's CallSite#type() will be equal to descriptor's CallSiteDescriptor#getMethodType().
descriptor
)

Creates a new abstract relinkable call site.

Method Summary

Modifier and TypeMethod and Description
public CallSiteDescriptor
getDescriptor()

Implements jdk.dynalink.RelinkableCallSite.getDescriptor.

Returns the descriptor for this call site.

public void
initialize(final MethodHandle relinkAndInvoke)

Implements jdk.dynalink.RelinkableCallSite.initialize.

Invoked by dynamic linker to initialize the relinkable call site by setting a relink-and-invoke method handle.

Inherited from java.lang.invoke.MutableCallSite:
dynamicInvokergetTargetsetTargetsyncAll

Field Detail

descriptorback to summary
private final CallSiteDescriptor descriptor

Constructor Detail

AbstractRelinkableCallSiteback to summary
protected AbstractRelinkableCallSite(final CallSiteDescriptor descriptor)

Creates a new abstract relinkable call site.

Parameters
descriptor:CallSiteDescriptor

the descriptor for this call site that will be returned from getDescriptor(). The call site's CallSite#type() will be equal to descriptor's CallSiteDescriptor#getMethodType().

Exceptions
NullPointerException:
if descriptor is null.

Method Detail

getDescriptorback to summary
public CallSiteDescriptor getDescriptor()

Implements jdk.dynalink.RelinkableCallSite.getDescriptor.

Doc from jdk.dynalink.RelinkableCallSite.getDescriptor.

Returns the descriptor for this call site.

Annotations
@Override
initializeback to summary
public void initialize(final MethodHandle relinkAndInvoke)

Implements jdk.dynalink.RelinkableCallSite.initialize.

Doc from jdk.dynalink.RelinkableCallSite.initialize.

Invoked by dynamic linker to initialize the relinkable call site by setting a relink-and-invoke method handle. The call site implementation is supposed to set this method handle as its target using CallSite#setTarget(MethodHandle). Relink-and-invoke is the initial method handle set by DynamicLinker#link(RelinkableCallSite) that will cause the call site to be relinked to an appropriate target on its first invocation based on its arguments, and that linked target will then be invoked (hence the name). This linking protocol effectively delays linking until the call site is invoked with actual arguments and thus ensures that linkers can make nuanced linking decisions based on those arguments and not just on the static method type of the call site.

Annotations
@Override