Package org.apache.tomcat
Class SimpleInstanceManager
- java.lang.Object
-
- org.apache.tomcat.SimpleInstanceManager
-
- All Implemented Interfaces:
InstanceManager
public class SimpleInstanceManager extends java.lang.Object implements InstanceManager
SimpleInstanceManager implements the org.apache.tomcat.InstanceManager interface.
-
-
Constructor Summary
Constructors Constructor Description SimpleInstanceManager()Creates a new SimpleInstanceManager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroyInstance(java.lang.Object o)Destroy the given instance, performing pre-destroy callbacks.java.lang.ObjectnewInstance(java.lang.Class<?> clazz)Create a new instance of the given class.voidnewInstance(java.lang.Object o)Perform dependency injection on the given object.java.lang.ObjectnewInstance(java.lang.String className)Create a new instance of the class with the given name.java.lang.ObjectnewInstance(java.lang.String fqcn, java.lang.ClassLoader classLoader)Create a new instance of the class with the given name using the specified class loader.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.tomcat.InstanceManager
backgroundProcess
-
-
-
-
Method Detail
-
newInstance
public java.lang.Object newInstance(java.lang.Class<?> clazz) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, javax.naming.NamingException, java.lang.InstantiationException, java.lang.NoSuchMethodExceptionCreate a new instance of the given class.- Specified by:
newInstancein interfaceInstanceManager- Parameters:
clazz- The class to instantiate- Returns:
- the new instance
- Throws:
java.lang.IllegalAccessException- if the class or its nullary constructor is not accessiblejava.lang.reflect.InvocationTargetException- if the nullary constructor throws an exceptionjavax.naming.NamingException- if a naming exception is encounteredjava.lang.InstantiationException- if this Class represents an abstract class, an interface, an array class, a primitive type, or voidjava.lang.NoSuchMethodException- if the nullary method cannot be found
-
newInstance
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, java.lang.NoSuchMethodExceptionCreate a new instance of the class with the given name.- Specified by:
newInstancein interfaceInstanceManager- Parameters:
className- The name of the class to instantiate- Returns:
- the new instance
- Throws:
java.lang.IllegalAccessException- if the class or its nullary constructor is not accessiblejava.lang.reflect.InvocationTargetException- if the nullary constructor throws an exceptionjavax.naming.NamingException- if a naming exception is encounteredjava.lang.InstantiationException- if this Class represents an abstract class, an interface, an array class, a primitive type, or voidjava.lang.ClassNotFoundException- if the class cannot be foundjava.lang.NoSuchMethodException- if the nullary method cannot be found
-
newInstance
public java.lang.Object newInstance(java.lang.String fqcn, java.lang.ClassLoader classLoader) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, javax.naming.NamingException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.NoSuchMethodExceptionCreate a new instance of the class with the given name using the specified class loader.- Specified by:
newInstancein interfaceInstanceManager- Parameters:
fqcn- The fully qualified class nameclassLoader- The class loader to use for loading the class- Returns:
- the new instance
- Throws:
java.lang.IllegalAccessException- if the class or its nullary constructor is not accessiblejava.lang.reflect.InvocationTargetException- if the nullary constructor throws an exceptionjavax.naming.NamingException- if a naming exception is encounteredjava.lang.InstantiationException- if this Class represents an abstract class, an interface, an array class, a primitive type, or voidjava.lang.ClassNotFoundException- if the class cannot be foundjava.lang.NoSuchMethodException- if the nullary method cannot be found
-
newInstance
public void newInstance(java.lang.Object o) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, javax.naming.NamingExceptionPerform dependency injection on the given object.- Specified by:
newInstancein interfaceInstanceManager- Parameters:
o- The object to inject dependencies into- Throws:
java.lang.IllegalAccessException- if the class or its nullary constructor is not accessiblejava.lang.reflect.InvocationTargetException- if the nullary constructor throws an exceptionjavax.naming.NamingException- if a naming exception is encountered
-
destroyInstance
public void destroyInstance(java.lang.Object o) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetExceptionDestroy the given instance, performing pre-destroy callbacks.- Specified by:
destroyInstancein interfaceInstanceManager- Parameters:
o- The object to destroy- Throws:
java.lang.IllegalAccessException- if the class or its nullary constructor is not accessiblejava.lang.reflect.InvocationTargetException- if the nullary constructor throws an exception
-
-