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

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

This example Akka source code file (microkernel.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

akka, bootable, ctrl-c, hello, kernel, microkernel, on, the, to, windows

The microkernel.rst Akka example source code


.. _microkernel-java:

Microkernel
==================

The purpose of the Akka Microkernel is to offer a bundling mechanism so that you can distribute
an Akka application as a single payload, without the need to run in a Java Application Server or manually
having to create a launcher script.

The Akka Microkernel is included in the Akka download found at `downloads`_.

.. _downloads: http://akka.io/downloads

To run an application with the microkernel you need to create a Bootable class
that handles the startup and shutdown the application. An example is included below.

Put your application jar in the ``deploy`` directory and additional dependencies in the ``lib`` directory
to have them automatically loaded and placed on the classpath.

To start the kernel use the scripts in the ``bin`` directory, passing the boot
classes for your application. 

The start script adds ``config`` directory first in the classpath, followed by ``lib/*``.
It runs java with main class ``akka.kernel.Main`` and the supplied Bootable class as
argument.

Example command (on a unix-based system):

.. code-block:: none

   bin/akka sample.kernel.hello.HelloKernel

Use ``Ctrl-C`` to interrupt and exit the microkernel.

On a Windows machine you can also use the bin/akka.bat script.

The code for the Hello Kernel example (see the ``HelloKernel`` class for an example
of creating a Bootable):

.. includecode:: ../../../akka-samples/akka-sample-hello-kernel/src/main/java/sample/kernel/hello/java/HelloKernel.java


Other Akka source code examples

Here is a short list of links related to this Akka microkernel.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.