sindi

Context

trait Context extends Context with Wirable with DSL with Composable

A context is a collection of bindings and modules, it contains operations to wire objects together.

When integrating modules into a host application, it's recommend to us this trait as a seemless integration layer with the container.

Embedded

When possible, integrating context as trait or class should be prefered (reusability is complete).

trait Application with Context {
  override lazy val modules = new UserServiceModule :: Nil
  def startup() = from[UserServiceModule].start()
}

// Scala Application
object Bootstrap extends App {
  new ApplicationContext{}.startup()
}

// Web Application
class WebApp extends Application {
  new ApplicationContext{}.startup()
}
Global

If the context need to be accessed globally it can be defined as singleton object.

import sindi._

object ApplicationContext {
  override lazy val modules = new UserServiceModule(this) :: Nil
  def startup() = from[UserServiceModule].start()
}

You can then create a base component linked with this context by extending the ComponentWith trait.

See also

ComponentContext, ComponentWith

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Context
  2. Composable
  3. DSL
  4. Wirable
  5. WirableTemplate
  6. Context
  7. Injector
  8. AnyRef
  9. Any
Visibility
  1. Public
  2. All

Type Members

  1. class Bind [T] extends Binder

    Attributes
    protected sealed abstract
  2. class BindSource [T] extends Binder

    Attributes
    protected
  3. trait Qualifiable [T] extends Bind[T]

    Attributes
    protected
  4. class QualifiedBind [T] extends Bind[T] with Scopable[T]

    Attributes
    protected
  5. trait Scopable [T] extends Bind[T]

    Attributes
    protected
  6. class ScopedBind [T] extends Bind[T]

    Attributes
    protected
  7. class SimpleBind [T] extends Bind[T] with Qualifiable[T] with Scopable[T]

    Attributes
    protected

Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  7. def autowire [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R] (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4], m5: Manifest[T5], m6: Manifest[T6], m7: Manifest[T7], m8: Manifest[T8], m9: Manifest[T9], m10: Manifest[T10], m11: Manifest[T11], m12: Manifest[T12], m13: Manifest[T13], m14: Manifest[T14], m15: Manifest[T15], m16: Manifest[T16], m17: Manifest[T17], m18: Manifest[T18], m19: Manifest[T19], m20: Manifest[T20], m21: Manifest[T21], m22: Manifest[T22]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  8. def autowire [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R] (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4], m5: Manifest[T5], m6: Manifest[T6], m7: Manifest[T7], m8: Manifest[T8], m9: Manifest[T9], m10: Manifest[T10], m11: Manifest[T11], m12: Manifest[T12], m13: Manifest[T13], m14: Manifest[T14], m15: Manifest[T15], m16: Manifest[T16], m17: Manifest[T17], m18: Manifest[T18], m19: Manifest[T19], m20: Manifest[T20], m21: Manifest[T21]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  9. def autowire [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R] (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4], m5: Manifest[T5], m6: Manifest[T6], m7: Manifest[T7], m8: Manifest[T8], m9: Manifest[T9], m10: Manifest[T10], m11: Manifest[T11], m12: Manifest[T12], m13: Manifest[T13], m14: Manifest[T14], m15: Manifest[T15], m16: Manifest[T16], m17: Manifest[T17], m18: Manifest[T18], m19: Manifest[T19], m20: Manifest[T20]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  10. def autowire [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R] (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4], m5: Manifest[T5], m6: Manifest[T6], m7: Manifest[T7], m8: Manifest[T8], m9: Manifest[T9], m10: Manifest[T10], m11: Manifest[T11], m12: Manifest[T12], m13: Manifest[T13], m14: Manifest[T14], m15: Manifest[T15], m16: Manifest[T16], m17: Manifest[T17], m18: Manifest[T18], m19: Manifest[T19]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  11. def autowire [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R] (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4], m5: Manifest[T5], m6: Manifest[T6], m7: Manifest[T7], m8: Manifest[T8], m9: Manifest[T9], m10: Manifest[T10], m11: Manifest[T11], m12: Manifest[T12], m13: Manifest[T13], m14: Manifest[T14], m15: Manifest[T15], m16: Manifest[T16], m17: Manifest[T17], m18: Manifest[T18]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  12. def autowire [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R] (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4], m5: Manifest[T5], m6: Manifest[T6], m7: Manifest[T7], m8: Manifest[T8], m9: Manifest[T9], m10: Manifest[T10], m11: Manifest[T11], m12: Manifest[T12], m13: Manifest[T13], m14: Manifest[T14], m15: Manifest[T15], m16: Manifest[T16], m17: Manifest[T17]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  13. def autowire [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R] (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4], m5: Manifest[T5], m6: Manifest[T6], m7: Manifest[T7], m8: Manifest[T8], m9: Manifest[T9], m10: Manifest[T10], m11: Manifest[T11], m12: Manifest[T12], m13: Manifest[T13], m14: Manifest[T14], m15: Manifest[T15], m16: Manifest[T16]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  14. def autowire [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R] (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4], m5: Manifest[T5], m6: Manifest[T6], m7: Manifest[T7], m8: Manifest[T8], m9: Manifest[T9], m10: Manifest[T10], m11: Manifest[T11], m12: Manifest[T12], m13: Manifest[T13], m14: Manifest[T14], m15: Manifest[T15]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  15. def autowire [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R] (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4], m5: Manifest[T5], m6: Manifest[T6], m7: Manifest[T7], m8: Manifest[T8], m9: Manifest[T9], m10: Manifest[T10], m11: Manifest[T11], m12: Manifest[T12], m13: Manifest[T13], m14: Manifest[T14]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  16. def autowire [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R] (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4], m5: Manifest[T5], m6: Manifest[T6], m7: Manifest[T7], m8: Manifest[T8], m9: Manifest[T9], m10: Manifest[T10], m11: Manifest[T11], m12: Manifest[T12], m13: Manifest[T13]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  17. def autowire [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R] (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4], m5: Manifest[T5], m6: Manifest[T6], m7: Manifest[T7], m8: Manifest[T8], m9: Manifest[T9], m10: Manifest[T10], m11: Manifest[T11], m12: Manifest[T12]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  18. def autowire [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R] (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4], m5: Manifest[T5], m6: Manifest[T6], m7: Manifest[T7], m8: Manifest[T8], m9: Manifest[T9], m10: Manifest[T10], m11: Manifest[T11]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  19. def autowire [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R] (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4], m5: Manifest[T5], m6: Manifest[T6], m7: Manifest[T7], m8: Manifest[T8], m9: Manifest[T9], m10: Manifest[T10]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  20. def autowire [T1, T2, T3, T4, T5, T6, T7, T8, T9, R] (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4], m5: Manifest[T5], m6: Manifest[T6], m7: Manifest[T7], m8: Manifest[T8], m9: Manifest[T9]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  21. def autowire [T1, T2, T3, T4, T5, T6, T7, T8, R] (f: (T1, T2, T3, T4, T5, T6, T7, T8) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4], m5: Manifest[T5], m6: Manifest[T6], m7: Manifest[T7], m8: Manifest[T8]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  22. def autowire [T1, T2, T3, T4, T5, T6, T7, R] (f: (T1, T2, T3, T4, T5, T6, T7) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4], m5: Manifest[T5], m6: Manifest[T6], m7: Manifest[T7]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  23. def autowire [T1, T2, T3, T4, T5, T6, R] (f: (T1, T2, T3, T4, T5, T6) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4], m5: Manifest[T5], m6: Manifest[T6]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  24. def autowire [T1, T2, T3, T4, T5, R] (f: (T1, T2, T3, T4, T5) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4], m5: Manifest[T5]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  25. def autowire [T1, T2, T3, T4, R] (f: (T1, T2, T3, T4) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3], m4: Manifest[T4]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  26. def autowire [T1, T2, T3, R] (f: (T1, T2, T3) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2], m3: Manifest[T3]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  27. def autowire [T1, T2, R] (f: (T1, T2) ⇒ R)(implicit m1: Manifest[T1], m2: Manifest[T2]): R

    Attributes
    final
    Definition Classes
    WirableTemplate
  28. def autowire [T, R] (f: (T) ⇒ R)(implicit arg0: Manifest[T]): R

    Autowire given function.

    Autowire given function.

    Attributes
    final
    Definition Classes
    WirableTemplate
  29. def bind [T] (implicit arg0: Manifest[T]): BindSource[T]

    Start a new binding declaration.

    Start a new binding declaration.

    Definition Classes
    DSL
  30. implicit def bind2binding [T] (bind: Bind[T])(implicit arg0: Manifest[T]): Binding[T]

    Attributes
    protected implicit
    Definition Classes
    DSL
  31. implicit def bind2bindings [T] (bind: Bind[T])(implicit arg0: Manifest[T]): Bindings

    Attributes
    protected implicit
    Definition Classes
    DSL
  32. val bindings : Bindings

    Return the bindings associated with this context.

    Return the bindings associated with this context.

    Attributes
    protected
    Definition Classes
    Context
  33. def bounds : Seq[()]

    Attributes
    protected
    Definition Classes
    Context
  34. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  35. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  36. def equals (arg0: Any): Boolean

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

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  38. def from [M <: Module] (implicit arg0: Manifest[M]): M

    Return an imported module for a given module's type.

    Return an imported module for a given module's type.

    Definition Classes
    ContextComposable
  39. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  40. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  41. implicit val implicit : Context

    This context as implicit value to ease modules integration.

    This context as implicit value to ease modules integration.

    Attributes
    implicit
  42. def inject [T] (implicit arg0: Manifest[T]): T

    Return the object associated with a given type.

    Return the object associated with a given type.

    Attributes
    final
    Definition Classes
    Injector
  43. def injectAll [T] (qualifiers: Qualifiers)(implicit arg0: Manifest[T]): Stream[T]

    Return all objects associated with a given type and qualifiers.

    Return all objects associated with a given type and qualifiers.

    Attributes
    final
    Definition Classes
    Injector
  44. def injectAll [T] (implicit arg0: Manifest[T]): Stream[T]

    Return all objects associated with a given type.

    Return all objects associated with a given type.

    Attributes
    final
    Definition Classes
    Injector
  45. def injectAs [T] (qualifiers: Qualifiers)(implicit arg0: Manifest[T]): T

    Return the object associated with a given type and qualifiers.

    Return the object associated with a given type and qualifiers.

    Attributes
    final
    Definition Classes
    Injector
  46. def injection [T] (implicit arg0: Manifest[T]): Injection[T]

    Return the injection associated with a given type.

    Return the injection associated with a given type.

    Attributes
    final
    Definition Classes
    Injector
  47. def injectionAll [T] (qualifiers: Qualifiers)(implicit arg0: Manifest[T]): Stream[Injection[T]]

    Return all injections associated with a given type and qualifiers.

    Return all injections associated with a given type and qualifiers.

    Definition Classes
    ContextInjector
  48. def injectionAll [T] (implicit arg0: Manifest[T]): Stream[Injection[T]]

    Return all injections associated with a given type.

    Return all injections associated with a given type.

    Attributes
    final
    Definition Classes
    Injector
  49. def injectionAs [T] (qualifiers: Qualifiers)(implicit arg0: Manifest[T]): Injection[T]

    Return the injection associated with a given type and qualifiers.

    Return the injection associated with a given type and qualifiers.

    Definition Classes
    ContextInjector
  50. lazy val injector : Injector

    Return the injector associated with this context.

    Return the injector associated with this context.

    Definition Classes
    Context
  51. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  52. lazy val modules : Modules

    Return the list of Module associated with this context.

    Return the list of Module associated with this context.

    Attributes
    protected
  53. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  54. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  55. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  56. def processing : List[sindi.processor.Processor[_]]

    Attributes
    protected
    Definition Classes
    Context
  57. def processors : List[sindi.processor.Processor[_]]

    Return the processors associated with this context.

    Return the processors associated with this context.

    Definition Classes
    ContextContext
  58. def provider [T] (injection: ⇒ T)(implicit arg0: Manifest[T]): Provider[T]

    Return a provider with the specified function *

    Return a provider with the specified function *

    Definition Classes
    DSL
  59. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  60. def toString (): String

    Definition Classes
    AnyRef → Any
  61. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  64. def wire [T] (implicit arg0: Manifest[T]): Option[T]

    Attributes
    protected
    Definition Classes
    ContextWirable

Inherited from Composable

Inherited from DSL

Inherited from Wirable

Inherited from WirableTemplate

Inherited from Context

Inherited from Injector

Inherited from AnyRef

Inherited from Any