GuardingDynamicLinker instances by
the DynamicLinker that owns them.
| Modifier and Type | Method and Description |
|---|---|
| public MethodHandle | Returns: a method handle that is a suitable combination ofMethodHandle#asType(MethodType),
MethodHandles#filterArguments(MethodHandle, int, MethodHandle.,
and MethodHandles#filterReturnValue(MethodHandle, MethodHandle)
with GuardingTypeConverterFactory-produced type converters as
filters.target method handle handle, MethodType the types of source arguments fromType)Similar to |
| public default MethodHandle | Returns: a method handle that is a suitable combination ofMethodHandle#asType(MethodType), and
MethodHandles#filterArguments(MethodHandle, int, MethodHandle.
with GuardingTypeConverterFactory-produced type converters as filters.target method handle handle, final MethodType the types of source arguments fromType)Similar to |
| public boolean | Returns: true if there can be a conversion, false if there can not.the source type for the conversion from, Class<?> the target type for the conversion to)Returns true if there might exist a conversion between the requested
types (either an automatic JVM conversion, or one provided by any
available |
| public ConversionComparator. | Returns: one of Comparison constants that establish which – if any – of the target types is preferable for the conversion.the source type. sourceType, Class<?> one potential target type targetType1, Class<?> another potential target type. targetType2)Determines which of the two type conversions from a source type to the two target types is preferred. |
| public MethodHandle | Returns: a method handle with parameters and/or return type potentially filtered for wrapping and unwrapping.the target method handle target)Modifies the method handle so that any parameters that can receive potentially internal language runtime objects will have a filter added on them to prevent them from escaping, potentially by wrapping them. |
| public GuardedInvocation | Returns: a guarded invocation linked by some of the guarding dynamic linkers managed by the top-level dynamic linker. Can be null if no available linker is able to link the invocation. You will typically use the elements of the returned invocation to compose your own invocation.a request for linking the invocation linkRequest)Creates a guarded invocation delegating back to the |
| public MethodHandle | Returns: a method handle performing the conversion.the type to convert from sourceType, Class<?> the type to convert to targetType)Given a source and target type, returns a method handle that converts between them. |
| public < the type of the return value provided by the passed-in supplier. T> T | Returns: the return value of the actionthe operation to execute in context of the specified lookup. operation, final SecureLookupSupplier secure supplier of the lookup lookupSupplier)Executes an operation within the context of a particular
|
| asType | back to summary |
|---|---|
| public MethodHandle asType(MethodHandle handle, MethodType fromType) Similar to
| |
| asTypeLosslessReturn | back to summary |
|---|---|
| public default MethodHandle asTypeLosslessReturn(final MethodHandle handle, final MethodType fromType) Similar to
| |
| canConvert | back to summary |
|---|---|
| public boolean canConvert(Class<?> from, Class<?> to) Returns true if there might exist a conversion between the requested
types (either an automatic JVM conversion, or one provided by any
available | |
| compareConversion | back to summary |
|---|---|
| public ConversionComparator. Determines which of the two type conversions from a source type to the
two target types is preferred. This is used for dynamic overloaded method
resolution. If the source type is convertible to exactly one target type
with a method invocation conversion, it is chosen, otherwise available
| |
| filterInternalObjects | back to summary |
|---|---|
| public MethodHandle filterInternalObjects(final MethodHandle target) Modifies the method handle so that any parameters that can receive
potentially internal language runtime objects will have a filter added on
them to prevent them from escaping, potentially by wrapping them. It can
also potentially add an unwrapping filter to the return value. Basically
transforms the method handle using the transformer configured by
| |
| getGuardedInvocation | back to summary |
|---|---|
| public GuardedInvocation getGuardedInvocation(LinkRequest linkRequest) throws Exception Creates a guarded invocation delegating back to the
| |
| getTypeConverter | back to summary |
|---|---|
| public MethodHandle getTypeConverter(Class<?> sourceType, Class<?> targetType) Given a source and target type, returns a method handle that converts
between them. Never returns null; in worst case it will return an
identity conversion (that might fail for some values at runtime). You
rarely need to use this method directly and should mostly rely on
| |
| getWithLookup | back to summary |
|---|---|
| public <T> T getWithLookup(final Supplier<T> operation, final SecureLookupSupplier lookupSupplier) Executes an operation within the context of a particular
| |