Home > play-osgi

play-osgi

Play-osgi is a project mainly written in Java, it's free.

Everything in is the name :)

Play OSGi

This Play! module intent to bring the power and the dynamism of OSGi into Play! applications.

OSGi Startup

The OSGi framework is embedded inside the Play OSGi module and is started/stopped with the framework. The OSGi framework used is Apache Felix.

OSGi Shell telnet access

Once started, the OSGi framework provides a shell services to interact with it. This shell is available via telnet protocole. Just type in a terminal :

telnet localhost 6666

and you will be able to interact with the OSGi framework. Type 'help' to know the availbale commands.

OSGi bundles auto-deploy

The Play OSGi module provide a way to autodeploy bundles. Once you application is started, just drop OSGi bundle in the 'autodeploy' folder at the root of your application.

OSGi web console

An OSGi admin web console is available in the app using the Play OSGi module. It's available at : http://localhost:9000/osgi/admin

OSGi API access

You can access the current bundle context with the following method :

BundleContext context = OSGi.bundleContext();

OSGi Services programmatic lookup

You can lookup OSGi services with the following methods :

MyService service = OSGi.service(MyService.class);

Iterable<MyService> services = OSGi.services(MyService.class, "(lang=*)");

OSGi Services injection

You can lookup OSGi services with built-in dependency injection :

@Inject @OSGiService private MyService service;

@Inject @OSGiService("(lang=*)") private Iterable<MyService> services;

Previous:first_app