|
Apache Tomcat 7.0.28 | ||||||||
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 ClassLoader |
classLoader
|
protected ClassLoader |
containerClassLoader
|
protected boolean |
ignoreAnnotations
|
protected boolean |
privileged
|
protected static StringManager |
sm
The string manager for this package. |
Constructor Summary | |
---|---|
DefaultInstanceManager(Context context,
Map<String,Map<String,String>> injectionMap,
Context catalinaContext,
ClassLoader containerClassLoader)
|
Method Summary | |
---|---|
void |
destroyInstance(Object instance)
|
protected int |
getAnnotationCacheSize()
Makes cache size available to unit tests. |
static String |
getName(Method setter)
Deprecated. |
protected Class<?> |
loadClass(String className,
ClassLoader classLoader)
|
protected Class<?> |
loadClassMaybePrivileged(String className,
ClassLoader classLoader)
|
protected static void |
lookupFieldResource(Context context,
Object instance,
Field field,
String name,
Class<?> clazz)
Inject resources in specified field. |
protected static void |
lookupMethodResource(Context context,
Object instance,
Method method,
String name,
Class<?> clazz)
Inject resources in specified method. |
void |
newInstance(Object o)
|
Object |
newInstance(String className)
|
Object |
newInstance(String className,
ClassLoader classLoader)
|
protected void |
populateAnnotationsCache(Class<?> clazz,
Map<String,String> injections)
Make sure that the annotations cache has been populated for the provided class. |
protected void |
postConstruct(Object instance,
Class<?> clazz)
Call postConstruct method on the specified instance recursively from deepest superclass to actual class. |
protected void |
preDestroy(Object instance,
Class<?> clazz)
Call preDestroy method on the specified instance recursively from deepest superclass to actual class. |
protected void |
processAnnotations(Object instance,
Map<String,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 static final StringManager sm
protected final ClassLoader classLoader
protected final ClassLoader containerClassLoader
protected boolean privileged
protected boolean ignoreAnnotations
Constructor Detail |
---|
public DefaultInstanceManager(Context context, Map<String,Map<String,String>> injectionMap, Context catalinaContext, ClassLoader containerClassLoader)
Method Detail |
---|
public Object newInstance(String className) throws IllegalAccessException, InvocationTargetException, NamingException, InstantiationException, ClassNotFoundException
newInstance
in interface InstanceManager
IllegalAccessException
InvocationTargetException
NamingException
InstantiationException
ClassNotFoundException
public Object newInstance(String className, ClassLoader classLoader) throws IllegalAccessException, NamingException, InvocationTargetException, InstantiationException, ClassNotFoundException
newInstance
in interface InstanceManager
IllegalAccessException
NamingException
InvocationTargetException
InstantiationException
ClassNotFoundException
public void newInstance(Object o) throws IllegalAccessException, InvocationTargetException, NamingException
newInstance
in interface InstanceManager
IllegalAccessException
InvocationTargetException
NamingException
public void destroyInstance(Object instance) throws IllegalAccessException, InvocationTargetException
destroyInstance
in interface InstanceManager
IllegalAccessException
InvocationTargetException
protected void postConstruct(Object instance, Class<?> clazz) throws IllegalAccessException, InvocationTargetException
instance
- object to call postconstruct methods onclazz
- (super) class to examine for postConstruct annotation.
IllegalAccessException
- if postConstruct method is inaccessible.
InvocationTargetException
- if call failsprotected void preDestroy(Object instance, Class<?> clazz) throws IllegalAccessException, InvocationTargetException
instance
- object to call preDestroy methods onclazz
- (super) class to examine for preDestroy annotation.
IllegalAccessException
- if preDestroy method is inaccessible.
InvocationTargetException
- if call failsprotected void populateAnnotationsCache(Class<?> clazz, Map<String,String> injections) throws IllegalAccessException, InvocationTargetException, NamingException
clazz
- clazz to populate annotations forinjections
- map of injections for this class from xml deployment
descriptor
IllegalAccessException
- if injection target is inaccessible
NamingException
- if value cannot be looked up in jndi
InvocationTargetException
- if injection failsprotected void processAnnotations(Object instance, Map<String,String> injections) throws IllegalAccessException, InvocationTargetException, NamingException
instance
- instance to inject intoinjections
- map of injections for this class from xml deployment descriptor
IllegalAccessException
- if injection target is inaccessible
NamingException
- if value cannot be looked up in jndi
InvocationTargetException
- if injection failsprotected int getAnnotationCacheSize()
protected Class<?> loadClassMaybePrivileged(String className, ClassLoader classLoader) throws ClassNotFoundException
ClassNotFoundException
protected Class<?> loadClass(String className, ClassLoader classLoader) throws ClassNotFoundException
ClassNotFoundException
protected static void lookupFieldResource(Context context, Object instance, Field field, String name, Class<?> clazz) throws NamingException, 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
IllegalAccessException
- if field is inaccessible
NamingException
- if value is not accessible in naming contextprotected static void lookupMethodResource(Context context, Object instance, Method method, String name, Class<?> clazz) throws NamingException, IllegalAccessException, 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
IllegalAccessException
- if method is inaccessible
NamingException
- if value is not accessible in naming context
InvocationTargetException
- if setter call fails@Deprecated public static String getName(Method setter)
|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |