Top Description
org.graalvm.polyglot.proxy

public Interface Proxy

Known Direct Subinterfaces
org.graalvm.polyglot.proxy.ProxyDate, org.graalvm.polyglot.proxy.ProxyDuration, org.graalvm.polyglot.proxy.ProxyExecutable, org.graalvm.polyglot.proxy.ProxyHashMap, org.graalvm.polyglot.proxy.ProxyInstantiable, org.graalvm.polyglot.proxy.ProxyIterable, org.graalvm.polyglot.proxy.ProxyIterator, org.graalvm.polyglot.proxy.ProxyNativeObject, org.graalvm.polyglot.proxy.ProxyObject, org.graalvm.polyglot.proxy.ProxyTime, org.graalvm.polyglot.proxy.ProxyTimeZone
Imports
org.graalvm.polyglot.PolyglotException

Proxy interfaces allow to mimic guest language objects, arrays, executables, primitives and native objects in Graal languages. Every Graal language will treat instances of proxies like an object of that particular language. Multiple proxy interfaces can be implemented at the same time. For example, it is useful to provide proxy values that are objects with members and arrays at the same time.

Exceptions thrown by proxies are wrapped with a PolyglotException when the proxy is invoked in a guest language. It is possible to unwrap the PolyglotException using PolyglotException#asHostException().

The interfaces Proxy, ProxyArray, ProxyExecutable, ProxyInstantiable, ProxyNativeObject, ProxyObject, ProxyIterable, ProxyIterator can be used in combination with any other proxy interfaces.

The following proxy interface combinations are exclusive and throw an AssertionError if used together:

The following proxy interface combinations are invalid and throw an AssertionError if used:
Since
19.0
See Also
to mimic arrays, to mimic objects with members, to mimic objects that can be executed, to mimic native objects, to mimic date objects, to mimic time objects, to mimic timezone objects, to mimic duration objects, to mimic timestamp objects, to mimic objects that are instantiable, to mimic iterable objects, to mimic iterator objects, to mimic map objects