Class SimpleInstanceManager
java.lang.Object
org.apache.tomcat.SimpleInstanceManager
- All Implemented Interfaces:
InstanceManager
SimpleInstanceManager implements the org.apache.tomcat.InstanceManager interface.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDestroy the given instance, performing pre-destroy callbacks.newInstance(Class<?> clazz) Create a new instance of the given class.voidPerform dependency injection on the given object.newInstance(String className) Create a new instance of the class with the given name.newInstance(String fqcn, ClassLoader classLoader) Create a new instance of the class with the given name using the specified class loader.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface InstanceManager
backgroundProcess
-
Constructor Details
-
SimpleInstanceManager
public SimpleInstanceManager()Creates a new SimpleInstanceManager.
-
-
Method Details
-
newInstance
public Object newInstance(Class<?> clazz) throws IllegalAccessException, InvocationTargetException, NamingException, InstantiationException, NoSuchMethodException Create a new instance of the given class.- Specified by:
newInstancein interfaceInstanceManager- Parameters:
clazz- The class to instantiate- Returns:
- the new instance
- Throws:
IllegalAccessException- if the class or its nullary constructor is not accessibleInvocationTargetException- if the nullary constructor throws an exceptionNamingException- if a naming exception is encounteredInstantiationException- if this Class represents an abstract class, an interface, an array class, a primitive type, or voidNoSuchMethodException- if the nullary method cannot be found
-
newInstance
public Object newInstance(String className) throws IllegalAccessException, InvocationTargetException, NamingException, InstantiationException, ClassNotFoundException, NoSuchMethodException Create 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:
IllegalAccessException- if the class or its nullary constructor is not accessibleInvocationTargetException- if the nullary constructor throws an exceptionNamingException- if a naming exception is encounteredInstantiationException- if this Class represents an abstract class, an interface, an array class, a primitive type, or voidClassNotFoundException- if the class cannot be foundNoSuchMethodException- if the nullary method cannot be found
-
newInstance
public Object newInstance(String fqcn, ClassLoader classLoader) throws IllegalAccessException, InvocationTargetException, NamingException, InstantiationException, ClassNotFoundException, NoSuchMethodException Create 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:
IllegalAccessException- if the class or its nullary constructor is not accessibleInvocationTargetException- if the nullary constructor throws an exceptionNamingException- if a naming exception is encounteredInstantiationException- if this Class represents an abstract class, an interface, an array class, a primitive type, or voidClassNotFoundException- if the class cannot be foundNoSuchMethodException- if the nullary method cannot be found
-
newInstance
public void newInstance(Object o) throws IllegalAccessException, InvocationTargetException, NamingException Perform dependency injection on the given object.- Specified by:
newInstancein interfaceInstanceManager- Parameters:
o- The object to inject dependencies into- Throws:
IllegalAccessException- if the class or its nullary constructor is not accessibleInvocationTargetException- if the nullary constructor throws an exceptionNamingException- if a naming exception is encountered
-
destroyInstance
Destroy the given instance, performing pre-destroy callbacks.- Specified by:
destroyInstancein interfaceInstanceManager- Parameters:
o- The object to destroy- Throws:
IllegalAccessException- if the class or its nullary constructor is not accessibleInvocationTargetException- if the nullary constructor throws an exception
-