Develop OSGi applications
This page provides a starting point for finding out how to develop OSGi applications.
New feature: The OSGi Applications support in WAS helps you develop and deploy modular applications that use both Java EE and OSGi technologies. We can design and build applications and suites of applications from coherent, versioned, reusable OSGi modules that are accessed only through well-defined interfaces. This enables the same, or different, applications to use different versions of the same third party libraries without interference.New feature:
Avoid trouble: We cannot assume that one bundle within an OSGi application will start or stop before another. If the application expects bundles to be started or stopped in a given order, it is unlikely to work in all environments. The Blueprint programming model provides a way of declaring and dealing with inter-bundle service dependencies. If you cannot use Blueprint, you can use the ServiceTracker class, perhaps with an associated ServiceTrackerCustomizer to track services and react to changes in their status.
Avoid trouble: OSGi applications have one or more bundles listed in their Application-Content stanza, each with a given version range. The specific version of each bundle in use at a given time can be varied by creating a new deployment as described in Update bundle versions for an EBA asset. For WAS v8.0 and later versions, composite bundles can either be listed in the Application-Content stanza, or added to the deployed OSGi application as an extension. For a given application, you should not extend the application with a composite bundle that is already listed in the Application-Content stanza, and whose version is within the listed range for the composite bundle. If you do this, you might get unexpected results when you update the bundle versions.
Develop and deploying an OSGi application