Class

domino.internal

DominoBundleActivator

Related Doc: package internal

Permalink

class DominoBundleActivator extends DominoActivator

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DominoBundleActivator
  2. DominoActivator
  3. ServiceWatching
  4. ServiceProviding
  5. ServiceConsuming
  6. DominoImplicits
  7. ConfigurationWatching
  8. BundleWatching
  9. CapsuleConvenience
  10. OsgiContext
  11. EmptyBundleActivator
  12. BundleActivator
  13. DynamicCapsuleContext
  14. CapsuleContext
  15. AnyRef
  16. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new DominoBundleActivator()

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addCapsule(capsule: Capsule): Unit

    Permalink

    Starts the given capsule and adds it to the current capsule scope.

    Starts the given capsule and adds it to the current capsule scope.

    capsule

    capsule

    Definition Classes
    DynamicCapsuleContextCapsuleContext
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def bundleContext: BundleContext

    Permalink

    Returns the bundle context as long as the bundle is active.

    Returns the bundle context as long as the bundle is active.

    Definition Classes
    OsgiContext
  7. val capsuleContext: DominoActivator

    Permalink

    Dependency

    Dependency

    Attributes
    protected
    Definition Classes
    DominoActivatorServiceWatchingServiceProvidingConfigurationWatchingBundleWatchingCapsuleConvenience
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def executeWithinNewCapsuleScope(f: ⇒ Unit): CapsuleScope

    Permalink

    Creates a new capsule scope on top of the active one and executes the given function in it.

    Creates a new capsule scope on top of the active one and executes the given function in it. So the function sees the new capsule scope as the current one.

    f

    the function which might add capsules to the new scope

    returns

    the new scope

    Definition Classes
    DynamicCapsuleContextCapsuleContext
  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. def onStart(f: ⇒ Unit): Unit

    Permalink

    Adds the given start logic.

    Adds the given start logic. The logic is executed immediately.

    f

    start logic

    Definition Classes
    CapsuleConvenience
  20. def onStop(f: ⇒ Unit): Unit

    Permalink

    Adds the given stop logic.

    Adds the given stop logic. The given function will be executed when the current scope is stopped.

    f

    stop logic

    Definition Classes
    CapsuleConvenience
  21. def service[S <: AnyRef](filter: String)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[S], arg1: ClassTag[S]): Option[S]

    Permalink

    Returns the first available service of the specified class which satisfies the filter if available.

    Returns the first available service of the specified class which satisfies the filter if available. If the service is not available, it returns None. The service is not explicitly released.

    S

    service type

    filter

    filter expression

    returns

    service if available

    Definition Classes
    ServiceConsuming
  22. def service[S <: AnyRef](implicit arg0: ClassTag[S]): Option[S]

    Permalink

    Returns the highest-ranked service of the specified type if available.

    Returns the highest-ranked service of the specified type if available. The service is not explicitly released. It's assumed that the service will be used until the bundle stops. Doesn't take type parameters into account!

    S

    service type

    returns

    service if available

    Definition Classes
    ServiceConsuming
  23. val serviceConsuming: DominoActivator

    Permalink

    Dependency

    Dependency

    Attributes
    protected
    Definition Classes
    DominoActivatorConfigurationWatching
  24. val serviceProviding: DominoActivator

    Permalink

    Dependency

    Dependency

    Attributes
    protected
    Definition Classes
    DominoActivator
  25. def serviceRef[S <: AnyRef](filter: String)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[S], arg1: ClassTag[S]): Option[ServiceReference[S]]

    Permalink

    Like service with filter but returns the service reference.

    Like service with filter but returns the service reference.

    Definition Classes
    ServiceConsuming
  26. def serviceRef[S <: AnyRef](implicit arg0: ClassTag[S]): Option[ServiceReference[S]]

    Permalink

    Like service but returns the reference so you can access meta information about that service.

    Like service but returns the reference so you can access meta information about that service. An implicit conversion adds a service property to the reference, so you can simply use that to obtain the service. Doesn't take type parameters into account!

    Definition Classes
    ServiceConsuming
  27. implicit def serviceRefToRichServiceRef[S <: AnyRef](serviceRef: ServiceReference[S]): RichServiceReference[S]

    Permalink

    Converts a service reference to a rich service reference so one can easily obtain the corresponding service by calling service, for example.

    Converts a service reference to a rich service reference so one can easily obtain the corresponding service by calling service, for example.

    Definition Classes
    DominoImplicits
  28. def serviceRefs[S <: AnyRef](filter: String)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[S], arg1: ClassTag[S]): Seq[ServiceReference[S]]

    Permalink

    Like services with filters but returns the references.

    Like services with filters but returns the references.

    Definition Classes
    ServiceConsuming
  29. def serviceRefs[S <: AnyRef](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[S], arg1: ClassTag[S]): Seq[ServiceReference[S]]

    Permalink

    Like services but returns service references.

    Like services but returns service references.

    Definition Classes
    ServiceConsuming
  30. implicit def serviceToProvidableService[S](service: S): ProvidableService[S]

    Permalink

    Automatically converts any object to a ProvidableService.

    Automatically converts any object to a ProvidableService.

    Definition Classes
    ServiceProviding
    See also

    ProvidableService for the list of service registration methods

  31. def services[S <: AnyRef](filter: String)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[S], arg1: ClassTag[S]): Seq[S]

    Permalink

    Returns all services of the specified type which satisfy the given filter.

    Returns all services of the specified type which satisfy the given filter.

    S

    service type

    filter

    filter expression

    returns

    services

    Definition Classes
    ServiceConsuming
  32. def services[S <: AnyRef](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[S], arg1: ClassTag[S]): Seq[S]

    Permalink

    Returns all services of the given type.

    Returns all services of the given type.

    S

    service type

    Definition Classes
    ServiceConsuming
  33. def start(context: BundleContext): Unit

    Permalink
    Definition Classes
    OsgiContextEmptyBundleActivator → BundleActivator
  34. def stop(context: BundleContext): Unit

    Permalink
    Definition Classes
    OsgiContextEmptyBundleActivator → BundleActivator
  35. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  36. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  37. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. def watchAdvancedServices[S <: AnyRef](filter: String)(f: (ServiceWatcherEvent[S]) ⇒ Unit)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[S], arg1: ClassTag[S]): ServiceTracker[S, S]

    Permalink

    Lets you react to service events for services with the specified type which match the given filter.

    Lets you react to service events for services with the specified type which match the given filter.

    S

    Service type

    f

    Service event handler

    returns

    Underlying service tracker

    Definition Classes
    ServiceWatching
  41. def watchBundles(f: (BundleWatcherEvent) ⇒ Unit): BundleTracker[Bundle]

    Permalink

    Reacts to bundle events with the given event handler.

    Reacts to bundle events with the given event handler.

    f

    bundle event handler

    returns

    underlying bundle tracker

    Definition Classes
    BundleWatching
  42. def watchServices[S <: AnyRef](f: (ServiceWatcherEvent[S]) ⇒ Unit)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[S], arg1: ClassTag[S]): ServiceTracker[S, S]

    Permalink

    Lets you react to service events for services with the specified type.

    Lets you react to service events for services with the specified type.

    S

    Service type

    f

    Service event handler

    returns

    Underlying service tracker

    Definition Classes
    ServiceWatching
  43. def whenAdvancedServicePresent[S <: AnyRef](filter: String)(f: (S) ⇒ Unit)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[S], arg1: ClassTag[S]): ServiceTracker[S, S]

    Permalink

    Activates the given inner logic as long as the first service of the given type is present.

    Activates the given inner logic as long as the first service of the given type is present. This implements the concept of required services. The inner logic is started as soon as a service s of the given type gets present and stopped when s is removed.

    Definition Classes
    ServiceWatching
    To do

    Idea for roadmap: Fallback to another service if s is removed and another service of the type is available (reevaluate capsule).

  44. def whenBundleActive(f: ⇒ Unit): Unit

    Permalink

    Defines a handler f to be executed when the bundle becomes active.

    Defines a handler f to be executed when the bundle becomes active. f is executed as soon as the bundle activator's start method is called. This should be called in the constructor of your activator.

    In f, you have the opportunity to add so called capsules, which have their own start and stop methods (a kind of mini bundles). Their stop methods will be invoked as soon as the bundle activator's stop method is called. So you have the big chance here to encapsulate start and stop logic at one place, making the bundle activator less error-prone, better readable and easier to write.

    f

    Handler

    Definition Classes
    OsgiContext
  45. def whenConfigurationActive(objectClassDefinition: ObjectClassDefinition)(f: (Map[String, Any]) ⇒ Unit): ServiceRegistration[ManagedService]

    Permalink

    Like the same-named method which expects the service PID but takes the service PID from the given object class definition and registers a corresponding meta type provider so a nice configuration GUI will be created.

    Like the same-named method which expects the service PID but takes the service PID from the given object class definition and registers a corresponding meta type provider so a nice configuration GUI will be created.

    objectClassDefinition

    object class definition

    f

    handler

    returns

    the managed service registration

    Definition Classes
    ConfigurationWatching
  46. def whenConfigurationActive(servicePid: String, metaTypeProvider: Option[MetaTypeProvider] = None)(f: (Map[String, Any]) ⇒ Unit): ServiceRegistration[ManagedService]

    Permalink

    Executes the given handler with the initial configuration or an empty map if none exists.

    Executes the given handler with the initial configuration or an empty map if none exists. Whenever the configuration is changed, the capsules registered in the handler are stopped and the handler is executed again with the new configuration.

    servicePid

    service PID

    metaTypeProvider

    optional metatype provider

    f

    handler

    returns

    the managed service registration

    Definition Classes
    ConfigurationWatching
  47. def whenFactoryConfigurationActive(objectClassDefinition: ObjectClassDefinition)(f: (Map[String, Any], String) ⇒ Unit): ServiceRegistration[ManagedServiceFactory]

    Permalink

    Like the same-named method which expects the service PID but takes the service PID from the given object class definition and registers a corresponding meta type provider so a nice configuration GUI will be created.

    Like the same-named method which expects the service PID but takes the service PID from the given object class definition and registers a corresponding meta type provider so a nice configuration GUI will be created.

    objectClassDefinition

    object class definition

    f

    handler

    returns

    the managed service factory registration

    Definition Classes
    ConfigurationWatching
  48. def whenFactoryConfigurationActive(servicePid: String, name: String, metaTypeProvider: Option[MetaTypeProvider] = None)(f: (Map[String, Any], String) ⇒ Unit): ServiceRegistration[ManagedServiceFactory]

    Permalink

    Executes the given handler whenever a new factory configuration is created.

    Executes the given handler whenever a new factory configuration is created. Whenever a factory configuration is changed, the correct capsules registered in the corresponding handler are stopped and the handler is executed again with the new factory configuration. When the factory configuration is removed, the corresponding capsules are stopped.

    servicePid

    service PID

    name

    descriptive name for the factory

    metaTypeProvider

    optional metatype provider

    f

    handler

    returns

    the managed service factory registration

    Definition Classes
    ConfigurationWatching
  49. def whenServicePresent[S <: AnyRef](f: (S) ⇒ Unit)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[S], arg1: ClassTag[S]): ServiceTracker[S, S]

    Permalink

    Waits until a service of the specified type is available and executes the given event handler with it.

    Waits until a service of the specified type is available and executes the given event handler with it. When the service disappears, the capsules added in the handlers are stopped. You can wait on a bunch of services if you nest whenServicePresent methods.

    S

    Service type

    f

    Handler

    returns

    Underlying service tracker

    Definition Classes
    ServiceWatching
  50. def whenServicesPresent[S1 <: AnyRef, S2 <: AnyRef, S3 <: AnyRef, S4 <: AnyRef, S5 <: AnyRef](f: (S1, S2, S3, S4, S5) ⇒ Unit)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[S1], arg1: ClassTag[S1], arg2: scala.reflect.api.JavaUniverse.TypeTag[S2], arg3: ClassTag[S2], arg4: scala.reflect.api.JavaUniverse.TypeTag[S3], arg5: ClassTag[S3], arg6: scala.reflect.api.JavaUniverse.TypeTag[S4], arg7: ClassTag[S4], arg8: scala.reflect.api.JavaUniverse.TypeTag[S5], arg9: ClassTag[S5]): ServiceTracker[S1, S1]

    Permalink

    Definition Classes
    ServiceWatching
  51. def whenServicesPresent[S1 <: AnyRef, S2 <: AnyRef, S3 <: AnyRef, S4 <: AnyRef](f: (S1, S2, S3, S4) ⇒ Unit)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[S1], arg1: ClassTag[S1], arg2: scala.reflect.api.JavaUniverse.TypeTag[S2], arg3: ClassTag[S2], arg4: scala.reflect.api.JavaUniverse.TypeTag[S3], arg5: ClassTag[S3], arg6: scala.reflect.api.JavaUniverse.TypeTag[S4], arg7: ClassTag[S4]): ServiceTracker[S1, S1]

    Permalink

    Definition Classes
    ServiceWatching
  52. def whenServicesPresent[S1 <: AnyRef, S2 <: AnyRef, S3 <: AnyRef](f: (S1, S2, S3) ⇒ Unit)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[S1], arg1: ClassTag[S1], arg2: scala.reflect.api.JavaUniverse.TypeTag[S2], arg3: ClassTag[S2], arg4: scala.reflect.api.JavaUniverse.TypeTag[S3], arg5: ClassTag[S3]): ServiceTracker[S1, S1]

    Permalink

    Definition Classes
    ServiceWatching
  53. def whenServicesPresent[S1 <: AnyRef, S2 <: AnyRef](f: (S1, S2) ⇒ Unit)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[S1], arg1: ClassTag[S1], arg2: scala.reflect.api.JavaUniverse.TypeTag[S2], arg3: ClassTag[S2]): ServiceTracker[S1, S1]

    Permalink

    Definition Classes
    ServiceWatching
  54. def withAdvancedService[S <: AnyRef, R](filter: String)(f: (Option[S]) ⇒ R)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[S], arg1: ClassTag[S]): R

    Permalink

    Executes the given handler with the first available service of the specified class which satisfies the filter if available.

    Executes the given handler with the first available service of the specified class which satisfies the filter if available. If it's not available, it still executes it but with None.

    When the handler returns, the service is released using org.osgi.framework.BundleContext#ungetService.

    S

    service type

    R

    function result type

    filter

    filter expression

    f

    handler that uses the service

    returns

    handler result

    Definition Classes
    ServiceConsuming
  55. def withService[S <: AnyRef, R](f: (Option[S]) ⇒ R)(implicit arg0: ClassTag[S]): R

    Permalink

    Executes the given handler with the highest-ranked service of the specified type.

    Executes the given handler with the highest-ranked service of the specified type. If it's not available, it still executes it but with None. Doesn't take type parameters into account!

    When the handler returns, the service is released using org.osgi.framework.BundleContext#ungetService.

    S

    service type

    R

    function result type

    f

    handler that uses the service

    returns

    handler result

    Definition Classes
    ServiceConsuming

Inherited from DominoActivator

Inherited from ServiceWatching

Inherited from ServiceProviding

Inherited from ServiceConsuming

Inherited from DominoImplicits

Inherited from ConfigurationWatching

Inherited from BundleWatching

Inherited from CapsuleConvenience

Inherited from OsgiContext

Inherited from EmptyBundleActivator

Inherited from BundleActivator

Inherited from DynamicCapsuleContext

Inherited from CapsuleContext

Inherited from AnyRef

Inherited from Any

Basics

Basic methods

Consume service references

Methods for obtaining access to OSGi service references

Consume services

Methods for obtaining access to OSGi services

Provide services

Functionality for exposing arbitrary objects in the OSGi service registry.

Wait for services

Methods for waiting until services become available

Watch bundles

Methods for reacting to bundle events

Watch configurations

Methods for listening to configuration updates

Watch factory configurations

Methods for listening to factory configuration additions, updates and removals

Watch services

Methods for reacting to service events

Ungrouped