|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cayenne.di.spi.DefaultInjector
public class DefaultInjector
A default Cayenne implementations of a DI injector.
| Constructor Summary | |
|---|---|
DefaultInjector(Module... modules)
|
|
| 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. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultInjector(Module... modules)
throws ConfigurationException
ConfigurationException| Method Detail |
|---|
public <T> T getInstance(java.lang.Class<T> type)
throws ConfigurationException
InjectorConfigurationException if the type is not bound, or an instance can not be
created.
getInstance in interface InjectorConfigurationException
public <T> T getInstance(Key<T> key)
throws ConfigurationException
InjectorConfigurationException if the key is not bound, or an instance can
not be created.
getInstance in interface InjectorConfigurationException
public <T> Provider<T> getProvider(java.lang.Class<T> type)
throws ConfigurationException
getProvider in interface InjectorConfigurationException
public <T> Provider<T> getProvider(Key<T> key)
throws ConfigurationException
getProvider in interface InjectorConfigurationExceptionpublic void injectMembers(java.lang.Object object)
Injector
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.
injectMembers in interface Injectorpublic void shutdown()
Injector
shutdown in interface Injector
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||