wicket.request.compound
Class CompoundRequestCycleProcessor

java.lang.Object
  extended by wicket.request.compound.AbstractCompoundRequestCycleProcessor
      extended by wicket.request.compound.CompoundRequestCycleProcessor
All Implemented Interfaces:
IRequestCycleProcessor
Direct Known Subclasses:
DefaultWebRequestCycleProcessor, PortletActionRequestCycleProcessor, PortletRenderRequestCycleProcessor

public class CompoundRequestCycleProcessor
extends AbstractCompoundRequestCycleProcessor

Default implementation of AbstractCompoundRequestCycleProcessor that expects the delegate strategies to be set once at construction time.

This class call the appropriate factory methods to lazily create the strategies if they were not set at construction time. After that the strategies are cached and used for multiple thread access. Hence, if you use this class, your strategies need to be thread safe. If this is not what you want, consider overriding one of the getXXX methods, in which case the newXXX methods will obviously not be used unless you call them directly.

Author:
Eelco Hillenius

Constructor Summary
CompoundRequestCycleProcessor()
          Default constructor.
CompoundRequestCycleProcessor(IRequestCodingStrategy requestCodingStrategy)
          Constructor with the only strategy we don't have a default for.
CompoundRequestCycleProcessor(IRequestCodingStrategy requestCodingStrategy, IRequestTargetResolverStrategy requestTargetResolverStrategy, IEventProcessorStrategy eventProcessorStrategy, IResponseStrategy responseStrategy, IExceptionResponseStrategy exceptionResponseStrategy)
          Bulk constructor.
 
Method Summary
protected  IEventProcessorStrategy getEventProcessorStrategy()
          Gets the cached event processor instance or create one by calling newEventProcessorStrategy().
protected  IExceptionResponseStrategy getExceptionResponseStrategy()
          Gets the cached exception response strategy instance or create one by calling newExceptionResponseStrategy().
 IRequestCodingStrategy getRequestCodingStrategy()
          Gets the cached request encoder instance or create one by calling newRequestCodingStrategy().
protected  IRequestTargetResolverStrategy getRequestTargetResolverStrategy()
          Gets the cached target resolver instance or create one by calling newRequestTargetResolverStrategy().
protected  IResponseStrategy getResponseStrategy()
          Gets the cached response strategy instance or create one by calling newResponseStrategy().
protected  IEventProcessorStrategy newEventProcessorStrategy()
          Overridable factory method for creating the event processor.
protected  IExceptionResponseStrategy newExceptionResponseStrategy()
          Overridable factory method for creating the exception response strategy.
protected  IRequestCodingStrategy newRequestCodingStrategy()
          Overridable factory method for creating the request encoder.
protected  IRequestTargetResolverStrategy newRequestTargetResolverStrategy()
          Overridable factory method for creating the target resolver strategy.
protected  IResponseStrategy newResponseStrategy()
          Overridable factory method for creating the response strategy.
 
Methods inherited from class wicket.request.compound.AbstractCompoundRequestCycleProcessor
processEvents, resolve, respond, respond
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundRequestCycleProcessor

public CompoundRequestCycleProcessor()
Default constructor. If you use this constructor, please note that it will fall back on calling the factory methods (newXXX), which may or may not provide a default. Some implementations need to be provided still; if they are not, an exception will be thrown.


CompoundRequestCycleProcessor

public CompoundRequestCycleProcessor(IRequestCodingStrategy requestCodingStrategy)
Constructor with the only strategy we don't have a default for.

Parameters:
requestCodingStrategy - the strategy for constructing request parameters

CompoundRequestCycleProcessor

public CompoundRequestCycleProcessor(IRequestCodingStrategy requestCodingStrategy,
                                     IRequestTargetResolverStrategy requestTargetResolverStrategy,
                                     IEventProcessorStrategy eventProcessorStrategy,
                                     IResponseStrategy responseStrategy,
                                     IExceptionResponseStrategy exceptionResponseStrategy)
Bulk constructor. Constructs using the given strategies; all of which may be null in which case the factory methods will be used.

Parameters:
requestCodingStrategy - the strategy for constructing request parameters
requestTargetResolverStrategy - the strategy for the target resolver method
eventProcessorStrategy - the strategy for the event processor method
responseStrategy - the strategy for the response method
exceptionResponseStrategy - the strategy for the exception response method
Method Detail

getRequestCodingStrategy

public IRequestCodingStrategy getRequestCodingStrategy()
Gets the cached request encoder instance or create one by calling newRequestCodingStrategy().

Returns:
the request encoder
See Also:
IRequestCycleProcessor.getRequestCodingStrategy()

getEventProcessorStrategy

protected IEventProcessorStrategy getEventProcessorStrategy()
Gets the cached event processor instance or create one by calling newEventProcessorStrategy().

Specified by:
getEventProcessorStrategy in class AbstractCompoundRequestCycleProcessor
Returns:
the strategy for the event process method
See Also:
AbstractCompoundRequestCycleProcessor.getEventProcessorStrategy()

getExceptionResponseStrategy

protected IExceptionResponseStrategy getExceptionResponseStrategy()
Gets the cached exception response strategy instance or create one by calling newExceptionResponseStrategy().

Specified by:
getExceptionResponseStrategy in class AbstractCompoundRequestCycleProcessor
Returns:
the strategy for the exception response method
See Also:
AbstractCompoundRequestCycleProcessor.getExceptionResponseStrategy()

getRequestTargetResolverStrategy

protected IRequestTargetResolverStrategy getRequestTargetResolverStrategy()
Gets the cached target resolver instance or create one by calling newRequestTargetResolverStrategy().

Specified by:
getRequestTargetResolverStrategy in class AbstractCompoundRequestCycleProcessor
Returns:
the strategy for the resolve method
See Also:
AbstractCompoundRequestCycleProcessor.getRequestTargetResolverStrategy()

getResponseStrategy

protected IResponseStrategy getResponseStrategy()
Gets the cached response strategy instance or create one by calling newResponseStrategy().

Specified by:
getResponseStrategy in class AbstractCompoundRequestCycleProcessor
Returns:
the strategy for the response method
See Also:
AbstractCompoundRequestCycleProcessor.getResponseStrategy()

newEventProcessorStrategy

protected IEventProcessorStrategy newEventProcessorStrategy()
Overridable factory method for creating the event processor. Called by getEventProcessorStrategy().

Returns:
a new event processor instance

newExceptionResponseStrategy

protected IExceptionResponseStrategy newExceptionResponseStrategy()
Overridable factory method for creating the exception response strategy. Called by getExceptionResponseStrategy().

Returns:
a new response strategy instance

newRequestCodingStrategy

protected IRequestCodingStrategy newRequestCodingStrategy()
Overridable factory method for creating the request encoder. Called by getRequestCodingStrategy(). as there is no generic default for the request encoder, this method throws an exception by default. You either have to provide an instance as a constructor argument, or override this method or getRequestCodingStrategy().

Returns:
a new target resolver instance

newRequestTargetResolverStrategy

protected IRequestTargetResolverStrategy newRequestTargetResolverStrategy()
Overridable factory method for creating the target resolver strategy. Called by getRequestTargetResolverStrategy().

Returns:
a new target resolver instance

newResponseStrategy

protected IResponseStrategy newResponseStrategy()
Overridable factory method for creating the response strategy. Called by getResponseStrategy().

Returns:
a new response strategy instance


Copyright © 2004-2007 Wicket developers. All Rights Reserved.