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 DesignImpl
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
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
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
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
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
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

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
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