Creating OSGi application projects

An OSGi application project groups a set of bundles to provide a coherent business logic. The application can consist of different bundle types such as web enabled bundles and persistence (JPA) enabled bundles.

Before you begin

Create a bundle project.
Important: Composite bundles that are contained by an OSGi application are supported in WebSphere® Application Server V8.0 and higher.

About this task

The bundles that are contained by an OSGi application offer services that are isolated by the application. The services are not visible outside the application unless they are configured for export:
  • The services can be exported from the application to another application.
  • The services can be exported from the application for publication as a web service.
  • The application can include web enabled bundles for processing HTTP workloads.

The services are not able to consume services outside of the application unless the services are configured to import the services from outside the application. The imported services can be proxies to other services or can be proxies to remote services.

Procedure

  1. Click File > New > Other > OSGi > OSGi Application Project and then click Next.
    The New OSGi Application Bundle Project wizard opens.
  2. In the Project name field, enter the name of your application project. Click Next.
  3. Select a Target runtime from the drop down list. Set the target runtime to define an installed runtime environment. Runtimes are used at build time to compile projects. Click Next.
  4. On the OSGi Application page of the wizard, select the bundles that you want grouped by the application project. You can also create additional bundles by clicking New Bundle. Click Finish.

Results

Your OSGi application project is created in your workspace. Your application manifest file, META-INF/APPLICATION.MF, contains metadata that enables the OSGi Framework to process the modular aspects of the bundles. For more information about the application manifest file, see Application manifest files.

What to do next

Now that you have created an application project, you can export the project as an EBA file, publish the application to your server, and add or remove bundles from your OSGi application.

For more information about creating OSGi application projects, see the following subtopics: