com.atlassian.confluence.user.crowd
Class ConfluenceSpringContextInstanceFactory

java.lang.Object
  extended by com.atlassian.confluence.user.crowd.ConfluenceSpringContextInstanceFactory
All Implemented Interfaces:
com.atlassian.crowd.util.InstanceFactory, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

public class ConfluenceSpringContextInstanceFactory
extends java.lang.Object
implements com.atlassian.crowd.util.InstanceFactory, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean

Overrides the getInstance(Class) method such that certain beans are created from a prototyped scope. This allows us to override the definition of what beans are used in the constructor. This fixes a problem where spring is unable to determine which class to use for the interface LDAPQueryTranslater because there are two definitions of this bean.


Constructor Summary
ConfluenceSpringContextInstanceFactory(java.util.Map<java.lang.Class<?>,java.lang.String> beanMapping)
           
 
Method Summary
 void afterPropertiesSet()
           
<T> T
getInstance(java.lang.Class<T> clazz)
           
 java.lang.Object getInstance(java.lang.String className)
           
 java.lang.Object getInstance(java.lang.String className, java.lang.ClassLoader classLoader)
           
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfluenceSpringContextInstanceFactory

public ConfluenceSpringContextInstanceFactory(java.util.Map<java.lang.Class<?>,java.lang.String> beanMapping)
Method Detail

getInstance

public java.lang.Object getInstance(java.lang.String className)
                             throws java.lang.ClassNotFoundException
Specified by:
getInstance in interface com.atlassian.crowd.util.InstanceFactory
Throws:
java.lang.ClassNotFoundException

getInstance

public java.lang.Object getInstance(java.lang.String className,
                                    java.lang.ClassLoader classLoader)
                             throws java.lang.ClassNotFoundException
Specified by:
getInstance in interface com.atlassian.crowd.util.InstanceFactory
Throws:
java.lang.ClassNotFoundException

getInstance

public <T> T getInstance(java.lang.Class<T> clazz)
Specified by:
getInstance in interface com.atlassian.crowd.util.InstanceFactory

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

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception


Copyright © 2003-2014 Atlassian. All Rights Reserved.