org.riotfamily.common.beans.config
Class HighestPrecedenceFactoryBean

java.lang.Object
  extended by org.riotfamily.common.beans.config.HighestPrecedenceFactoryBean
All Implemented Interfaces:
FactoryBean, ApplicationContextAware

public class HighestPrecedenceFactoryBean
extends Object
implements FactoryBean, ApplicationContextAware

FactoryBean that looks for all beans of a certain type and returns the one with the highest precedence.

Author:
Felix Gnass [fgnass at neteye dot de]

Constructor Summary
HighestPrecedenceFactoryBean()
           
 
Method Summary
 Object getObject()
           
 Class<? extends Ordered> getObjectType()
           
 boolean isSingleton()
           
 void setApplicationContext(ApplicationContext applicationContext)
           
 void setType(Class<? extends Ordered> type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HighestPrecedenceFactoryBean

public HighestPrecedenceFactoryBean()
Method Detail

setType

public void setType(Class<? extends Ordered> type)

setApplicationContext

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

getObject

public Object getObject()
                 throws Exception
Specified by:
getObject in interface FactoryBean
Throws:
Exception

getObjectType

public Class<? extends Ordered> getObjectType()
Specified by:
getObjectType in interface FactoryBean

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface FactoryBean