jfun.yan.xfire
Class XFireLoader

java.lang.Object
  extended by jfun.yan.web.YanLoader
      extended by jfun.yan.xfire.XFireLoader

public class XFireLoader
extends YanLoader

A loader for loading xfire aware NutsProcessor object.

Author:
Ben Yu Feb 5, 2006 4:17:51 PM

Field Summary
 
Fields inherited from class jfun.yan.web.YanLoader
CONFIG_FILE_PARAM, CONTAINER_ROOT, DEFAULT_CONFIG_FILE, DEFAULT_NUTS_FILE, DEFAULT_SPRING_NUTS_FILE, LIFECYCLE_MANAGER_ROOT, SERVLET_CONTEXT_KEY, TRUE, USE_SPRING
 
Constructor Summary
XFireLoader(java.lang.Object xfire_name)
          To create a XFireLoader object.
 
Method Summary
protected  void decorateProcessor(NutsProcessor processor, javax.servlet.ServletContext ctxt)
          Decorate a NutsProcessor object by adding or removing features.
 Container initContainer(java.lang.ClassLoader cloader, javax.servlet.ServletContext servletContext)
          Initialize this object by instantiating container and life cycle manager.
 
Methods inherited from class jfun.yan.web.YanLoader
destroy, getNutsProcessor, initContainer, loadParentContainer, process, registerServletContext, setSpringAware, setWebAware, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XFireLoader

public XFireLoader(java.lang.Object xfire_name)
To create a XFireLoader object.

Parameters:
xfire_name - the key of the xfire object.
Method Detail

decorateProcessor

protected void decorateProcessor(NutsProcessor processor,
                                 javax.servlet.ServletContext ctxt)
                          throws java.lang.Exception
Description copied from class: YanLoader
Decorate a NutsProcessor object by adding or removing features.

This default implementation replaces <bean>, <ctor> and <method> tags with the ones that're aware of the ServletContext.

It does so by registering the ServletContext as a service under YanLoader.SERVLET_CONTEXT_KEY. The customized tags then look up this service and call "setServletContext()" or any other specified receiver method to set this dependency.

Based on whether YanLoader.USE_SPRING parameter is set in ServletContext, this implementation calls either YanLoader.setSpringAware(NutsProcessor, ServletContext) or YanLoader.setWebAware(NutsProcessor, ServletContext) to do the decoration.

Subclasses can override this method to provide customized decoration.

Overrides:
decorateProcessor in class YanLoader
Parameters:
processor - the NutsProcessor object to decorate.
ctxt - the ServletContext object.
Throws:
java.lang.Exception - any error.

initContainer

public Container initContainer(java.lang.ClassLoader cloader,
                               javax.servlet.ServletContext servletContext)
Description copied from class: YanLoader
Initialize this object by instantiating container and life cycle manager. Relevant servlet context parameters are read.

This implementation calls YanLoader.process(ClassLoader, ServletContext) for interpreting the configuration file and obtaining the Container instance and LifecycleManager instance.

Overrides:
initContainer in class YanLoader
Parameters:
cloader - the ClassLoader used to load component classes.
servletContext - the servlet context object.
Returns:
the Container object instantiated. null is returned if configuration file not found.