FileDocCategorySizeDatePackage
InjectionManager.javaAPI DocGlassfish v2 API7232Fri May 04 22:33:14 BST 2007com.sun.enterprise

InjectionManager

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.
author
Kenneth Saks

Fields Summary
Constructors Summary
Methods Summary
public voidinjectClass(java.lang.Class clazz, com.sun.enterprise.deployment.JndiNameEnvironment componentEnv)
Inject the injectable resources from the given component environment into a Class instance. Only class-level(static) fields/methods are supported. E.g., this injection operation would be used for the Application Client Container main class. Any @PostConstruct methods on the class(and super-classes) will be invoked after injection.

exception
InjectionException Thrown if an error occurs during injection

public voidinjectClass(java.lang.Class clazz, com.sun.enterprise.deployment.JndiNameEnvironment componentEnv, boolean invokePostConstruct)
Inject the injectable resources from the given component environment into a Class instance. Only class-level(static) fields/methods are supported. E.g., this injection operation would be used for the Application Client Container main class.

param
invokePostConstruct if true, invoke any @PostConstruct methods on the class(and super-classes) after injection.
exception
InjectionException Thrown if an error occurs during injection

public voidinjectInstance(java.lang.Object instance)
Inject the given object instance with the resources from its component environment. The applicable component naming environment information will be retrieved from the current invocation context. Any @PostConstruct methods on the instance's class(and super-classes) will be invoked after injection.

exception
InjectionException Thrown if an error occurs during injection

public voidinjectInstance(java.lang.Object instance, com.sun.enterprise.deployment.JndiNameEnvironment componentEnv)
Inject the injectable resources from the given component environment into an object instance. The specified componentEnv must match the environment that is associated with the component on top of the invocation stack at the time this method is invoked. Any @PostConstruct methods on the instance's class(and super-classes) will be invoked after injection.

exception
InjectionException Thrown if an error occurs during injection

public voidinjectInstance(java.lang.Object instance, com.sun.enterprise.deployment.JndiNameEnvironment componentEnv, boolean invokePostConstruct)
Inject the injectable resources from the given component environment into an object instance. The specified componentEnv must match the environment that is associated with the component on top of the invocation stack at the time this method is invoked.

param
invokePostConstruct if true, invoke any @PostConstruct methods on the instance's class(and super-classes) after injection.
exception
InjectionException Thrown if an error occurs during injection

public voidinvokeClassPreDestroy(java.lang.Class clazz, com.sun.enterprise.deployment.JndiNameEnvironment componentEnv)
Invoke any static @PreDestroy methods defined on the class (and super-classes). The specified componentEnv must match the environment that is associated with the component on top of the invocation stack at the time this method is invoked.

exception
InjectionException Thrown if an error occurs

public voidinvokeInstancePreDestroy(java.lang.Object instance)
Invoke any @PreDestroy methods defined on the instance's class (and super-classes). Invocation information will be retrieved from the current component invocation context.

exception
InjectionException Thrown if an error occurs

public voidinvokeInstancePreDestroy(java.lang.Object instance, com.sun.enterprise.deployment.JndiNameEnvironment componentEnv)
Invoke any @PreDestroy methods defined on the instance's class (and super-classes). The specified componentEnv must match the environment that is associated with the component on top of the invocation stack at the time this method is invoked.

exception
InjectionException Thrown if an error occurs