Sample OSGi applications
OSGi Applications support includes sample applications that demonstrate how to write and package bundles into an enterprise bundle archive (EBA) file.
OSGi application support is deprecated in WAS traditional because OSGi applications depend on a technology that is no longer included in Equinox 4.4.0 and later. There is no strategic alternative in WAS traditional. To continue to use OSGi applications, migrate the applications to Liberty. In Liberty, OSGi applications run as Subsystems, which are a standard form of OSGi application. See Migrate applications to Liberty.
The following OSGi applications are provided:
- "Blog"
- "Blabber"
- "Colors"
These applications demonstrate the following OSGi Applications features:
- Use Blueprint management.
- Use bean injection.
- Use services from the OSGi service registry.
- Publishing services to the OSGi service registry.
- Use the Java Persistence API (JPA).
- Update deployed applications in a modular fashion.
- Extending running applications without changing the underlying application.
The samples are provided in the following compressed archive files:
- OSGi_blogSample.zip
- OSGi_blabberSample.zip
- OSGi_colorsSample.zip
These files can be downloaded from the Samples download page. The EBA file for each sample application is in the installableApps directory of the sample compressed file, and the source code is provided in other subdirectories of the sample compressed file.
For information about how to install and run each sample application, see the following readme files:
- sample_osgi_blog_readme
- sample_osgi_blabber_readme
- sample_osgi_colors_readme
These files are available in the root directory of the associated sample compressed file. They are also available in the information center in the following topics
Blog sample application
The blog sample application is a traditional blogging application, used for publishing essay-length articles and allowing readers to comment on them. The application contains the following bundles:
- com.ibm.ws.eba.example.blog.persistence.
This bundle contains JPA-related code, and the interfaces that enable the main application code to update and query blog entries.
- com.ibm.ws.eba.example.blog_1.0.0.
This bundle contains the main application logic code and interacts between the web front end and the back end persistence code layer.
- com.ibm.ws.eba.example.blog.web.
This bundle contains the static web content and backing Java code for the web front end of the application.
- com.ibm.ws.eba.example.blog.api.
This bundle contains the API for the sample.
- com.ibm.ws.eba.example.blog.persistence_1.1.0.
This bundle contains an optional upgraded persistence bundle that also supplies a comment service.
To run the blog sample application, we can use all the bundles listed, or all the bundles except the upgraded persistence bundle (the last in the list).
See OSGi blog sample application.
Blabber sample application
The blabber sample application is a microblogging application, used to enable many different people to share brief comments. The application contains the following bundles:
- com.ibm.ws.eba.example.blabber.persistence.
This bundle contains code that relates to the Java Persistence API (JPA) layer and the interface for the main application code.
- com.ibm.ws.eba.example.blabber.
This bundle contains the main application code and the code for the web front end of the application.
See OSGi blabber sample application.
Colors sample application
The colors sample application demonstrates two of the key dynamic abilities of OSGi Applications for WebSphere Application server: how to administratively update deployed applications in a modular fashion, at the bundle level, and how to extend running applications, as the business requirements change, without changing the underlying application.
See OSGi colors sample application.
Subtopics
- OSGi blog sample application
The blog sample application is a traditional blogging application, used for publishing essay-length articles and allowing readers to comment on them. This sample application shows how to write and package bundles into an enterprise bundle archive (EBA) file. The sample includes example code for Blueprint management, bean injection, using and publishing services from and to the OSGi service registry, and the use of Java persistence.- OSGi blabber sample application
The blabber sample application is a microblogging application, used to enable many different people to share brief comments. This sample application shows how to write and package bundles into an enterprise bundle archive (EBA) file. The sample includes example code for Blueprint management, bean injection, using and publishing services from and to the OSGi service registry, and the use of Java persistence.- OSGi colors sample application
The colors sample application demonstrates two of the key dynamic abilities of OSGi Applications for WebSphere Application server: how to administratively update deployed applications in a modular fashion, at the bundle level, and how to extend running applications, as the business requirements change, without changing the underlying application.
OSGi blog sample application OSGi blabber sample application Best practices for developing and working with OSGi applications Developing enterprise OSGi applications for WAS
File name: was1530.html
prettyPrint();