Page Edited :
FELIX :
Apache Felix Application Demonstration
Apache Felix Application Demonstration has been edited by Richard S. Hall (Oct 19, 2007). Content:Apache Felix Application Demonstration(This document is a work in progress.) Apache Felix provides a foundation for creating modular and dynamically extensible applications. This page presents an example application to demonstrate the various approaches to consider when creating a OSGi/Felix-based application. Potential ApproachesWhen creating an OSGi-based application there are two main orthogonal issues to consider:
The first issue is actually a general issue when creating OSGi-based applications. There are two general approaches that can be used when creating an extensible OSGi application. The service model approach uses the OSGi service concept and the service registry as the extensibility mechanism. The extender model approach uses the OSGi installed bundle set as the extensibility mechanism. Both approaches have their advantages and disadvantages and they can be used independently or together. The second issue is related to whether your application is run completely on top of the OSGi framework as a set of bundles or whether your application hosts an embedded OSGi framework instance. Creating applications completely as a set of bundles is the preferred approach since it allows the application to run on any OSGi framework, but this it not always possible. In such cases where it is not possible or desired, then you may host a framework instance inside your application, which will likely tie your application to that framework implementation. The remainder of this document will present variations of an example application that demonstrates these different approaches. Example Application OverviewThe example application is a very simple paint program that effectively functions identically whether using services/extensions or running embedded/hosted. The application, called the host, defines a SimpleShape service/extension 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/extension has name and icon properties that the application uses for manipulating the services/extensions. Available shapes are displayed in the application's tool bar. To draw a shape, click on its button in the tool bar and then click in the drawing canvas. Shapes can be dragged, but not resized. When new shape services/extensions appear they are automatically added to the tool bar and they are automatically removed when the shape services/extensions disappear. Closing the application window causes the framework and the JVM to shut down. The following is a screen shot of the application. Service-Based Application on top of the FrameworkCurrently, the service-based example application is only available in our SVN repository. There are four separate projects that comprise the application, which can be found here: http://svn.apache.org/repos/asf/felix/trunk/examples/servicebased.host http://svn.apache.org/repos/asf/felix/trunk/examples/servicebased.circle http://svn.apache.org/repos/asf/felix/trunk/examples/servicebased.square http://svn.apache.org/repos/asf/felix/trunk/examples/servicebased.triangle
|
Unsubscribe or edit your notifications preferences