org.kuali.rice.core.resourceloader
Class BaseResourceLoader

java.lang.Object
  extended by org.kuali.rice.core.lifecycle.BaseLifecycle
      extended by org.kuali.rice.core.resourceloader.ResourceLoaderContainer
          extended by org.kuali.rice.core.resourceloader.BaseResourceLoader
All Implemented Interfaces:
Lifecycle, ObjectLoader, ResourceLoader, ServiceLocator
Direct Known Subclasses:
BaseWrappingResourceLoader, BeanFactoryResourceLoader, ParentChildResourceLoader, SpringBeanFactoryResourceLoader, SpringResourceLoader, ThinClientResourceLoader

public class BaseResourceLoader
extends ResourceLoaderContainer
implements ResourceLoader

A simple ResourceLoader implementation which will load objects from the specified classloader and also locate services in an optional ServiceLocator.

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

Field Summary
private  ClassLoader classLoader
           
(package private) static org.apache.log4j.Logger LOG
           
private  boolean postProcessContainer
           
private  ServiceLocator serviceLocator
           
 
Fields inherited from interface org.kuali.rice.core.resourceloader.ResourceLoader
EMBEDDED_CLIENT_APP_RESOURCE_LOADER, EMBEDDED_PLUGIN, KSB_CONFIGURER_CONTAINER_NAME, PLUGIN_REGISTRY_LOADER_NAME, RMI_PLUGIN, ROOT_RESOURCE_LOADER_NAME, WEB_SERVICE_PLUGIN
 
Constructor Summary
BaseResourceLoader(QName name)
           
BaseResourceLoader(QName name, ClassLoader classLoader)
           
BaseResourceLoader(QName name, ClassLoader classLoader, ServiceLocator serviceLocator)
           
BaseResourceLoader(QName name, ServiceLocator serviceLocator)
           
 
Method Summary
private  String dumpMemory()
           
 ClassLoader getClassLoader()
           
 String getContents(String indent, boolean servicePerLine)
           
private  String getMemStatus()
           
 Object getObject(ObjectDefinition objectDefinition)
          Constructs an instance of the Object using the given ObjectDefinition classname.
 Object getService(QName serviceName)
          Fetches the service with the given name.
 ServiceLocator getServiceLocator()
           
 boolean isPostProcessContainer()
           
protected  Object postProcessObject(ObjectDefinition definition, Object object)
           
protected  Object postProcessService(QName serviceName, Object service)
           
 void setClassLoader(ClassLoader classLoader)
           
 void setPostProcessContainer(boolean postProcessContainer)
           
 void start()
           
 void stop()
           
protected  Object wrap(QName serviceName, Object service)
          Deprecated. use postProcessService(QName, Object) instead
 
Methods inherited from class org.kuali.rice.core.resourceloader.ResourceLoaderContainer
addResourceLoader, addResourceLoaderFirst, containsResourceLoader, getName, getResourceLoader, getResourceLoaderNames, getResourceLoaders, removeAllResourceLoaders, removeResourceLoader, setName, toString
 
Methods inherited from class org.kuali.rice.core.lifecycle.BaseLifecycle
isStarted, setStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.core.resourceloader.ResourceLoader
addResourceLoader, addResourceLoaderFirst, getName, getResourceLoader, getResourceLoaderNames, getResourceLoaders, removeResourceLoader, setName
 
Methods inherited from interface org.kuali.rice.core.lifecycle.Lifecycle
isStarted
 

Field Detail

LOG

static final org.apache.log4j.Logger LOG

serviceLocator

private ServiceLocator serviceLocator

classLoader

private ClassLoader classLoader

postProcessContainer

private boolean postProcessContainer
Constructor Detail

BaseResourceLoader

public BaseResourceLoader(QName name,
                          ClassLoader classLoader)

BaseResourceLoader

public BaseResourceLoader(QName name)

BaseResourceLoader

public BaseResourceLoader(QName name,
                          ServiceLocator serviceLocator)

BaseResourceLoader

public BaseResourceLoader(QName name,
                          ClassLoader classLoader,
                          ServiceLocator serviceLocator)
Method Detail

getObject

public Object getObject(ObjectDefinition objectDefinition)
Description copied from interface: ObjectLoader
Constructs an instance of the Object using the given ObjectDefinition classname.

Specified by:
getObject in interface ObjectLoader
Overrides:
getObject in class ResourceLoaderContainer

getService

public Object getService(QName serviceName)
Description copied from interface: ServiceLocator
Fetches the service with the given name.

Specified by:
getService in interface ServiceLocator
Overrides:
getService in class ResourceLoaderContainer

start

public void start()
           throws Exception
Specified by:
start in interface Lifecycle
Overrides:
start in class ResourceLoaderContainer
Throws:
Exception

stop

public void stop()
          throws Exception
Specified by:
stop in interface Lifecycle
Overrides:
stop in class ResourceLoaderContainer
Throws:
Exception

getClassLoader

public ClassLoader getClassLoader()

setClassLoader

public void setClassLoader(ClassLoader classLoader)

postProcessObject

protected Object postProcessObject(ObjectDefinition definition,
                                   Object object)

postProcessService

protected Object postProcessService(QName serviceName,
                                    Object service)

isPostProcessContainer

public boolean isPostProcessContainer()

setPostProcessContainer

public void setPostProcessContainer(boolean postProcessContainer)

wrap

protected Object wrap(QName serviceName,
                      Object service)
Deprecated. use postProcessService(QName, Object) instead


getContents

public String getContents(String indent,
                          boolean servicePerLine)
Specified by:
getContents in interface ResourceLoader
Specified by:
getContents in interface ServiceLocator
Overrides:
getContents in class ResourceLoaderContainer

getMemStatus

private String getMemStatus()

dumpMemory

private String dumpMemory()

getServiceLocator

public ServiceLocator getServiceLocator()


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