@Contract
public interface InjectionManager
| Modifier and Type | Method and Description |
|---|---|
<T> T |
createManagedObject(Class<T> clazz)
Create a managed object for the given class.
|
<T> T |
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 |
inject(Class clazz,
Object instance,
com.sun.enterprise.deployment.JndiNameEnvironment envDescriptor,
String componentId,
boolean invokePostConstruct)
Perform injection.
|
void |
injectClass(Class clazz,
com.sun.enterprise.deployment.JndiNameEnvironment componentEnv)
Inject the injectable resources from the given component environment
into a Class instance.
|
void |
injectClass(Class clazz,
com.sun.enterprise.deployment.JndiNameEnvironment componentEnv,
boolean invokePostConstruct)
Inject the injectable resources from the given component environment
into a Class instance.
|
void |
injectClass(Class clazz,
String componentId,
boolean invokePostConstruct)
Inject the injectable resources from the given component id
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,
com.sun.enterprise.deployment.JndiNameEnvironment componentEnv)
Inject the injectable resources from the given component environment
into an object instance.
|
void |
injectInstance(Object instance,
com.sun.enterprise.deployment.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,
com.sun.enterprise.deployment.JndiNameEnvironment componentEnv)
Invoke any static @PreDestroy methods defined on the class
(and super-classes).
|
void |
invokeInstancePostConstruct(Object instance,
com.sun.enterprise.deployment.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,
boolean validate)
Invoke any @PreDestroy methods defined on the instance's class
(and super-classes).
|
void |
invokeInstancePreDestroy(Object instance,
com.sun.enterprise.deployment.JndiNameEnvironment componentEnv)
Invoke any @PreDestroy methods defined on the instance's class
(and super-classes).
|
void injectInstance(Object instance) throws InjectionException
InjectionException - Thrown if an error occurs during injectionvoid injectInstance(Object instance, boolean invokePostConstruct) throws InjectionException
InjectionException - Thrown if an error occurs during injectionvoid injectInstance(Object instance, com.sun.enterprise.deployment.JndiNameEnvironment componentEnv) throws InjectionException
InjectionException - Thrown if an error occurs during injectionvoid injectInstance(Object instance, com.sun.enterprise.deployment.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 injectionvoid 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 injectionvoid injectClass(Class clazz, String componentId, 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 injectionvoid injectClass(Class clazz, com.sun.enterprise.deployment.JndiNameEnvironment componentEnv) throws InjectionException
InjectionException - Thrown if an error occurs during injectionvoid injectClass(Class clazz, com.sun.enterprise.deployment.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 injectionvoid invokeInstancePreDestroy(Object instance) throws InjectionException
InjectionException - Thrown if an error occursvoid invokeInstancePreDestroy(Object instance, boolean validate) throws InjectionException
validate - if false, do nothing if the instance is not registeredInjectionException - Thrown if an error occursvoid invokeInstancePreDestroy(Object instance, com.sun.enterprise.deployment.JndiNameEnvironment componentEnv) throws InjectionException
InjectionException - Thrown if an error occursvoid invokeInstancePostConstruct(Object instance, com.sun.enterprise.deployment.JndiNameEnvironment componentEnv) throws InjectionException
InjectionException - Thrown if an error occursvoid invokeClassPreDestroy(Class clazz, com.sun.enterprise.deployment.JndiNameEnvironment componentEnv) throws InjectionException
InjectionException - Thrown if an error occurs<T> T createManagedObject(Class<T> clazz) throws InjectionException
clazz - Class to be instantiatedInjectionException<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.InjectionExceptionvoid destroyManagedObject(Object managedObject) throws InjectionException
managedObject - InjectionExceptionvoid destroyManagedObject(Object managedObject, boolean validate) throws InjectionException
managedObject - validate - if false the object might not been created by createManagedObject() callInjectionExceptionvoid inject(Class clazz, Object instance, com.sun.enterprise.deployment.JndiNameEnvironment envDescriptor, String componentId, boolean invokePostConstruct) throws InjectionException
clazz - The class of the instance to perform injection. This is needed b/c of static injection.instance - The instance on which to perform injection.envDescriptor - The descriptor containing the injection information.componentId - The id of the component in whose jndi environment injection actually occurs. Null indicates
the current jndi environment.invokePostConstruct - if true, invoke any @PostConstruct methodsInjectionExceptionCopyright © 2017. All rights reserved.