Register one or more Actor System
Module providing application-wide configuration, using the Typesafe Config library.
Module providing application-wide configuration, using the Typesafe Config library. For further details about configuration syntax and usage, please refer to Typesafe Config homepage: https://github.com/typesafehub/config.
Akkamo context represents the cornerstone of the Akkamo platform, as it is the place
where different modules can register its own services provided for other modules (using
one of registerIn
methods) or can inject services already registered by other modules
(using one of the inject
method).
Akkamo context represents the cornerstone of the Akkamo platform, as it is the place
where different modules can register its own services provided for other modules (using
one of registerIn
methods) or can inject services already registered by other modules
(using one of the inject
method). Please note that the Context is immutable and any
update performed (e.g. registering service) will yield new, updated instance.
Error thrown during failing operation on the Context (e.g.
Error thrown during failing operation on the Context (e.g. attemp to register value into service, that has not been registered before).
detail message
optional error cause
Represents single module dependency.
Represents single module dependency. Provides convenient methods for chaining dependencies.
Trait indicating that the module extending this requires to perform additional actions before the Akkamo shutdown.
Trait indicating that the module extending this requires to perform additional actions before the Akkamo shutdown. This is the very last stage of the Akkamo module lifecycle and in this stage, module should close all opened connection, files and get prepared for shutdown.
Error to be thrown in case of serious unrecoverable error, occured during the dispose stage.
Error to be thrown in case of serious unrecoverable error, occured during the dispose stage.
error message
optional value of cause
Error thrown when Akkamo dispose phase fails (e.g.
Error thrown when Akkamo dispose phase fails (e.g. one of the disposed modules throws eu.akkamo.DisposableError).
detail message
optional error cause
Trait indicating that the module extending this requires to perform initialization during Akkamo startup.
Trait indicating that the module extending this requires to perform initialization during Akkamo startup. Initialization is the very first stage of Akkamo module lifecycle and in this stage, module should check all its required dependencies and/or register its own provided functionality into context.
Recommended Error to be thrown inside eu.akkamo.Initializable#initialize method if serious unrecoverable problem occurs.
Recommended Error to be thrown inside eu.akkamo.Initializable#initialize method if serious unrecoverable problem occurs.
error message
optional value of cause
Error thrown when Akkamo initialization fails (e.g.
Error thrown when Akkamo initialization fails (e.g. one of the initialized modules throws eu.akkamo.InitializableError).
detail message
optional error cause
This module provides LoggingAdapterFactory via the Akkamo context, allowing to use the configured logging system outside Akka actors.
This module provides LoggingAdapterFactory via the Akkamo context, allowing to use the configured logging system outside Akka actors.
LoggingAdapterFactory
Simple factory, providing LoggingAdapter
instance for specified category (e.g.
Simple factory, providing LoggingAdapter
instance for specified category (e.g. module name,
selected class). This factory is registered by the LogModule into the Akkamo context.
Trait representing the Akkamo module, i.e.
Trait representing the Akkamo module, i.e. independent application unit, with possible dependencies on another modules, providing own functionality to other modules. The main goal is to allow writing applications as a set of modules, loosely coupled each other, allowing to easily add new functionality to existing application (or remove it), or to prepare several different application build profiles, with different functionality (modules) included.
Each Akkamo module has its own lifecycle, with following stages: init stage (Initializable trait), run stage (Runnable trait) and dispose stage (Disposable trait). In order to execute desired module logic in selected stage, corresponding trait must be mixed in.
Disposable
Runnable
Initializable
The Registry provides functionality to register a holder object to the Akkamo context, which value can be changed later.
The Registry provides functionality to register a holder object to the Akkamo context,
which value can be changed later. Note that this structure is immutable, hence the value
replacement will yield new instance of Registry. The value is not intended to be changed
directly, but using the registerIn
method.
For further clarification, let's introduce simple example. Let the RouteRegistry
be fictional
(see. akkamo AkkaHttp project for real example) implementation of Registry
, representing the
collection of all registered REST HTTP endpoints, allowing any other module to register own
Route
, representing particular HTTP route (e.g. GET /foo/bar
).
// register the custom RouteRegistry into the provided HttpRegistry
ctx.registerIn[RouteRegistry, Route](instanceOfRoute)
For more details about creating and registering custom registry, please refer the official Akkamo online documentation here: http://akkamo.eu
type of held value
Represents the result holder of eu.akkamo.Initializable#initialize or eu.akkamo.Runnable#run operations.
Represents the result holder of eu.akkamo.Initializable#initialize or
eu.akkamo.Runnable#run operations. The actual operation result is held as an instance of
Try[Context]
.
type of the result
Error thrown when Akkamo run phase fails (e.g.
Error thrown when Akkamo run phase fails (e.g. one of the ran modules throws eu.akkamo.RunnableError).
detail message
optional error cause
Trait indicating that the module extending this requires to perform some actions after the initialization stage (i.e.
Trait indicating that the module extending this requires to perform some actions after the initialization stage (i.e. in time when all modules are initialized).
Recommended Error to be thrown inside eu.akkamo.Runnable#run method if serious unrecoverable problem occurs.
Recommended Error to be thrown inside eu.akkamo.Runnable#run method if serious unrecoverable problem occurs.
error message
optional value of cause
Object providing helper functions, data structures and implicit conversions to make the work with Java-based Typesafe Config in Scala world little more convenient.
Object providing helper functions, data structures and implicit conversions to make the work with Java-based Typesafe Config in Scala world little more convenient.
import eu.akkamo.config._ implicit val config: Config = someConfigInstanceHere val barValue: String = get[String]("barKey").getOrElse("unknown value")
Register one or more Actor System
In a case when more than one akka configuration exists, one must be denoted as
default
In case when missing configuration one default Akka system is created with name default.