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

public Class SimpleLinkRequest

extends Object
implements LinkRequest
Class Inheritance
All Implemented Interfaces
jdk.dynalink.linker.LinkRequest
Imports
java.util.Objects, jdk.dynalink.CallSiteDescriptor, jdk.dynalink.linker.LinkRequest

Default simple implementation of LinkRequest.
Since
9

Field Summary

Modifier and TypeField and Description
private final Object[]
private final CallSiteDescriptor
private final boolean

Constructor Summary

AccessConstructor and Description
public
SimpleLinkRequest(final CallSiteDescriptor
the descriptor for the call site being linked. Must not be null.
callSiteDescriptor
,
final boolean
true if the call site being linked is considered unstable.
callSiteUnstable
,
final Object...
the arguments for the invocation. Must not be null.
arguments
)

Creates a new link request.

Method Summary

Modifier and TypeMethod and Description
public Object[]
getArguments()

Implements jdk.dynalink.linker.LinkRequest.getArguments.

Returns the arguments for the invocation being linked.

public CallSiteDescriptor
getCallSiteDescriptor()

Implements jdk.dynalink.linker.LinkRequest.getCallSiteDescriptor.

Returns the call site descriptor for the call site being linked.

public Object
getReceiver()

Implements jdk.dynalink.linker.LinkRequest.getReceiver.

Returns the first argument for the invocation being linked; this is typically the receiver object.

public boolean
isCallSiteUnstable()

Implements jdk.dynalink.linker.LinkRequest.isCallSiteUnstable.

Returns true if the call site is considered unstable, that is, it has been relinked more times than was specified in DynamicLinkerFactory#setUnstableRelinkThreshold(int).

public LinkRequest
replaceArguments(final CallSiteDescriptor newCallSiteDescriptor, final Object... newArguments)

Implements jdk.dynalink.linker.LinkRequest.replaceArguments.

Returns a request identical to this one with call site descriptor and arguments replaced with the ones specified.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

argumentsback to summary
private final Object[] arguments
callSiteDescriptorback to summary
private final CallSiteDescriptor callSiteDescriptor
callSiteUnstableback to summary
private final boolean callSiteUnstable

Constructor Detail

SimpleLinkRequestback to summary
public SimpleLinkRequest(final CallSiteDescriptor callSiteDescriptor, final boolean callSiteUnstable, final Object... arguments)

Creates a new link request.

Parameters
callSiteDescriptor:CallSiteDescriptor

the descriptor for the call site being linked. Must not be null.

callSiteUnstable:boolean

true if the call site being linked is considered unstable.

arguments:Object[]

the arguments for the invocation. Must not be null.

Exceptions
NullPointerException:
if either callSiteDescriptor or arguments is null.

Method Detail

getArgumentsback to summary
public Object[] getArguments()

Implements jdk.dynalink.linker.LinkRequest.getArguments.

Doc from jdk.dynalink.linker.LinkRequest.getArguments.

Returns the arguments for the invocation being linked. The returned array must be a clone; modifications to it must not affect the arguments in this request.

Annotations
@Override
getCallSiteDescriptorback to summary
public CallSiteDescriptor getCallSiteDescriptor()

Implements jdk.dynalink.linker.LinkRequest.getCallSiteDescriptor.

Doc from jdk.dynalink.linker.LinkRequest.getCallSiteDescriptor.

Returns the call site descriptor for the call site being linked.

Annotations
@Override
getReceiverback to summary
public Object getReceiver()

Implements jdk.dynalink.linker.LinkRequest.getReceiver.

Doc from jdk.dynalink.linker.LinkRequest.getReceiver.

Returns the first argument for the invocation being linked; this is typically the receiver object. This is a shorthand for getArguments()[0] that also avoids the cloning of the arguments array.

Annotations
@Override
isCallSiteUnstableback to summary
public boolean isCallSiteUnstable()

Implements jdk.dynalink.linker.LinkRequest.isCallSiteUnstable.

Doc from jdk.dynalink.linker.LinkRequest.isCallSiteUnstable.

Returns true if the call site is considered unstable, that is, it has been relinked more times than was specified in DynamicLinkerFactory#setUnstableRelinkThreshold(int). Linkers should use this as a hint to prefer producing linkage that is more stable (its guard fails less frequently), even if that assumption causes a less effective version of an operation to be linked. This is just a hint, though, and linkers are allowed to ignore this property.

Annotations
@Override
replaceArgumentsback to summary
public LinkRequest replaceArguments(final CallSiteDescriptor newCallSiteDescriptor, final Object... newArguments)

Implements jdk.dynalink.linker.LinkRequest.replaceArguments.

Doc from jdk.dynalink.linker.LinkRequest.replaceArguments.

Returns a request identical to this one with call site descriptor and arguments replaced with the ones specified.

Annotations
@Override