@Service public class InjectionManagerImpl extends Object implements InjectionManager, org.glassfish.hk2.api.PostConstruct
| Constructor and Description |
|---|
InjectionManagerImpl() |
| 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 was 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 |
postConstruct() |
public void postConstruct()
postConstruct in interface org.glassfish.hk2.api.PostConstructpublic void injectInstance(Object instance) throws InjectionException
InjectionManagerinjectInstance in interface InjectionManagerInjectionException - Thrown if an error occurs during injectionpublic void injectInstance(Object instance, boolean invokePostConstruct) throws InjectionException
InjectionManagerinjectInstance in interface InjectionManagerInjectionException - Thrown if an error occurs during injectionpublic void injectInstance(Object instance, com.sun.enterprise.deployment.JndiNameEnvironment componentEnv) throws InjectionException
InjectionManagerinjectInstance in interface InjectionManagerInjectionException - Thrown if an error occurs during injectionpublic void injectInstance(Object instance, com.sun.enterprise.deployment.JndiNameEnvironment componentEnv, boolean invokePostConstruct) throws InjectionException
InjectionManagerinjectInstance in interface InjectionManagerinvokePostConstruct - if true, invoke any @PostConstruct methods
on the instance's class(and super-classes) after injection.InjectionException - Thrown if an error occurs during injectionpublic void injectInstance(Object instance, String componentId, boolean invokePostConstruct) throws InjectionException
InjectionManagerinjectInstance in interface InjectionManagerinvokePostConstruct - if true, invoke any @PostConstruct methods
on the instance's class(and super-classes) after injection.InjectionException - Thrown if an error occurs during injectionpublic void injectClass(Class clazz, String componentId, boolean invokePostConstruct) throws InjectionException
InjectionManagerinjectClass in interface InjectionManagerinvokePostConstruct - if true, invoke any @PostConstruct methods
on the class(and super-classes) after injection.InjectionException - Thrown if an error occurs during injectionpublic void injectClass(Class clazz, com.sun.enterprise.deployment.JndiNameEnvironment componentEnv) throws InjectionException
InjectionManagerinjectClass in interface InjectionManagerInjectionException - Thrown if an error occurs during injectionpublic void injectClass(Class clazz, com.sun.enterprise.deployment.JndiNameEnvironment componentEnv, boolean invokePostConstruct) throws InjectionException
InjectionManagerinjectClass in interface InjectionManagerinvokePostConstruct - if true, invoke any @PostConstruct methods
on the class(and super-classes) after injection.InjectionException - Thrown if an error occurs during injectionpublic void invokeInstancePreDestroy(Object instance, com.sun.enterprise.deployment.JndiNameEnvironment componentEnv) throws InjectionException
InjectionManagerinvokeInstancePreDestroy in interface InjectionManagerInjectionException - Thrown if an error occurspublic void invokeInstancePostConstruct(Object instance, com.sun.enterprise.deployment.JndiNameEnvironment componentEnv) throws InjectionException
InjectionManagerinvokeInstancePostConstruct in interface InjectionManagerInjectionException - Thrown if an error occurspublic void invokeInstancePreDestroy(Object instance) throws InjectionException
InjectionManagerinvokeInstancePreDestroy in interface InjectionManagerInjectionException - Thrown if an error occurspublic void invokeInstancePreDestroy(Object instance, boolean validate) throws InjectionException
InjectionManagerinvokeInstancePreDestroy in interface InjectionManagervalidate - if false, do nothing if the instance is not registeredInjectionException - Thrown if an error occurspublic void invokeClassPreDestroy(Class clazz, com.sun.enterprise.deployment.JndiNameEnvironment componentEnv) throws InjectionException
InjectionManagerinvokeClassPreDestroy in interface InjectionManagerInjectionException - Thrown if an error occurspublic <T> T createManagedObject(Class<T> clazz) throws InjectionException
createManagedObject in interface InjectionManagerclazz - Class to be instantiatedInjectionExceptionpublic <T> T createManagedObject(Class<T> clazz, boolean invokePostConstruct) throws InjectionException
createManagedObject in interface InjectionManagerclazz - Class to be instantiatedinvokePostConstruct - if true, invoke any @PostConstruct methods
on the instance's class(and super-classes) after injection.InjectionExceptionpublic void destroyManagedObject(Object managedObject) throws InjectionException
destroyManagedObject in interface InjectionManagermanagedObject - InjectionExceptionpublic void destroyManagedObject(Object managedObject, boolean validate) throws InjectionException
destroyManagedObject in interface InjectionManagermanagedObject - validate - if false, do nothing if the instance is not registeredInjectionExceptionpublic void inject(Class clazz, Object instance, com.sun.enterprise.deployment.JndiNameEnvironment envDescriptor, String componentId, boolean invokePostConstruct) throws InjectionException
InjectionManagerinject in interface InjectionManagerinstance - Target instance for injection, or null if injection
is class-based. Any error encountered during any
portion of injection is propagated immediately.clazz - The class of the instance to perform injection. This is needed b/c of static 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 © 2014. All rights reserved.