Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The remainder of this document will present variations of an example application that demonstrates these different approaches.

Example Application Overview

The example application is a very simple drawing program. The application, called the host, defines a SimpleShape service that it uses to draw shapes. Different implementations of the SimpleShape can be created to allow the application to draw different shapes. Each shape service has name and icon service properties that the application uses for handling the services. Available shapes are displayed in the applications tool bar. To draw a shape, click on its button in the tool bar and then click in the drawing canvas. Shapes cannot be resized, but they can be dragged around. When new shape services appear they are automatically added to the tool bar and they are automatically removed when the shape services disappear. Closing the applications window causes the framework and the JVM to shut down.

Service-Based Application on top of the Framework

Currently, the example application is only available in our SVN repository. There are four separate projects that comprise the application, which can be found here:

No Format

http://svn.apache.org/repos/asf/felix/examples/servicebased.host
http://svn.apache.org/repos/asf/felix/examples/servicebased.circle
http://svn.apache.org/repos/asf/felix/examples/servicebased.square
http://svn.apache.org/repos/asf/felix/examples/servicebased.triangle

Check out each project using an appropriate SVN command, such as:

No Format

svn co http://svn.apache.org/repos/asf/felix/examples/servicebased.host

Once you have the projects checked out you can go into each sub-directory and build using Maven; this assumes you have Maven properly installed. To build simply perform the following in each project directory:

No Format

mvn clean install

Once you have the projects built, you can run Felix and install/start the resulting bundle in the target/ directory of each project directory.

Examine the source code to understand the details of the approach. In the future this documentation will hopefully be expanded to described more details.

Service-Based Application embedding the Framework

The bundles from the previous section are implement the embedded, service-based approach. The host bundle also provides a static main() method which creates an embedded instance of Felix and loads the shape service bundles. To execute the stand-alone application, issue the following command:

No Format

java -jar target/servicebased.host-1.0.0.jar
{noformat{

To successfully execute the stand-alone version of the application, you must be in the "servicebased.host" project directory when issuing the above command.

Examine the source code to understand the details of the approach. In the future this documentation will hopefully be expanded to described more details.

Extender-Based Application on top of the Framework

...