org.inria.ns.reflex.modules.web
Class ServiceAction

java.lang.Object
  extended by org.inria.ns.reflex.processor.core.AbstractAction
      extended by org.inria.ns.reflex.modules.web.ServiceAction
All Implemented Interfaces:
Executable, Presentable, NamespaceContextFactory

public class ServiceAction
extends AbstractAction

The <web:service> element is the root element of an Active Sheet XML document that handles HTTP requests.

It selects the service to call.

A service is used by a servlet.

Author:
Philippe Poulard
See Also:
ReflexServlet

Nested Class Summary
 
Nested classes/interfaces inherited from class org.inria.ns.reflex.processor.core.AbstractAction
AbstractAction.ParameterAdapter, AbstractAction.UselessAction
 
Field Summary
 
Fields inherited from class org.inria.ns.reflex.processor.core.AbstractAction
actions, parent, processorInstance
 
Constructor Summary
ServiceAction(String characterEncoding, Node node, AbstractAction parent)
          Creates a new instance of ServiceAction.
 
Method Summary
 void addAction(AbstractAction action)
          Filters the actions to add : only MappingActions and Fallback are added, other are discarded (<web:init> registers itself to the logic procedures).
 void setCharacterEncoding(HttpServletRequest request)
          Set the character encoding specified in this service to the request if it doesn't have one.
static AbstractAction unmarshal(AbstractAction parent, Element element)
          XML unmarshaller for ServiceAction.
 
Methods inherited from class org.inria.ns.reflex.processor.core.AbstractAction
addFallbackAction, createContext, getCanonicalPath, getFallbackAction, getLocalFallbackAction, getLogger, getNamespaceContext, getNode, getParent, recover, recover, removeFallbackAction, reorganize, run, runAction, runActions, toPrettyString, toPrettyString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceAction

public ServiceAction(String characterEncoding,
                     Node node,
                     AbstractAction parent)
Creates a new instance of ServiceAction.

Parameters:
characterEncoding - The character encoding to set on requests that doesn't specify any.
node - The node from which the action has been unmarshalled. Used for namespace prefix resolution when performing XPath expressions.
parent - The action depending from.
Method Detail

unmarshal

public static AbstractAction unmarshal(AbstractAction parent,
                                       Element element)
                                throws XMLException
XML unmarshaller for ServiceAction.

Parameters:
parent - The action depending from
element - The XML element to unmarshall.
Returns:
The ServiceAction created.
Throws:
UnmarshalException - When the element and its content is not those expected.
XMLException

addAction

public void addAction(AbstractAction action)
Filters the actions to add : only MappingActions and Fallback are added, other are discarded (<web:init> registers itself to the logic procedures).

Overrides:
addAction in class AbstractAction
Parameters:
action - The child action to add.
See Also:
AbstractAction.addAction(AbstractAction)

setCharacterEncoding

public void setCharacterEncoding(HttpServletRequest request)
                          throws UnsupportedEncodingException
Set the character encoding specified in this service to the request if it doesn't have one.

Parameters:
request - The request.
Throws:
UnsupportedEncodingException - If the encoding is not supported.