4.4. Obtaining and Calling Registered Services

After the dictionary bundle has been installed and activated in the framework, we can witness packages being exported and services being registered using commands in the framework console. However, the service itself is never invoked. Many developers are not comfortable with the notion of activating code that is not run and does nothing. In fact, this is one unique aspect of our programming model: You set up services waiting to be invoked by code from another bundle.

In this section, let's write a caller bundle whose sole purpose is to exercise DictionaryService in the dictionary bundle. To get our terminologies straight, recall that we refer to the caller bundle as the calling bundle, or the client ...

Get Programming Open Service Gateways with Java Embedded Server™ Technology 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.