This is the main entry point to the Domino DSL.
This is the main entry point to the Domino DSL.
By having your bundle activator extend from this class, you get full access to the Domino DSL. In most cases DominoActivator is all you need because it mixes in all the other functionality.
Note that if you use watchServices or watchBundles, you might additionally want to import the relevant watcher events.
package org.example.domino_test_one import domino.DominoActivator import org.osgi.service.http.HttpService class MyService(httpService: HttpService) class Activator extends DominoActivator { whenBundleActive { // Make MyService available as long as HttpService is present whenServicePresent[HttpService] { httpService => val myService = new MyService(httpService) myService.providesService[MyService] } } }
package org.example.domino_test_two import domino.DominoActivator class KeyService(key: String) class Activator extends DominoActivator { whenBundleActive { // Reregister KeyService whenever configuration changes whenConfigurationActive("my_service") { conf => val key = conf.get("key") map { _.asInstanceOf[String] } getOrElse "defaultKey" new KeyService(key).providesService[KeyService] } } }
I suggest extending from this class instead of mixing in the subpackage traits. Then you don't need to recompile your bundle if minor internal changes are made to Domino. This results in greater upwards compatibility.
Provides common implicit conversions.
Provides common implicit conversions. This is used by the other traits.
A bundle activator which contains empty start
and stop
methods.
A bundle activator which contains empty start
and stop
methods. This is the basis
for the trait OsgiContext which hooks into the start
and stop
methods.
Provides the basis for the Domino DSL by binding the bundle lifecycle to a capsule scope.
Provides the basis for the Domino DSL by binding the bundle lifecycle to a capsule scope.
Wrapper for a service reference which adds methods to resolve the corresponding service.
Contains utility methods used throughout Domino.
Contains functionality related to watching OSGi bundles coming and going.
Contains a basic API and default implementation for building, using and extending a capsule-based DSL.
Contains a basic API and default implementation for building, using and extending a capsule-based DSL.
A capsule-based DSL is a generalization of the DSL used in the project "Domino". Here's an illustrative example how a capsuled-based DSL might look like:
// Somewhere in your code
whenTurnedOn {
whenDevicePluggedIn {
lightLED()
}
}
The documentation distinguishes between 3 types of API clients: End users, capsule providers and context providers. The majority of developers will just come into contact with this API as end users.
Contains functionality related to watching OSGi configuration changes.
Contains functionality related to OSGi logging.
Contains a simple Scala API for logging along with a Java Logging API implementation.
Contains a simple Scala API for logging along with a Java Logging API implementation.
The generic logging interface is provided by the Logger trait. Implementations for various logging frameworks such as SLF4J or OSGi LogService are provided in separate modules.
See JavaUtilLogging for a convenient way to use Java Logging API.
Contains Scala interfaces, adapters and builders for easily building OSGi Metatype descriptions.
Contains Scala interfaces, adapters and builders for easily building OSGi Metatype descriptions. OSGi Metatype descriptions are very well suited for quickly providing administration user interfaces.
You probably want to check out the builders.
I created totally new Scala interfaces and adapters instead of directly implementing the Java interfaces of the OSGi Metatype API in order to prevent name clashes and confusion about what method to call. Scala Swing does it the same way, I guess for the same reasons.
Contains functionality related to acquiring OSGi services.
Contains functionality related to registering objects in the OSGi service registry.
Contains functionality related to watching OSGi services coming and going.
Contains Domino, a lightweight Scala library for writing elegant OSGi bundle activators.
For getting started, please see DominoActivator, the main entry point to the Domino DSL. Each sub package contains functionality for a specific part of the DSL.