Class PrivatelyQueuedListener<P>

java.lang.Object
ghidra.util.datastruct.PrivatelyQueuedListener<P>
Type Parameters:
P - the type of listener

public class PrivatelyQueuedListener<P> extends Object
A listener which queues invocations onto a separate executor
  • Field Details

    • in

      public final P in
      The "input" listener, which should be added as a listener on other things
    • executor

      protected final Executor executor
    • out

      protected final P out
  • Constructor Details

    • PrivatelyQueuedListener

      public PrivatelyQueuedListener(Class<P> iface, Executor executor, P out)
      Create a new privately-queued listener which will invoke the given "output" listener

      Invoking the listener methods of in will cause that invocation to be queued and eventually delivered to the given output listener. Note, as a result, it is assumed all listener methods return type void, since returning a value would require waiting on the invocation to complete, which defeats the purpose of the private queue. The invocations on in will always return null, which will cause an exception if the return type is a different primitive.

      Parameters:
      iface - the interface of the listener
      executor - the executor representing the processing queue
      out - the listener to receive the queued invocations
    • PrivatelyQueuedListener

      public PrivatelyQueuedListener(Class<P> iface, String threadNamePattern, P out)
      Create a new single-threaded privately-queued listener
      Parameters:
      iface - the interface of the listener
      threadNamePattern - a pattern for naming the single thread
      out - the listener to receive the queued invocations
  • Method Details