Interface Proxy

All Known Subinterfaces:
ProxyArray, ProxyDate, ProxyDuration, ProxyExecutable, ProxyHashMap, ProxyInstant, ProxyInstantiable, ProxyIterable, ProxyIterator, ProxyNativeObject, ProxyObject, ProxyTime, ProxyTimeZone

public interface Proxy
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: