Packages

  • package root
    Definition Classes
    root
  • package play

    Play framework.

    Play framework.

    Play

    http://www.playframework.com

    Definition Classes
    root
  • package api

    Contains the public API for Scala developers.

    Contains the public API for Scala developers.

    Access the current Play application
    import play.api.Play.current
    Read configuration
    val poolSize = configuration.getInt("engine.pool.size")
    Use the logger
    Logger.info("Hello!")
    Define a Plugin
    class MyPlugin(app: Application) extends Plugin
    Create adhoc applications (for testing)
    val application = Application(new File("."), this.getClass.getClassloader, None, Play.Mode.DEV)
    Definition Classes
    play
  • package inject

    Play's runtime dependency injection abstraction.

    Play's runtime dependency injection abstraction.

    Play's runtime dependency injection support is built on JSR-330, which provides a specification for declaring how dependencies get wired to components. JSR-330 however does not address how components are provided to or located by a DI container. Play's API seeks to address this in a DI container agnostic way.

    The reason for providing this abstraction is so that Play, the modules it provides, and third party modules can all express their bindings in a way that is not specific to any one DI container.

    Components are bound in the DI container. Each binding is identified by a BindingKey, which is typically an interface that the component implements, and may be optionally qualified by a JSR-330 qualifier annotation. A binding key is bound to a BindingTarget, which describes how the implementation of the interface that the binding key represents is constructed or provided. Bindings may also be scoped using JSR-330 scope annotations.

    Bindings are provided by instances of Module.

    Out of the box, Play provides an implementation of this abstraction using Guice.

    Definition Classes
    api
    See also

    The Module class for information on how to provide bindings.

  • package guice
    Definition Classes
    inject
  • ApplicationLifecycle
  • Binding
  • BindingKey
  • BindingKeyTarget
  • BindingTarget
  • BuiltinModule
  • ConfigProvider
  • ConfigurationProvider
  • ConstructionTarget
  • DefaultApplicationLifecycle
  • Injector
  • Module
  • Modules
  • NewInstanceInjector
  • ProviderConstructionTarget
  • ProviderTarget
  • QualifierAnnotation
  • QualifierClass
  • QualifierInstance
  • RoutesProvider
  • SimpleInjector
  • SimpleModule
c

play.api.inject

Binding

final case class Binding[T](key: BindingKey[T], target: Option[BindingTarget[T]], scope: Option[Class[_ <: Annotation]], eager: Boolean, source: AnyRef) extends Product with Serializable

A binding.

Bindings are used to bind classes, optionally qualified by a JSR-330 qualifier annotation, to instances, providers or implementation classes.

Bindings may also specify a JSR-330 scope. If, and only if that scope is javax.inject.Singleton, then the binding may declare itself to be eagerly instantiated. In which case, it should be eagerly instantiated when Play starts up.

key

The binding key.

target

The binding target.

scope

The JSR-330 scope.

eager

Whether the binding should be eagerly instantiated.

source

Where this object was bound. Used in error reporting.

Source
Binding.scala
See also

The Module class for information on how to provide bindings.

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Binding
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Binding(key: BindingKey[T], target: Option[BindingTarget[T]], scope: Option[Class[_ <: Annotation]], eager: Boolean, source: AnyRef)

    key

    The binding key.

    target

    The binding target.

    scope

    The JSR-330 scope.

    eager

    Whether the binding should be eagerly instantiated.

    source

    Where this object was bound. Used in error reporting.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def asJava: inject.Binding[T]
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  7. val eager: Boolean
  8. def eagerly(): Binding[T]

    Eagerly instantiate this binding when Play starts up.

  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def in[A <: Annotation](implicit arg0: ClassTag[A]): Binding[T]

    Configure the scope for this binding.

  13. def in[A <: Annotation](scope: Class[A]): Binding[T]

    Configure the scope for this binding.

  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. val key: BindingKey[T]
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. val scope: Option[Class[_ <: Annotation]]
  20. val source: AnyRef
  21. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  22. val target: Option[BindingTarget[T]]
  23. def toString(): String
    Definition Classes
    Binding → AnyRef → Any
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped