Package

domino

Permalink

package domino

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.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. domino
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract class DominoActivator extends OsgiContext with CapsuleConvenience with BundleWatching with ConfigurationWatching with ServiceConsuming with ServiceProviding with ServiceWatching

    Permalink

    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.

    Example 1: Wait for a service

    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]
        }
      }
    }

    Example 2: Listen for configuration changes

    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]
        }
      }
    }
    Note

    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.

  2. trait DominoImplicits extends AnyRef

    Permalink

    Provides common implicit conversions.

    Provides common implicit conversions. This is used by the other traits.

  3. trait EmptyBundleActivator extends BundleActivator

    Permalink

    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.

    See also

    Stackable Trait Pattern

  4. trait OsgiContext extends DynamicCapsuleContext with EmptyBundleActivator

    Permalink

    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.

    See also

    domino.capsule

  5. class RichServiceReference[S <: AnyRef] extends AnyRef

    Permalink

    Wrapper for a service reference which adds methods to resolve the corresponding service.

Value Members

  1. object DominoUtil

    Permalink

    Contains utility methods used throughout Domino.

  2. package bundle_watching

    Permalink

    Contains functionality related to watching OSGi bundles coming and going.

  3. package capsule

    Permalink

    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.

  4. package configuration_watching

    Permalink

    Contains functionality related to watching OSGi configuration changes.

  5. package internal

    Permalink
  6. package logging

    Permalink

    Contains functionality related to OSGi logging.

  7. package scala_logging

    Permalink

    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.

  8. package scala_osgi_metatype

    Permalink

    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.

    Note

    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.

  9. package service_consuming

    Permalink

    Contains functionality related to acquiring OSGi services.

  10. package service_providing

    Permalink

    Contains functionality related to registering objects in the OSGi service registry.

  11. package service_watching

    Permalink

    Contains functionality related to watching OSGi services coming and going.

Inherited from AnyRef

Inherited from Any

Ungrouped