|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjfun.yan.etc.InjectorHelper
public class InjectorHelper
This class provides helper functions to help dependency injections on objects not created by Yan.
| Constructor Summary | |
|---|---|
InjectorHelper()
|
|
| Method Summary | |
|---|---|
static Component |
getInjectorComponent(java.lang.Class injector_itf,
Binder binder)
To create a Component object that will instantiate an object that implements a certain injector interface. |
static Component |
getProxyComponentReturningInjected(java.lang.Class itf,
Component proxied,
java.lang.Class injectee_type,
Binder binder)
To create a Component that instantiates proxy. |
static Component |
getProxyComponentReturningInjected(java.lang.ClassLoader cloader,
java.lang.Class itf,
Component proxied,
java.lang.Class injectee_type,
Binder binder)
To create a Component that instantiates proxy. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InjectorHelper()
| Method Detail |
|---|
public static Component getInjectorComponent(java.lang.Class injector_itf,
Binder binder)
The injector interface should describe at least one method that expects one and only one parameter object. This method is responsible for injecting dependencies into this parameter object.
The injection logic is encapsulated in a Binder object.
injector_itf - The injector interface class.binder - the Binder object encapsulating the dependency injection logic.
public static Component getProxyComponentReturningInjected(java.lang.ClassLoader cloader,
java.lang.Class itf,
Component proxied,
java.lang.Class injectee_type,
Binder binder)
The proxy object is responsible for injecting dependencies into return values from the proxied methods.
The dependency injection logic is described by the binder object.
The instance instantiated by the proxied Component is proxied.
Only the dependencies of return values of injectee_type are injected.
cloader - The ClassLoader used by the dynamic proxy.itf - the interface that the proxy implements.proxied - the Component that instantiates the proxied object.injectee_type - only return values of this type gets injected.binder - this object encapsulates the injection logic.
public static Component getProxyComponentReturningInjected(java.lang.Class itf,
Component proxied,
java.lang.Class injectee_type,
Binder binder)
The proxy object is responsible for injecting dependencies into return values from the proxied methods.
The dependency injection logic is described by the binder object.
The instance instantiated by the proxied Component is proxied.
Only the dependencies of return values of injectee_type are injected.
The ClassLoader that loads the proxied instance is used to load the dynamic proxy.
itf - the interface that the proxy implements.proxied - the Component that instantiates the proxied object.injectee_type - only return values of this type gets injected.binder - this object encapsulates the injection logic.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||