pekko/akka-docs/rst/additional/osgi.rst
Björn Antonsson e98dd13cd6 !osg, pro Updated OSGi dependencies and using a BundleDelegatingClassLoader
* Numerous version upgrades to dependencies
* Publish integration test maven dependencies automatically
* Use slf4j logging, with standard OPS4j Pax Logging
* Maven and sbt use different target directories
* Add a custom serializer to the integration test
* Add akka-persistence to the integration test
* Removing reference copying and using a BundleDelegatingClassLoader
* Make akka-actor a proper bundle, and remove duplicate classes and
  reference.conf files from akka-osgi
* Remove akka-osgi-aries

This is a hackathon team effort by:
* Björn Antonsson
* Endre Sándor Varga
* Roland Kuhn
* Patrik Nordwall
2014-02-02 16:21:44 +01:00

35 lines
1.1 KiB
ReStructuredText

Akka in OSGi
============
Configuring the OSGi Framework
------------------------------
To use Akka in an OSGi environment, the ``org.osgi.framework.bootdelegation``
property must be set to always delegate the ``sun.misc`` package to the boot classloader
instead of resolving it through the normal OSGi class space.
Activator
---------
To bootstrap Akka inside an OSGi environment, you can use the ``akka.osgi.ActorSystemActivator`` class
to conveniently set up the ActorSystem.
.. includecode:: code/osgi/Activator.scala#Activator
The ``ActorSystemActivator`` creates the actor system with a class loader that finds resources
(``reference.conf`` files) and classes from the application bundle and all transitive dependencies.
The ``ActorSystemActivator`` class is included in the ``akka-osgi`` artifact.
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-osgi_@binVersion@</artifactId>
<version>@version@</version>
</dependency>
Sample
------
A complete sample project is provided in `akka-sample-osgi-dining-hakkers <@github@/akka-samples/akka-sample-osgi-dining-hakkers>`_.