org.kuali.rice.core.resourceloader
Class ResourceLoaderServiceFactoryBean

java.lang.Object
  extended by org.kuali.rice.core.resourceloader.ResourceLoaderServiceFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean

public class ResourceLoaderServiceFactoryBean
extends Object
implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean

Exports services in the GlobalResourceLoader as beans available to Spring.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
private  String namespace
          The KSB namespace in which to look for the service, default is null, which is 'local' services
private  ResourceLoader resourceLoader
          The resource loader in which to look up the service
private  String serviceName
          The service to retrieve.
private  boolean singleton
          Whether we provide a singleton.
 
Constructor Summary
ResourceLoaderServiceFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
 String getNamespace()
           
 Object getObject()
           
 Class getObjectType()
           
protected  QName getQName(String beanName)
          Constructs a QName from the defined namespace and beanName
 ResourceLoader getResourceLoader()
           
 String getServiceName()
           
 boolean isSingleton()
           
 void setBeanName(String name)
           
 void setNamespace(String namespace)
           
 void setResourceLoader(ResourceLoader resourceLoader)
           
 void setServiceName(String serviceName)
           
 void setSingleton(boolean singleton)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serviceName

private String serviceName
The service to retrieve. If unset, defaults to bean name.


namespace

private String namespace
The KSB namespace in which to look for the service, default is null, which is 'local' services


singleton

private boolean singleton
Whether we provide a singleton. Since we cannot make that guarantee, the default is 'false'


resourceLoader

private ResourceLoader resourceLoader
The resource loader in which to look up the service

Constructor Detail

ResourceLoaderServiceFactoryBean

public ResourceLoaderServiceFactoryBean()
Method Detail

getServiceName

public String getServiceName()
Returns:
the configured service name

setServiceName

public void setServiceName(String serviceName)
Parameters:
serviceName - the service name to retrieve from the ResourceLoader

getNamespace

public String getNamespace()
Returns:
the namespace under which to look up the service/bean

setNamespace

public void setNamespace(String namespace)
Parameters:
namespace - the namespace under which to look up the service/bean

setSingleton

public void setSingleton(boolean singleton)
Parameters:
singleton - whether we know that the target bean will be a singleton

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface org.springframework.beans.factory.FactoryBean
See Also:
FactoryBean.isSingleton()

setResourceLoader

public void setResourceLoader(ResourceLoader resourceLoader)
Parameters:
resourceLoader - the ResourceLoader in which to look up the service

getResourceLoader

public ResourceLoader getResourceLoader()
Returns:
the ResourceLoader with which this factory bean has been configured

setBeanName

public void setBeanName(String name)
Specified by:
setBeanName in interface org.springframework.beans.factory.BeanNameAware
See Also:
BeanNameAware.setBeanName(java.lang.String)

afterPropertiesSet

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

getQName

protected QName getQName(String beanName)
Constructs a QName from the defined namespace and beanName

Parameters:
beanName - the bean name to look up
Returns:
a QName with beanName qualified with namespace

getObject

public Object getObject()
                 throws Exception
Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean
Throws:
Exception
See Also:
FactoryBean.getObject()

getObjectType

public Class getObjectType()
Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean
See Also:
FactoryBean.getObjectType()


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.