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 Details

    • SpringContextInstanceFactory

      public SpringContextInstanceFactory()
  • Method Details

    • getInstance

      public Object getInstance(String className) throws ClassNotFoundException
      Description copied from interface: InstanceFactory
      Get an instance of a class.
      Specified by:
      getInstance in interface InstanceFactory
      Parameters:
      className - name of class.
      Returns:
      instance of class.
      Throws:
      ClassNotFoundException - if the class does not exist.
    • getInstance

      public Object getInstance(String className, ClassLoader classLoader) throws ClassNotFoundException
      Description copied from interface: InstanceFactory
      Get an instance of a class from a specific classloader.
      Specified by:
      getInstance in interface InstanceFactory
      Parameters:
      className - name of class.
      classLoader - class loader.
      Returns:
      instance of class.
      Throws:
      ClassNotFoundException - if the class does not exist.
    • getInstance

      public <T> T getInstance(Class<T> clazz)
      Description copied from interface: InstanceFactory
      Gets an instance of a class.
      Specified by:
      getInstance in interface InstanceFactory
      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 interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException