APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.dynalink

public Class SecureLookupSupplier

extends Object
Class Inheritance
Known Direct Subclasses
jdk.dynalink.CallSiteDescriptor
Imports
java.lang.invoke.MethodHandles, .MethodHandles.Lookup, java.util.Objects

Encapsulates a MethodHandles.Lookup object.

API Note

SecureLookupSupplier provided a way in older JDK releases to guard access to a MethodHandles.Lookup object when running with a security manager set.

Since
9

Field Summary

Modifier and TypeField and Description
public static final String
GET_LOOKUP_PERMISSION_NAME

The name of a runtime permission required to successfully invoke the getLookup() method.

private final MethodHandles.Lookup

Constructor Summary

AccessConstructor and Description
public
SecureLookupSupplier(final MethodHandles.Lookup
the lookup to secure. Can not be null.
lookup
)

Creates a new secure lookup supplier for the given lookup.

Method Summary

Modifier and TypeMethod and Description
public final MethodHandles.Lookup

Returns:

the lookup secured by this SecureLookupSupplier.
getLookup
()

Returns the lookup secured by this SecureLookupSupplier.

protected final MethodHandles.Lookup

Returns:

same as returned value of getLookup().
getLookupPrivileged
()

Returns the lookup secured by this SecureLookupSupplier.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

GET_LOOKUP_PERMISSION_NAMEback to summary
public static final String GET_LOOKUP_PERMISSION_NAME

The name of a runtime permission required to successfully invoke the getLookup() method.

lookupback to summary
private final MethodHandles.Lookup lookup

Constructor Detail

SecureLookupSupplierback to summary
public SecureLookupSupplier(final MethodHandles.Lookup lookup)

Creates a new secure lookup supplier for the given lookup.

Parameters
lookup:MethodHandles.Lookup

the lookup to secure. Can not be null.

Exceptions
NullPointerException:
if null is passed.

Method Detail

getLookupback to summary
public final MethodHandles.Lookup getLookup()

Returns the lookup secured by this SecureLookupSupplier.

Returns:MethodHandles.Lookup

the lookup secured by this SecureLookupSupplier.

getLookupPrivilegedback to summary
protected final MethodHandles.Lookup getLookupPrivileged()

Returns the lookup secured by this SecureLookupSupplier.

Returns:MethodHandles.Lookup

same as returned value of getLookup().