|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.catalina.core.DefaultInstanceManager
public class DefaultInstanceManager
Field Summary | |
---|---|
protected java.lang.ClassLoader |
classLoader
|
protected java.lang.ClassLoader |
containerClassLoader
|
protected boolean |
ignoreAnnotations
|
protected boolean |
privileged
|
Constructor Summary | |
---|---|
DefaultInstanceManager(javax.naming.Context context,
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> injectionMap,
Context catalinaContext,
java.lang.ClassLoader containerClassLoader)
|
Method Summary | |
---|---|
void |
destroyInstance(java.lang.Object instance)
|
protected java.lang.Class<?> |
loadClass(java.lang.String className,
java.lang.ClassLoader classLoader)
|
protected java.lang.Class<?> |
loadClassMaybePrivileged(java.lang.String className,
java.lang.ClassLoader classLoader)
|
protected static void |
lookupFieldResource(javax.naming.Context context,
java.lang.Object instance,
java.lang.reflect.Field field,
java.lang.String name,
java.lang.Class<?> clazz)
Inject resources in specified field. |
protected static void |
lookupMethodResource(javax.naming.Context context,
java.lang.Object instance,
java.lang.reflect.Method method,
java.lang.String name,
java.lang.Class<?> clazz)
Inject resources in specified method. |
java.lang.Object |
newInstance(java.lang.Class<?> c)
|
void |
newInstance(java.lang.Object o)
|
java.lang.Object |
newInstance(java.lang.String className)
|
java.lang.Object |
newInstance(java.lang.String className,
java.lang.ClassLoader classLoader)
|
protected void |
postConstruct(java.lang.Object instance,
java.lang.Class<?> clazz)
Call postConstruct method on the specified instance recursively from deepest superclass to actual class. |
protected void |
preDestroy(java.lang.Object instance,
java.lang.Class<?> clazz)
Call preDestroy method on the specified instance recursively from deepest superclass to actual class. |
protected void |
processAnnotations(java.lang.Object instance,
java.util.Map<java.lang.String,java.lang.String> injections)
Inject resources in specified instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.lang.ClassLoader classLoader
protected final java.lang.ClassLoader containerClassLoader
protected boolean privileged
protected boolean ignoreAnnotations
Constructor Detail |
---|
public DefaultInstanceManager(javax.naming.Context context, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> injectionMap, Context catalinaContext, java.lang.ClassLoader containerClassLoader)
Method Detail |
---|
public java.lang.Object newInstance(java.lang.String className) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, javax.naming.NamingException, java.lang.InstantiationException, java.lang.ClassNotFoundException
newInstance
in interface InstanceManager
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
javax.naming.NamingException
java.lang.InstantiationException
java.lang.ClassNotFoundException
public java.lang.Object newInstance(java.lang.String className, java.lang.ClassLoader classLoader) throws java.lang.IllegalAccessException, javax.naming.NamingException, java.lang.reflect.InvocationTargetException, java.lang.InstantiationException, java.lang.ClassNotFoundException
newInstance
in interface InstanceManager
java.lang.IllegalAccessException
javax.naming.NamingException
java.lang.reflect.InvocationTargetException
java.lang.InstantiationException
java.lang.ClassNotFoundException
public java.lang.Object newInstance(java.lang.Class<?> c) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, javax.naming.NamingException, java.lang.InstantiationException
newInstance
in interface InstanceManager
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
javax.naming.NamingException
java.lang.InstantiationException
public void newInstance(java.lang.Object o) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, javax.naming.NamingException
newInstance
in interface InstanceManager
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
javax.naming.NamingException
public void destroyInstance(java.lang.Object instance) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
destroyInstance
in interface InstanceManager
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
protected void postConstruct(java.lang.Object instance, java.lang.Class<?> clazz) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
instance
- object to call postconstruct methods onclazz
- (super) class to examine for postConstruct annotation.
java.lang.IllegalAccessException
- if postConstruct method is inaccessible.
java.lang.reflect.InvocationTargetException
- if call failsprotected void preDestroy(java.lang.Object instance, java.lang.Class<?> clazz) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
instance
- object to call preDestroy methods onclazz
- (super) class to examine for preDestroy annotation.
java.lang.IllegalAccessException
- if preDestroy method is inaccessible.
java.lang.reflect.InvocationTargetException
- if call failsprotected void processAnnotations(java.lang.Object instance, java.util.Map<java.lang.String,java.lang.String> injections) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, javax.naming.NamingException
instance
- instance to inject intoinjections
- map of injections for this class from xml deployment descriptor
java.lang.IllegalAccessException
- if injection target is inaccessible
javax.naming.NamingException
- if value cannot be looked up in jndi
java.lang.reflect.InvocationTargetException
- if injection failsprotected java.lang.Class<?> loadClassMaybePrivileged(java.lang.String className, java.lang.ClassLoader classLoader) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
protected java.lang.Class<?> loadClass(java.lang.String className, java.lang.ClassLoader classLoader) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
protected static void lookupFieldResource(javax.naming.Context context, java.lang.Object instance, java.lang.reflect.Field field, java.lang.String name, java.lang.Class<?> clazz) throws javax.naming.NamingException, java.lang.IllegalAccessException
context
- jndi context to extract value frominstance
- object to inject intofield
- field target for injectionname
- jndi name value is bound underclazz
- class annotation is defined in
java.lang.IllegalAccessException
- if field is inaccessible
javax.naming.NamingException
- if value is not accessible in naming contextprotected static void lookupMethodResource(javax.naming.Context context, java.lang.Object instance, java.lang.reflect.Method method, java.lang.String name, java.lang.Class<?> clazz) throws javax.naming.NamingException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
context
- jndi context to extract value frominstance
- object to inject intomethod
- field target for injectionname
- jndi name value is bound underclazz
- class annotation is defined in
java.lang.IllegalAccessException
- if method is inaccessible
javax.naming.NamingException
- if value is not accessible in naming context
java.lang.reflect.InvocationTargetException
- if setter call fails
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |