Class CompletionEvent<T extends Event<?>>

All Implemented Interfaces:
Future<T>, Associator, Eligible
Direct Known Subclasses:
KeyValueStoreData, NioRegistration.Completed, Request.In.Completed, Started

public abstract class CompletionEvent<T extends Event<?>> extends Event<T>
A base class for events that signal the completion of some other (monitored) event and provide this other event as their result.

Events of this type are automatically fired when the framework detects that the monitored event has completed.

Use event() to conveniently access the monitored event while handling the completion event.

See Also:
  • Constructor Details

    • CompletionEvent

      public CompletionEvent(T monitoredEvent, Channel... channels)
      Instantiates a new completion event.
      Parameters:
      monitoredEvent - the monitored event
      channels - the channels
  • Method Details

    • event

      public T event()
      Return the completed event.

      This is simply a shortcut for currentResults().get(0).

      Returns:
      the completed event
    • toString

      public String toString()
      Overrides:
      toString in class Event<T extends Event<?>>