Class EventBinding<T>
java.lang.Object
com.oracle.truffle.api.instrumentation.EventBinding<T>
- Type Parameters:
T- subscriber type:ExecutionEventListenerorExecutionEventNodeFactory.
An instrumentation handle for a subscription to a
filtered stream of execution event notifications.
The subscription remains active until:
- explicit disposal of the subscription; or
- the instrumented engine is closed.
- Since:
- 0.12
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionfinal voidattach()Attach this binding to receive the associated notifications by thesubscriber.voiddispose()Cancels the subscription permanently.final booleanTest if this binding is attached.booleanfinal booleanTry to attach this binding, if not disposed or attached already.
-
Method Details
-
getElement
- Returns:
- the subscriber: an
ExecutionEventNodeFactoryorExecutionEventListener. - Since:
- 0.12
-
isAttached
public final boolean isAttached()Test if this binding is attached.- Since:
- 21.1
-
attach
public final void attach()Attach this binding to receive the associated notifications by thesubscriber. When notification about existing sources were requested in binding creation, notifications will be performed in this call.The binding is attached automatically, when one of the
Instrumenterattach methods were used. Use this for bindings created byInstrumentercreate methods only.- Throws:
IllegalStateException- when the binding isattachedalready, or when it wasdisposed.- Since:
- 21.1
-
tryAttach
public final boolean tryAttach()Try to attach this binding, if not disposed or attached already. Works the same asattach(), but returnsfalseinstead of throwing an exception when not successful.The binding is attached automatically, when one of the
Instrumenterattach methods were used. Use this for bindings created byInstrumentercreate methods only.- Returns:
truewhen the binding was attached successfully,falsewhen disposed or attached already.- Since:
- 23.1
-
isDisposed
public boolean isDisposed()- Returns:
- whether the subscription has been permanently canceled.
- Since:
- 0.12
-
dispose
public void dispose()Cancels the subscription permanently.- Since:
- 0.12
-