Basic Async Event Operation

An async event has three major method groups:

  • Bind event to trigger. This group (of one) handles the connection between the async event and the trigger for the event.

  • Bind event to handlers. Most of AsyncEvent's public methods manage the set of event handlers associated with the event.

  • Fire the event. This increments the fire count for each async event handler associated with the async event. Any of the handlers not already active are started.

The fire count is an async event handler's hedge against overload problems. An async event handler has five phases:

  1. The Java runtime starts the schedulable object the handler will run in.

  2. The async event handler sets up to handle an event.

  3. The async event handler handles the event. ...

Get Real-Time Java™ Platform Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.