org.jasig.portal.spring.beans.factory
Class MediatingFactoryBean

java.lang.Object
  extended by org.springframework.beans.factory.config.AbstractFactoryBean
      extended by org.jasig.portal.spring.beans.factory.MediatingFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, DisposableBean, FactoryBean, InitializingBean, ApplicationContextAware

public class MediatingFactoryBean
extends AbstractFactoryBean
implements ApplicationContextAware

Takes a list of bean names and attempts to load each in order. If the loading of a bean throws an Exception it is logged and the next bean name in the list is tried. If no beans can be loaded a BeanCreationException is thrown.

Version:
$Revision$
Author:
Eric Dalquist

Field Summary
 
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
 
Constructor Summary
MediatingFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  Object createInstance()
           
 List<String> getDelegateBeanNames()
           
 Class<?> getObjectType()
           
 Class<?> getType()
           
 void setApplicationContext(ApplicationContext applicationContext)
           
 void setDelegateBeanNames(List<String> delegateBeanNames)
           
 void setType(Class<?> type)
           
 
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MediatingFactoryBean

public MediatingFactoryBean()
Method Detail

getDelegateBeanNames

public List<String> getDelegateBeanNames()
Returns:
the delegateBeanNames

setDelegateBeanNames

public void setDelegateBeanNames(List<String> delegateBeanNames)
Parameters:
delegateBeanNames - the delegateBeanNames to set

getType

public Class<?> getType()
Returns:
the type

setType

public void setType(Class<?> type)
Parameters:
type - the type to set

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class AbstractFactoryBean
Throws:
Exception

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
                           throws BeansException
Specified by:
setApplicationContext in interface ApplicationContextAware
Throws:
BeansException

createInstance

protected Object createInstance()
                         throws Exception
Specified by:
createInstance in class AbstractFactoryBean
Throws:
Exception

getObjectType

public Class<?> getObjectType()
Specified by:
getObjectType in interface FactoryBean
Specified by:
getObjectType in class AbstractFactoryBean


Copyright © 2010 Jasig. All Rights Reserved.