Class EventBinding<T>
java.lang.Object
com.oracle.truffle.api.instrumentation.EventBinding<T>
- Type Parameters:
T
- subscriber type:ExecutionEventListener
orExecutionEventNodeFactory
.
An instrumentation handle for a subscription to a
filtered stream of execution event notifications.
The subscription remains active until:
- Since:
- 0.12
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
attach()
Attach this binding to receive the associated notifications by thesubscriber
.void
dispose()
Cancels the subscription permanently.final boolean
Test if this binding is attached.boolean
final boolean
Try to attach this binding, if not disposed or attached already.
-
Method Details
-
getElement
- Returns:
- the subscriber: an
ExecutionEventNodeFactory
orExecutionEventListener
. - 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
Instrumenter
attach methods were used. Use this for bindings created byInstrumenter
create methods only.- Throws:
IllegalStateException
- when the binding isattached
already, 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 returnsfalse
instead of throwing an exception when not successful.The binding is attached automatically, when one of the
Instrumenter
attach methods were used. Use this for bindings created byInstrumenter
create methods only.- Returns:
true
when the binding was attached successfully,false
when 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
-