Lesson 2: Develop the business logic
About this task
In this lesson, you create the business logic for your simple OSGi application. The business logic uses a POJO component assembly model. This example application provides a simple counter that increments each time it is accessed.
To create the business
logic:
Creating the package
Procedure
- In Enterprise Explorer, right-click CounterServiceBundle/src and then click . The New Java Package wizard opens.
- In the Name field, type com.ibm.ws.eba.counter and then click Finish. The package is created in the src folder.
Creating the interface class
Procedure
Creating the implementation class
Procedure
Results

Exporting the package
About this task
Procedure
- Double-click Manifest:CounterServiceBundle to open the bundle manifest file in the editor.
- Select the Runtime tab.
- In the Exported Packages section of the editor, click Add. The Exported Packages dialog opens.
- Click com.ibm.ws.eba.counter from the packages list and then click OK.
- Save the bundle manifest file.
Lesson checkpoint
You created the business logic for the OSGi Counter Service application.
In this lesson, you learned about the following topics:
- How to create a Java package.
- How to create a Java interface file.
- How to create a Java method.
- How to create an implementation class.
- How to declare the packages that are visible outside of the bundle by using the Export-Package property in the bundle manifest file.