Package com.atlassian.crowd.util
Class SpringContextInstanceFactory
java.lang.Object
com.atlassian.crowd.util.SpringContextInstanceFactory
- All Implemented Interfaces:
InstanceFactory,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class SpringContextInstanceFactory
extends Object
implements InstanceFactory, org.springframework.context.ApplicationContextAware
Implementation tied to Spring.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TgetInstance(Class<T> clazz) Gets an instance of a class.getInstance(String className) Get an instance of a class.getInstance(String className, ClassLoader classLoader) Get an instance of a class from a specific classloader.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)
-
Constructor Details
-
SpringContextInstanceFactory
public SpringContextInstanceFactory()
-
-
Method Details
-
getInstance
Description copied from interface:InstanceFactoryGet an instance of a class.- Specified by:
getInstancein interfaceInstanceFactory- Parameters:
className- name of class.- Returns:
- instance of class.
- Throws:
ClassNotFoundException- if the class does not exist.
-
getInstance
Description copied from interface:InstanceFactoryGet an instance of a class from a specific classloader.- Specified by:
getInstancein interfaceInstanceFactory- Parameters:
className- name of class.classLoader- class loader.- Returns:
- instance of class.
- Throws:
ClassNotFoundException- if the class does not exist.
-
getInstance
Description copied from interface:InstanceFactoryGets an instance of a class.- Specified by:
getInstancein interfaceInstanceFactory- Type Parameters:
T- type of class.- Parameters:
clazz- class.- Returns:
- instance of class.
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-