org.mule.config.spring.util
Class SpringBeanLookup

java.lang.Object
  extended by org.mule.object.AbstractObjectFactory
      extended by org.mule.config.spring.util.SpringBeanLookup
All Implemented Interfaces:
Disposable, Initialisable, ObjectFactory, org.springframework.context.ApplicationContextAware

public class SpringBeanLookup
extends AbstractObjectFactory
implements org.springframework.context.ApplicationContextAware

This is an implementation of the ObjectFactory interface which simply delegates to the Spring ApplicationContext. Since the delegation happens each time a call to getOrCreate() is made, this will correctly handle Spring beans which are non-singletons (factory beans, etc.) Singleton usage: Non-singleton usage:


Field Summary
 
Fields inherited from class org.mule.object.AbstractObjectFactory
ATTRIBUTE_OBJECT_CLASS, ATTRIBUTE_OBJECT_CLASS_NAME, initialisationCallbacks, logger, objectClass, objectClassName, properties
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
SpringBeanLookup()
           
 
Method Summary
 void dispose()
           
 String getBean()
           
 Object getInstance()
           
 Class getObjectClass()
           
 void initialise()
           
 boolean isSingleton()
           
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setBean(String bean)
           
 
Methods inherited from class org.mule.object.AbstractObjectFactory
addObjectInitialisationCallback, fireInitialisationCallbacks, getObjectClassName, getProperties, setObjectClass, setObjectClassName, setProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringBeanLookup

public SpringBeanLookup()
Method Detail

initialise

public void initialise()
                throws InitialisationException
Specified by:
initialise in interface Initialisable
Overrides:
initialise in class AbstractObjectFactory
Throws:
InitialisationException

dispose

public void dispose()
Specified by:
dispose in interface Disposable
Overrides:
dispose in class AbstractObjectFactory

getObjectClass

public Class getObjectClass()
Specified by:
getObjectClass in interface ObjectFactory
Overrides:
getObjectClass in class AbstractObjectFactory

getInstance

public Object getInstance()
                   throws Exception
Specified by:
getInstance in interface ObjectFactory
Overrides:
getInstance in class AbstractObjectFactory
Throws:
Exception

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

getBean

public String getBean()

setBean

public void setBean(String bean)

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface ObjectFactory
Overrides:
isSingleton in class AbstractObjectFactory


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.