|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@Contract public interface InjectionManager
InjectionManager provides runtime resource injection(@Resource, @EJB, etc.) and generic callback(PostConstruct/PreDestroy) services It performs the actual injection into the fields and methods of designated J2EE 5 component instances and managed class instances. The decision as to when injection takes place is determined by the caller.
| Method Summary | ||
|---|---|---|
|
createManagedObject(Class<T> clazz)
Create a managed object for the given class. |
|
|
createManagedObject(Class<T> clazz,
boolean invokePostConstruct)
Create a managed object for the given class. |
|
void |
destroyManagedObject(Object managedObject)
Destroy a managed object that was created via createManagedObject. |
|
void |
destroyManagedObject(Object managedObject,
boolean validate)
Destroy a managed object that may have been created via createManagedObject. |
|
void |
injectClass(Class clazz,
JndiNameEnvironment componentEnv)
Inject the injectable resources from the given component environment into a Class instance. |
|
void |
injectClass(Class clazz,
JndiNameEnvironment componentEnv,
boolean invokePostConstruct)
Inject the injectable resources from the given component environment into a Class instance. |
|
void |
injectInstance(Object instance)
Inject the given object instance with the resources from its component environment. |
|
void |
injectInstance(Object instance,
boolean invokePostConstruct)
Inject the given object instance with the resources from its component environment. |
|
void |
injectInstance(Object instance,
JndiNameEnvironment componentEnv)
Inject the injectable resources from the given component environment into an object instance. |
|
void |
injectInstance(Object instance,
JndiNameEnvironment componentEnv,
boolean invokePostConstruct)
Inject the injectable resources from the given component environment into an object instance. |
|
void |
injectInstance(Object instance,
String componentId,
boolean invokePostConstruct)
Inject the injectable resources for the given component id into an object instance. |
|
void |
invokeClassPreDestroy(Class clazz,
JndiNameEnvironment componentEnv)
Invoke any static @PreDestroy methods defined on the class (and super-classes). |
|
void |
invokeInstancePostConstruct(Object instance,
JndiNameEnvironment componentEnv)
Invoke any @PostConstruct methods defined on the instance's class (and super-classes). |
|
void |
invokeInstancePreDestroy(Object instance)
Invoke any @PreDestroy methods defined on the instance's class (and super-classes). |
|
void |
invokeInstancePreDestroy(Object instance,
JndiNameEnvironment componentEnv)
Invoke any @PreDestroy methods defined on the instance's class (and super-classes). |
|
| Method Detail |
|---|
void injectInstance(Object instance)
throws InjectionException
InjectionException - Thrown if an error occurs during injection
void injectInstance(Object instance,
boolean invokePostConstruct)
throws InjectionException
InjectionException - Thrown if an error occurs during injection
void injectInstance(Object instance,
JndiNameEnvironment componentEnv)
throws InjectionException
InjectionException - Thrown if an error occurs during injection
void injectInstance(Object instance,
JndiNameEnvironment componentEnv,
boolean invokePostConstruct)
throws InjectionException
invokePostConstruct - if true, invoke any @PostConstruct methods
on the instance's class(and super-classes) after injection.
InjectionException - Thrown if an error occurs during injection
void injectInstance(Object instance,
String componentId,
boolean invokePostConstruct)
throws InjectionException
invokePostConstruct - if true, invoke any @PostConstruct methods
on the instance's class(and super-classes) after injection.
InjectionException - Thrown if an error occurs during injection
void injectClass(Class clazz,
JndiNameEnvironment componentEnv)
throws InjectionException
InjectionException - Thrown if an error occurs during injection
void injectClass(Class clazz,
JndiNameEnvironment componentEnv,
boolean invokePostConstruct)
throws InjectionException
invokePostConstruct - if true, invoke any @PostConstruct methods
on the class(and super-classes) after injection.
InjectionException - Thrown if an error occurs during injection
void invokeInstancePreDestroy(Object instance)
throws InjectionException
InjectionException - Thrown if an error occurs
void invokeInstancePreDestroy(Object instance,
JndiNameEnvironment componentEnv)
throws InjectionException
InjectionException - Thrown if an error occurs
void invokeInstancePostConstruct(Object instance,
JndiNameEnvironment componentEnv)
throws InjectionException
InjectionException - Thrown if an error occurs
void invokeClassPreDestroy(Class clazz,
JndiNameEnvironment componentEnv)
throws InjectionException
InjectionException - Thrown if an error occurs
<T> T createManagedObject(Class<T> clazz)
throws InjectionException
clazz - Class to be instantiated
InjectionException
<T> T createManagedObject(Class<T> clazz,
boolean invokePostConstruct)
throws InjectionException
clazz - Class to be instantiatedinvokePostConstruct - if true, invoke any @PostConstruct methods
on the instance's class(and super-classes) after injection.
InjectionException
void destroyManagedObject(Object managedObject)
throws InjectionException
managedObject -
InjectionException
void destroyManagedObject(Object managedObject,
boolean validate)
throws InjectionException
managedObject - validate - if false the object might not been created by createManagedObject() call
InjectionException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||