There are three predefined instances of host access policies:
EXPLICIT - Java host methods or fields, must be public and be annotated with
@Export to make them accessible to the guest language.
SCOPED - Java host methods or fields, must be public and be annotated with
@Export to make them accessible to the guest language. Guest-to-host callback
parameter validity is scoped to the duration of the callback by default.
NONE - Does not allow any access to methods or fields of host objects. Java host
objects may still be passed into a context, but they cannot be accessed.
ALL - Does allow full unrestricted access to public methods or fields of host
objects. Note that this policy allows unrestricted access to reflection. It is highly discouraged
from using this policy in environments where the guest application is not fully trusted.
CONSTRAINED host access policy suitable for a context with
CONSTRAINED sandbox policy.
ISOLATED host access policy suitable for a context with
ISOLATED sandbox policy.
UNTRUSTED host access policy suitable for a context with
UNTRUSTED sandbox policy.
newBuilder(). The builder allows to
specify a custom export annotation and allowed and denied methods or fields.
| Modifier and Type | Class and Description |
|---|---|
| public class | HostAccess.
Builder to create a custom |
| public static @interface | HostAccess.
If |
| public static @interface | HostAccess.
Annotation used by the predefined |
| public static @interface | HostAccess.
Allows guest language to implement a Java type. |
| public static enum | HostAccess.
List of default host object mappings of mutable target types available in
|
| public static enum | HostAccess.
Represents the precedence of a target type mapping. |
| Modifier and Type | Field and Description |
|---|---|
| private final EconomicSet | |
| public static final HostAccess | ALL
Predefined host access policy that allows full unrestricted access to public methods or fields of public host classes. |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| private final HostAccess. | |
| pack-priv final boolean | |
| public static final HostAccess | CONSTRAINED
Predefined host access policy used by Context with a |
| private final EconomicSet | |
| private final EconomicSet | |
| private static final HostAccess | |
| private final EconomicMap | |
| public static final HostAccess | |
| pack-priv volatile Object | |
| pack-priv final EconomicSet | |
| private final EconomicSet | |
| public static final HostAccess | ISOLATED
Predefined host access policy used by Context with an |
| private final EconomicSet | |
| pack-priv final MethodHandles. | |
| private final boolean | |
| private final String | |
| public static final HostAccess | NONE
Predefined host access policy that disallows any access to public host methods or fields. |
| public static final HostAccess | SCOPED
Predefined host access policy that is the same as EXPLICIT and enables method scoping of callback parameter values on top. |
| private final List | |
| public static final HostAccess | UNTRUSTED
Predefined host access policy used by Context with an |
| Access | Constructor and Description |
|---|---|
| pack-priv | HostAccess(EconomicSet<Class<? extends Annotation>> annotations, EconomicMap<Class<?>, Boolean> excludeTypes, EconomicSet<AnnotatedElement> members, EconomicSet<Class<? extends Annotation>> implementableAnnotations, EconomicSet<Class<?>> implementableTypes, List<Object> targetMappings, String name, boolean allowPublic, boolean allowAllImplementations, boolean allowAllClassImplementations, boolean allowArrayAccess, boolean allowListAccess, boolean allowBufferAccess, boolean allowIterableAccess, boolean allowIteratorAccess, boolean allowMapAccess, boolean allowBigIntegerNumberAccess, boolean allowAccessInheritance, HostAccess.
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | |
| pack-priv boolean | |
| private static <K, T> EconomicMap | |
| private static <T> EconomicSet | |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| private static <T, V> boolean | |
| private static <T> boolean | |
| private static Class | |
| pack-priv HostAccess. | |
| pack-priv List | |
| private static boolean | |
| public int | |
| private static <T, V> int | |
| private static <V> int | |
| pack-priv boolean | |
| pack-priv boolean | |
| public static HostAccess. | |
| public static HostAccess. | newBuilder(HostAccess conf)
Creates a new builder that allows to create a custom host access policy based of a preset configuration. |
| public String |