Chapter 6. A world of events

 

This chapter covers

  • Publishing events using the Event Admin service
  • Subscribing to events using the Event Admin service
  • Trade-offs between publishing events in a blocked and unblocked manner
  • Subscribing to specific events by using filtering
  • Issues related to ordering of events and exception handling within event handlers
  • Improving decoupling by exchanging events
  • Subscribing to OSGi framework events
  • The extender pattern

In this chapter you’ll learn about the OSGi Event Admin service. The Event Admin provides a generic mechanism for handling events. Using the Event Admin service, you can not only receive events but also generate your own set of application events to be received by other applications. By employing the Event Admin service, you can create applications that communicate solely by exchanging events and thus take another important step toward building more scalable and flexible systems.

Why spend a full chapter on the subject of event handling? An application’s ecosystem contains a plethora of events, including not only IT-related events but application events and even events generated by the OSGi framework itself, which you can leverage to implement what’s known as the extender pattern. As you’ll see, software systems are a world of events!

We’ll start our investigation of the Event Admin service by exploring its underlying publish-subscribe model.

6.1. The publish-subscribe model

 
 
 
 

6.2. The Event Admin

 
 
 

6.3. Advanced event handling

 
 
 

6.4. Event Admin shortcomings

 
 
 
 

6.5. Decoupling using events

 
 

6.6. OSGi framework events

 
 

6.7. Summary

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest