Package org.ops4j.pax.web.jsp
Class InstanceManager
- java.lang.Object
-
- org.ops4j.pax.web.jsp.InstanceManager
-
- All Implemented Interfaces:
org.apache.tomcat.InstanceManager
public class InstanceManager extends Object implements org.apache.tomcat.InstanceManager
-
-
Constructor Summary
Constructors Constructor Description InstanceManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroyInstance(Object instance)protected intgetAnnotationCacheSize()Makes cache size available to unit tests.static StringgetName(Method setter)protected Class<?>loadClassMaybePrivileged(String className, ClassLoader classLoader)ObjectnewInstance(Class<?> clazz)voidnewInstance(Object o)ObjectnewInstance(String className)ObjectnewInstance(String className, ClassLoader classLoader)protected voidpopulateAnnotationsCache(Class<?> clazz, Map<String,String> injections)Make sure that the annotations cache has been populated for the provided class.protected voidpreDestroy(Object instance, Class<?> clazz)Call preDestroy method on the specified instance recursively from deepest superclass to actual class.
-
-
-
Method Detail
-
newInstance
public Object newInstance(String className) throws IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException
- Specified by:
newInstancein interfaceorg.apache.tomcat.InstanceManager- Throws:
IllegalAccessExceptionInvocationTargetExceptionInstantiationExceptionClassNotFoundException
-
newInstance
public Object newInstance(String className, ClassLoader classLoader) throws IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException
- Specified by:
newInstancein interfaceorg.apache.tomcat.InstanceManager- Throws:
IllegalAccessExceptionInvocationTargetExceptionInstantiationExceptionClassNotFoundException
-
newInstance
public void newInstance(Object o) throws IllegalAccessException, InvocationTargetException
- Specified by:
newInstancein interfaceorg.apache.tomcat.InstanceManager- Throws:
IllegalAccessExceptionInvocationTargetException
-
newInstance
public Object newInstance(Class<?> clazz) throws IllegalAccessException, InvocationTargetException, NamingException, InstantiationException
- Specified by:
newInstancein interfaceorg.apache.tomcat.InstanceManager- Throws:
IllegalAccessExceptionInvocationTargetExceptionNamingExceptionInstantiationException
-
destroyInstance
public void destroyInstance(Object instance) throws IllegalAccessException, InvocationTargetException
- Specified by:
destroyInstancein interfaceorg.apache.tomcat.InstanceManager- Throws:
IllegalAccessExceptionInvocationTargetException
-
preDestroy
protected void preDestroy(Object instance, Class<?> clazz) throws IllegalAccessException, InvocationTargetException
Call preDestroy method on the specified instance recursively from deepest superclass to actual class.- Parameters:
instance- object to call preDestroy methods onclazz- (super) class to examine for preDestroy annotation.- Throws:
IllegalAccessException- if preDestroy method is inaccessible.InvocationTargetException- if call fails
-
populateAnnotationsCache
protected void populateAnnotationsCache(Class<?> clazz, Map<String,String> injections) throws IllegalAccessException, InvocationTargetException
Make sure that the annotations cache has been populated for the provided class.- Parameters:
clazz- clazz to populate annotations forinjections- map of injections for this class from xml deployment descriptor- Throws:
IllegalAccessException- if injection target is inaccessibleInvocationTargetException- if injection fails
-
getAnnotationCacheSize
protected int getAnnotationCacheSize()
Makes cache size available to unit tests.
-
loadClassMaybePrivileged
protected Class<?> loadClassMaybePrivileged(String className, ClassLoader classLoader) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
-