Trait

eu.akkamo

Context

Related Doc: package akkamo

Permalink

trait Context extends AnyRef

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.

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

Abstract Value Members

  1. abstract def inject[T](key: String, strict: Boolean = false)(implicit ct: ClassTag[T]): Option[T]

    Permalink

    Injects service already registered in Akkamo context, using the key using which the service has been registered.

    Injects service already registered in Akkamo context, using the key using which the service has been registered. By default, if no service is found with this key, default service is returned (if available). To disable this behavior, set the strict parameter to false.

    T

    type of the service

    key

    additional mapping identifier

    strict

    if true, only named instance is returned if false then when nothing found under key then default instance is returned if it exists and is initialized

    ct

    class tag evidence

    returns

    implementation of interface T encapsulated in Some if exists else None

  2. abstract def inject[T](implicit ct: ClassTag[T]): Option[T]

    Permalink

    Injects service already registered as an default service in Akkamo context.

    Injects service already registered as an default service in Akkamo context.

    T

    type of the service

    ct

    Akkamo context

    returns

    implementation of interface T encapsulated in Some if exists else None

  3. abstract def register[T <: AnyRef](value: T, key: Option[String] = None)(implicit ct: ClassTag[T]): Context

    Permalink

    Registers service to the Akkamo context, such service is then available to any other module via one of the inject methods.

    Registers service to the Akkamo context, such service is then available to any other module via one of the inject methods. This method allows to register service with optional key, which is primarily used to disambiguate between multiple registered services of same type and must be then specified when injecting the service. Please note that because the Context is immutable, new updated instance will be returned after calling this method.

    T

    type of the service

    value

    service to register

    key

    optional key

    ct

    class tag evidence

    returns

    new updated instance of Context

  4. abstract def registerIn[T <: Registry[X], X](x: X, key: Option[String] = None)(implicit ct: ClassTag[T]): Context

    Permalink

    Registers value into service, specified by its type and optional key, previously registered to the Akkamo context.

    Registers value into service, specified by its type and optional key, previously registered to the Akkamo context. In fact, this serves as a shorthand for manually injecting the desired service from the context, and then registering the selected value into it.

    T

    type of previously registered service

    X

    type of value to be registered into the service

    x

    value to register

    key

    optional key, under which the service was previously registered into the context

    ct

    class tag evidence

    returns

    updated instance of immutable Context

    Annotations
    @throws( ... )
    Exceptions thrown

    ContextError if operation cannot be completed for various reasons

  5. abstract def registered[T <: AnyRef](implicit ct: ClassTag[T]): Map[T, Set[String]]

    Permalink

    Returns all registered instance of service of type T, as a map where key is instance of registered service and value is the set containing all keys, under the particular service instance was registered.

    Returns all registered instance of service of type T, as a map where key is instance of registered service and value is the set containing all keys, under the particular service instance was registered.

    T

    type of the service

    ct

    class tag evidence

    returns

    map of all registered instances of service of type T

Concrete 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. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. def get[T](key: String, strict: Boolean = false)(implicit ct: ClassTag[T]): T

    Permalink

    Get service already registered in Akkamo context, using the key using which the service has been registered.

    Get service already registered in Akkamo context, using the key using which the service has been registered. By default, if no service is found with this key, default service is returned (if available). To disable this behavior, set the strict parameter to false.

    T

    type of the service

    key

    additional mapping identifier

    strict

    if true, only named instance is returned if false then when nothing found under key then default instance is returned if it exists and is initialized

    ct

    class tag evidence

    returns

    implementation of interface T

    Annotations
    @throws( ... )
    Exceptions thrown

    ContextError if bean not exists

  10. def get[T](implicit ct: ClassTag[T]): T

    Permalink

    Get service already registered as an default service in Akkamo context.

    Get service already registered as an default service in Akkamo context.

    T

    type of the service

    ct

    Akkamo context

    returns

    implementation of interface T

    Annotations
    @throws( ... )
    Exceptions thrown

    ContextError if bean not exists

  11. final def getClass(): Class[_]

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  17. def register[T <: AnyRef](value: T, key: String)(implicit ct: ClassTag[T]): Context

    Permalink

    Registers service to the Akkamo context, such service is then available to any other module via one of the inject methods.

    Registers service to the Akkamo context, such service is then available to any other module via one of the inject methods. This method allows to register service with key, which is primarily used to disambiguate between multiple registered services of same type and must be then specified when injecting the service. Please note that because the Context is immutable, new updated instance will be returned after calling this method.

    T

    type of the service

    value

    service to register

    key

    optional key

    ct

    class tag evidence

    returns

    new updated instance of Context

  18. def registerIn[T <: Registry[X], X](x: X, key: String)(implicit ct: ClassTag[T]): Context

    Permalink

    Registers value into service, specified by its type and key, previously registered to the Akkamo context.

    Registers value into service, specified by its type and key, previously registered to the Akkamo context. In fact, this serves as a shorthand for manually injecting the desired service from the context, and then registering the selected value into it.

    T

    type of previously registered service

    X

    type of value to be registered into the service

    x

    value to register

    key

    optional key, under which the service was previously registered into the context

    ct

    class tag evidence

    returns

    updated instance of immutable Context

    Annotations
    @throws( ... )
    Exceptions thrown

    ContextError if operation cannot be completed for various reasons

  19. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped