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
-
Method Summary
Modifier and TypeMethodDescription<T> T
getInstance
(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.void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext)
-
Constructor Details
-
SpringContextInstanceFactory
public SpringContextInstanceFactory()
-
-
Method Details
-
getInstance
Description copied from interface:InstanceFactory
Get an instance of a class.- Specified by:
getInstance
in interfaceInstanceFactory
- Parameters:
className
- name of class.- Returns:
- instance of class.
- Throws:
ClassNotFoundException
- if the class does not exist.
-
getInstance
Description copied from interface:InstanceFactory
Get an instance of a class from a specific classloader.- Specified by:
getInstance
in 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:InstanceFactory
Gets an instance of a class.- Specified by:
getInstance
in 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:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-