org.codehaus.waffle.context.pico
Class PicoComponentRegistry

java.lang.Object
  extended by org.codehaus.waffle.context.pico.PicoComponentRegistry
All Implemented Interfaces:
ComponentRegistry

public class PicoComponentRegistry
extends java.lang.Object
implements ComponentRegistry

PicoContainer-based implementation of Waffle's ComponentRegistry

Author:
Michael Ward, Mauro Talevi

Constructor Summary
PicoComponentRegistry(javax.servlet.ServletContext servletContext)
          Register all waffle required components with the underlying container.
 
Method Summary
 ActionMethodExecutor getActionMethodExecutor()
           
 ActionMethodResponseHandler getActionMethodResponseHandler()
           
 ArgumentResolver getArgumentResolver()
           
 BindErrorMessageResolver getBindErrorMessageResolver()
           
 ContextContainerFactory getContextContainerFactory()
           
 ControllerDefinitionFactory getControllerDefinitionFactory()
           
 ControllerNameResolver getControllerNameResolver()
           
 DataBinder getDataBinder()
           
 DispatchAssistant getDispatchAssistant()
           
 MessageResources getMessageResources()
           
 MethodDefinitionFinder getMethodDefinitionFinder()
           
 MethodNameResolver getMethodNameResolver()
           
 ActionMonitor getMonitor()
           
 RequestAttributeBinder getRequestAttributeBinder()
           
 ognl.TypeConverter getTypeConverter()
           
 Validator getValidator()
           
 ViewDispatcher getViewDispatcher()
           
 ViewResolver getViewResolver()
           
<T> T
locateByKey(java.lang.Object key)
          Convenience method for locating and automatically casting a Component from the container.
<T> T
locateByType(java.lang.Class<T> t)
           
protected static java.lang.Class<?> locateComponentClass(java.lang.Object key, java.lang.Class<?> defaultClass, javax.servlet.ServletContext servletContext)
          This method will locate the component Class to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PicoComponentRegistry

public PicoComponentRegistry(javax.servlet.ServletContext servletContext)
Register all waffle required components with the underlying container.

Method Detail

locateComponentClass

protected static java.lang.Class<?> locateComponentClass(java.lang.Object key,
                                                         java.lang.Class<?> defaultClass,
                                                         javax.servlet.ServletContext servletContext)
                                                  throws WaffleException
This method will locate the component Class to use. Each of the components can be \ overwritten by setting context-param in the applications web.xml.

<context-param> <param-name>org.codehaus.waffle.actions.ControllerDefinitionFactory</param-name> <param-value>org.myurl.FooBarControllerFactory</param-value> </context-param>

Parameters:
key - represents the component key which the implementation should be registered under.
defaultClass - represents the Class to use by default (when not over-written).
servletContext - required to obtain the InitParameter defined for the web application.
Throws:
WaffleException

locateByKey

public <T> T locateByKey(java.lang.Object key)
Convenience method for locating and automatically casting a Component from the container.

Specified by:
locateByKey in interface ComponentRegistry

locateByType

public <T> T locateByType(java.lang.Class<T> t)
Specified by:
locateByType in interface ComponentRegistry

getActionMethodExecutor

public ActionMethodExecutor getActionMethodExecutor()
Specified by:
getActionMethodExecutor in interface ComponentRegistry

getActionMethodResponseHandler

public ActionMethodResponseHandler getActionMethodResponseHandler()
Specified by:
getActionMethodResponseHandler in interface ComponentRegistry

getArgumentResolver

public ArgumentResolver getArgumentResolver()
Specified by:
getArgumentResolver in interface ComponentRegistry

getBindErrorMessageResolver

public BindErrorMessageResolver getBindErrorMessageResolver()
Specified by:
getBindErrorMessageResolver in interface ComponentRegistry

getContextContainerFactory

public ContextContainerFactory getContextContainerFactory()
Specified by:
getContextContainerFactory in interface ComponentRegistry

getControllerNameResolver

public ControllerNameResolver getControllerNameResolver()
Specified by:
getControllerNameResolver in interface ComponentRegistry

getControllerDefinitionFactory

public ControllerDefinitionFactory getControllerDefinitionFactory()
Specified by:
getControllerDefinitionFactory in interface ComponentRegistry

getDataBinder

public DataBinder getDataBinder()
Specified by:
getDataBinder in interface ComponentRegistry

getDispatchAssistant

public DispatchAssistant getDispatchAssistant()
Specified by:
getDispatchAssistant in interface ComponentRegistry

getMessageResources

public MessageResources getMessageResources()
Specified by:
getMessageResources in interface ComponentRegistry

getMethodDefinitionFinder

public MethodDefinitionFinder getMethodDefinitionFinder()
Specified by:
getMethodDefinitionFinder in interface ComponentRegistry

getMethodNameResolver

public MethodNameResolver getMethodNameResolver()
Specified by:
getMethodNameResolver in interface ComponentRegistry

getMonitor

public ActionMonitor getMonitor()
Specified by:
getMonitor in interface ComponentRegistry

getRequestAttributeBinder

public RequestAttributeBinder getRequestAttributeBinder()
Specified by:
getRequestAttributeBinder in interface ComponentRegistry

getTypeConverter

public ognl.TypeConverter getTypeConverter()
Specified by:
getTypeConverter in interface ComponentRegistry

getValidator

public Validator getValidator()
Specified by:
getValidator in interface ComponentRegistry

getViewDispatcher

public ViewDispatcher getViewDispatcher()
Specified by:
getViewDispatcher in interface ComponentRegistry

getViewResolver

public ViewResolver getViewResolver()
Specified by:
getViewResolver in interface ComponentRegistry


Copyright © 2007 null. All Rights Reserved.