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()
           
 ActionMonitor getActionMonitor()
           
 ArgumentResolver getArgumentResolver()
           
 BindErrorMessageResolver getBindErrorMessageResolver()
           
 BindMonitor getBindMonitor()
           
 ContextContainerFactory getContextContainerFactory()
           
 ContextMonitor getContextMonitor()
           
 ControllerDataBinder getControllerDataBinder()
           
 ControllerDefinitionFactory getControllerDefinitionFactory()
           
 ControllerMonitor getControllerMonitor()
           
 ControllerNameResolver getControllerNameResolver()
           
 MessageResources getMessageResources()
           
 MethodDefinitionFinder getMethodDefinitionFinder()
           
 MethodNameResolver getMethodNameResolver()
           
 RegistrarMonitor getRegistrarMonitor()
           
 ServletMonitor getServletMonitor()
           
 StringTransmuter getStringTransmuter()
           
 ValidationMonitor getValidationMonitor()
           
 Validator getValidator()
           
 ValueConverterFinder getValueConverterFinder()
           
 ViewDataBinder getViewDataBinder()
           
 ViewDispatcher getViewDispatcher()
           
 ViewMonitor getViewMonitor()
           
 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)
          Retrieve a component by type.
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
Parameters:
key - the key the component was registered under
Returns:
the component registered

locateByType

public <T> T locateByType(java.lang.Class<T> t)
Description copied from interface: ComponentRegistry
Retrieve a component by type. Be cautious of making ambiguous requests.

Specified by:
locateByType in interface ComponentRegistry
Parameters:
t - the type of the component requested
Returns:
the component registered

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

getMethodDefinitionFinder

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

getMethodNameResolver

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

getBindErrorMessageResolver

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

getControllerDataBinder

public ControllerDataBinder getControllerDataBinder()
Specified by:
getControllerDataBinder in interface ComponentRegistry

getViewDataBinder

public ViewDataBinder getViewDataBinder()
Specified by:
getViewDataBinder in interface ComponentRegistry

getStringTransmuter

public StringTransmuter getStringTransmuter()
Specified by:
getStringTransmuter in interface ComponentRegistry

getValueConverterFinder

public ValueConverterFinder getValueConverterFinder()
Specified by:
getValueConverterFinder 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

getMessageResources

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

getActionMonitor

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

getBindMonitor

public BindMonitor getBindMonitor()
Specified by:
getBindMonitor in interface ComponentRegistry

getContextMonitor

public ContextMonitor getContextMonitor()
Specified by:
getContextMonitor in interface ComponentRegistry

getControllerMonitor

public ControllerMonitor getControllerMonitor()
Specified by:
getControllerMonitor in interface ComponentRegistry

getRegistrarMonitor

public RegistrarMonitor getRegistrarMonitor()
Specified by:
getRegistrarMonitor in interface ComponentRegistry

getServletMonitor

public ServletMonitor getServletMonitor()
Specified by:
getServletMonitor in interface ComponentRegistry

getValidator

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

getValidationMonitor

public ValidationMonitor getValidationMonitor()
Specified by:
getValidationMonitor in interface ComponentRegistry

getViewDispatcher

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

getViewMonitor

public ViewMonitor getViewMonitor()
Specified by:
getViewMonitor in interface ComponentRegistry

getViewResolver

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


Copyright © 2008. All Rights Reserved.