alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Akka/Scala example source code file (osgi.rst)

This example Akka source code file (osgi.rst) is included in my "Source Code Warehouse" project. The intent of this project is to help you more easily find Akka and Scala source code examples by using tags.

All credit for the original source code belongs to akka.io; I'm just trying to make examples easier to find. (For my Scala work, see my Scala examples and tutorials.)

Akka tags/keywords

a, activator, actorsystem, actorsystemactivator, akka, framework, osgi, sample, the, to

The osgi.rst Akka example source code

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/docs/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>`_.
 

Other Akka source code examples

Here is a short list of links related to this Akka osgi.rst source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.