LibraryLink ToToggle FramesPrintFeedback

Running the Sample

To package the demo into an OSGI bundle enter the following command:

>ant osgi

When Ant finishes building and packaging the demo you will find the bundle in the build folder.

Once you have packaged your application into a bundle, you must install it to a running OSGi container. How you install bundles into your OSGi container will depend on your OSGi container.

Use the install command from the FUSE ESB's OSGi command shell to install it into the container as shown in Example 4.6.


[Tip]Tip

FUSE ESB has a hot deployment feature that automates the installation and starting of OSGi bundles. Any bundle copied into FUSE ESB's deploy folder is automatically installed and started.

Before an application can be used the bundle containing the service implementation must be moved into the active life-cycle state and all of the bundles containing dependencies must be in the resolved, or active, life-cycle state.

In the demo, the bundle contains a Spring configuration file that defines the endpoint to be created by the application. FUSE ESB comes pre-loaded with the Spring-DM extender bundle. The Spring-DM extender bundle creates a Spring ApplicationContext for the jaxws:endpoint element included in the endpoint bundle's META-INF/spring directory. For more information about writing Spring configuration for a service provider see Configuring Service Providers.

When starting the bundle, the container begins trying to resolve all of the bundle's dependencies. Once the endpoint's bundle's dependencies are resolved, the container activates it.

To start the demo from FUSE ESB's osgi command shell use the start command as shown in Example 4.7.


Once the endpoint bundle is fully started, the HelloWorld service provider is ready to accept requests from consumers. To test the application you can run the client against the service provider by executing the ant client command. Example 4.8 shows the expected results.


When you are ready to take the service provider off line you can simply move it from the active state to the resolved state. This will shut down the service provider and free the resources it is using. However, the contents of the application's bundle remain available to other bundles.

To stop a bundle in FUSE ESB you use the stop command from the osgi command shell.

[Tip]Tip

Stopped bundles can be easily reactivated using the start command.

When you want to completely remove any resources exposed by your application's bundles you need to uninstall the bundles. Once a bundle is uninstalled none of its exported resources are available to bundles in the container. It also cannot be re-started. It must be reinstalled before it can be used again.

To uninstall bundles from the FUSE ESB container you use the uninstall command from the osgi command shell.