Async Events without Happenings

Although the original motivation for async events was external happenings, it is also a useful tool for things that happen entirely within the Java environment. Such happenings are no problem. Anything that can call the fire method on an async event can cause its handlers to run. Firing an async event just releases a group of threadlike entities that registered for that event.

Time Triggering

Many real-time systems are full of the software equivalent of alarm clocks and timers. The RTSJ addresses these needs with the combination of async events and the Timer class. The RTSJ provides two types of timers: OneShotTimer and PeriodicTimer.

A OneShotTimer will execute its handleAsyncEvent method once at the specified ...

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.