com.google.inject.spi.ProvisionListener |
Listens for provisioning of objects. Useful for gathering timing information about provisioning, post-provision initialization, and more.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ProvisionListener.ProvisionInvocation<T> | Encapsulates a single act of provisioning. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Invoked by Guice when an object requires provisioning.
|
Invoked by Guice when an object requires provisioning. Provisioning occurs
when Guice locates and injects the dependencies for a binding. For types
bound to a Provider, provisioning encapsulates the get()
method. For other types, provisioning encapsulates the construction of the
object. If a type is bound within a Scope
, provisioning depends on
the scope. Types bound in Singleton scope will only be provisioned once.
Types bound in no scope will be provisioned every time they are injected.
Other scopes define their own behavior for provisioning.
To perform the provision, call provision()
.
If you do not explicitly call provision, it will be automatically done after
this method returns. It is an error to call provision more than once.