|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Injector
A facade to the Cayenne DI container. To create an injector use DIBootstrap
static methods.
Method Summary | ||
---|---|---|
|
getInstance(java.lang.Class<T> type)
Returns a service instance bound in the container for a specific type. |
|
|
getInstance(Key<T> key)
Returns a service instance bound in the container for a specific binding key. |
|
|
getProvider(java.lang.Class<T> type)
|
|
|
getProvider(Key<T> key)
|
|
void |
injectMembers(java.lang.Object object)
Performs field injection on a given object, ignoring constructor injection. |
|
void |
shutdown()
A lifecycle method that let's the injector's services to clean up their state and release resources. |
Method Detail |
---|
<T> T getInstance(java.lang.Class<T> type) throws ConfigurationException
ConfigurationException
if the type is not bound, or an instance can not be
created.
ConfigurationException
<T> T getInstance(Key<T> key) throws ConfigurationException
ConfigurationException
if the key is not bound, or an instance can
not be created.
ConfigurationException
<T> Provider<T> getProvider(java.lang.Class<T> type) throws ConfigurationException
ConfigurationException
<T> Provider<T> getProvider(Key<T> key) throws ConfigurationException
ConfigurationException
void injectMembers(java.lang.Object object)
Note that using this method inside a custom DI Provider
will most likely
result in double injection, as custom provider is wrapped in a field-injecting
provider by the DI container. Instead custom providers must initialize object
properties manually, obtaining dependencies from Injector.
void shutdown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |