DesignWithContext

class DesignWithContext[A](design: Design, lastSurface: Surface) extends Design

DesignWithContext[A] is a wrapper of Design class for chaining lifecycle hooks for the same type A. This can be safely cast to just Design

class Design
trait LogSupport
trait LazyLogger
trait LoggingMethods
trait Serializable
class Object
trait Matchable
class Any

Value members

Concrete methods

def afterStart(body: A => Unit): DesignWithContext[A]
def beforeShutdown(body: A => Unit): DesignWithContext[A]
def onInit(body: A => Unit): DesignWithContext[A]
def onInject(body: A => Unit): DesignWithContext[A]
def onShutdown(body: A => Unit): DesignWithContext[A]
def onStart(body: A => Unit): DesignWithContext[A]

Inherited methods

def +(other: Design): Design
Inherited from:
Design
def add(other: Design): Design
Inherited from:
Design
Inherited from:
Design
def bind(t: Surface)(implicit sourceCode: SourceCode): Binder[Any]
Inherited from:
Design
inline def bind[A]: Binder[A]
Inherited from:
DesignImpl (hidden)
inline def build[A](body: A => Any): Any

A helper method of creating a new session and an instance of A. This method is useful when you only need to use A as an entry point of your program. After executing the body, the sesion will be closed.

A helper method of creating a new session and an instance of A. This method is useful when you only need to use A as an entry point of your program. After executing the body, the sesion will be closed.

Inherited from:
DesignImpl (hidden)
def canEqual(other: Any): Boolean
Inherited from:
Design
inline protected def debug(inline message: Any, inline cause: Throwable): Unit
Inherited from:
LoggingMethods
inline protected def debug(inline message: Any): Unit
Inherited from:
LoggingMethods
override def equals(other: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Value parameters:
that

the object to compare against this object for equality.

Returns:

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
Design -> Any
Inherited from:
Design
inline protected def error(inline message: Any, inline cause: Throwable): Unit
Inherited from:
LoggingMethods
inline protected def error(inline message: Any): Unit
Inherited from:
LoggingMethods
override def hashCode(): Int

Calculate a hash code value for the object.

Calculate a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

Returns:

the hash code value for this object.

Definition Classes
Design -> Any
Inherited from:
Design
inline protected def info(inline message: Any, inline cause: Throwable): Unit
Inherited from:
LoggingMethods
inline protected def info(inline message: Any): Unit
Inherited from:
LoggingMethods
inline protected def logAt(inline logLevel: LogLevel, inline message: Any): Unit
Inherited from:
LoggingMethods

Generates a minimized design by removing overwritten bindings

Generates a minimized design by removing overwritten bindings

Inherited from:
Design

Create a new session.

Create a new session.

With this method, the session will not start automatically. You need to explicitly call session.start and session.shutdown to start/terminate the lifecycle of objects

Inherited from:
Design

Method for configuring the session in details

Method for configuring the session in details

Inherited from:
Design
Inherited from:
Design
Inherited from:
Design
Inherited from:
Design
def remove(t: Surface): Design
Inherited from:
Design
inline def remove[A]: Design
Inherited from:
DesignImpl (hidden)
inline def run[A, B](body: A => B): B

Execute a given code block by building A using this design, and return B

Execute a given code block by building A using this design, and return B

Inherited from:
DesignImpl (hidden)

Used for casting itself as Design if returning DesignWithContext type is cumbersome

Used for casting itself as Design if returning DesignWithContext type is cumbersome

Inherited from:
Design
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Returns:

a string representation of the object.

Definition Classes
Design -> Any
Inherited from:
Design
inline protected def trace(inline message: Any, inline cause: Throwable): Unit
Inherited from:
LoggingMethods
inline protected def trace(inline message: Any): Unit
Inherited from:
LoggingMethods
inline protected def warn(inline message: Any, inline cause: Throwable): Unit
Inherited from:
LoggingMethods
inline protected def warn(inline message: Any): Unit
Inherited from:
LoggingMethods

Do not initialize singletons for debugging

Do not initialize singletons for debugging

Inherited from:
Design

Enable eager initialization of singletons services for production mode

Enable eager initialization of singletons services for production mode

Inherited from:
Design
def withSession[U](body: Session => U): U

Run the code block with a new session.

Run the code block with a new session.

This method will create a new session, start it, run the given code block, and finally terminate the session after the code block completion.

Inherited from:
Design
def withStats(stats: DIStats): Design
Inherited from:
Design

Use a custom binding tracer

Use a custom binding tracer

Inherited from:
Design