interface BoundService<R : Any>
Interface for bound service entries in a Graph.
abstract val key: TypeKey<R>
The TypeKey of the type this service is providing. |
|
abstract val scope: Scope
A scope that is unique for this type of service e.g. Scope("myCustomScope"). |
abstract fun instance(): R
This is called every time an instance is requested from the Graph. |
|
abstract fun newInstance(): R
This is called when this instance is passed to Graph.evaluate to create a new instance. |
|
abstract fun onClose(): Unit
This is called for each BoundService in a Graph when Graph.close is called. |
|
abstract fun onPostConstruct(instance: R): Unit
This is called after a new instance was created but not until the complete dependency request is finished. |