Class EventBinding<T>

java.lang.Object
com.oracle.truffle.api.instrumentation.EventBinding<T>
Type Parameters:
T - subscriber type: ExecutionEventListener or ExecutionEventNodeFactory.

public class EventBinding<T> extends Object
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 Details

    • getElement

      public T getElement()
      Returns:
      the subscriber: an ExecutionEventNodeFactory or ExecutionEventListener.
      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 the subscriber. 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 by Instrumenter create methods only.

      Throws:
      IllegalStateException - when the binding is attached already, or when it was disposed.
      Since:
      21.1
    • tryAttach

      public final boolean tryAttach()
      Try to attach this binding, if not disposed or attached already. Works the same as attach(), but returns false 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 by Instrumenter 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