Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Creating the JBI Service Engine

Let's first examine the classes created by the servicemix-service-engine Maven archetype in this simple SE we're developing. These classes extend class from either the JBI spec APIs or from the servicemix-common package. Now let's look at the classes created by the servicemix-service-engine Maven archetype:

  • MyBootstrap.java - Implements javax.jbi.component.Boostrap which is called by the JBI container when the component is installed and uninstalled. This is where you place logic to set up and tear down things when the component is started and stopped.
  • MyComponent.java - Extends the DefaultComponent, a convience class that makes creating JBI components much easier and provides lifecycle management of components deployed to the JBI container. This class should be fleshed out by overriding methods in the DefaultComponent to configure and initialize the component. This is where we will place the logic to print out the Hello World message.
  • MyEndpoint.java - Extends Endpoint and implements ExchangeProcessor. Endpoint provides a referenceable resource for the component and the ExchangeProcessor provides the ability for the JBI container to process the message exchange.

Creating the Maven Subprojects For the Service Unit and Service Assembly

...