com.evelopers.unimod.adapter.servlet
Class HttpServletAdapter

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bycom.evelopers.unimod.adapter.servlet.HttpServletAdapter
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class HttpServletAdapter
extends javax.servlet.http.HttpServlet

Servlet Container Adapter for State Machine Engine.

Usual Servlet that parses request from client and pass it to state machien engine. Must be inited with state machine name (STATE_MACHINE_NAME) and config store (CONFIGURATION_STORE_CONTEXT).

On init tries to load given state machine with command getClass().getClassLoader().getResourceAsStream(stateMachineName + ".xml")

Possible values for config store are:

  • app - state machine config will be store in application context
  • user - state machine config will be store in user's session

    Example of part of web.xml that contains servlet adapter description:

    See Also:
    Serialized Form

    Field Summary
    static java.lang.String INIT_PARAMETER_DEBUG_MODE
               
    static java.lang.String INIT_PARAMETER_DEBUG_PORT
               
    static java.lang.String INIT_PARAMETER_EVENT_PROCESSOR_LISTENERS
               
    static java.lang.String INIT_PARAMETER_EXCEPTION_HANDLERS
               
    static java.lang.String INIT_PARAMETER_LOGGER_NAME
               
    static java.lang.String INIT_PARAMETER_MODEL_URL
               
    static java.lang.String INIT_PARAMETER_MUST_SUSPEND
               
    static java.lang.String PARAMETER_EVENT_NAME
               
    static java.lang.String PARAMETER_HTTP_REQUEST
               
    static java.lang.String PARAMETER_HTTP_RESPONSE
               
    static java.lang.String VALUE_CONSOLE_LOGGER
               
    static java.lang.String VALUE_DEBUG_MODE_ON
               
    static int VALUE_DEFAULT_PORT
               
     
    Constructor Summary
    HttpServletAdapter()
               
     
    Method Summary
     void destroy()
               
    protected  boolean getDebugMode(javax.servlet.ServletConfig config)
               
    protected  int getDebugPort(javax.servlet.ServletConfig config)
               
    protected  java.util.List getEventProcessorListeners(javax.servlet.ServletConfig config)
               
    protected  java.util.List getExceptionHandlers(javax.servlet.ServletConfig config)
               
    protected  java.lang.String getModelURL(javax.servlet.ServletConfig config)
               
    protected  boolean getMustSuspend(javax.servlet.ServletConfig config)
               
     void init(javax.servlet.ServletConfig config)
               
     void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
               
     
    Methods inherited from class javax.servlet.http.HttpServlet
    doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
     
    Methods inherited from class javax.servlet.GenericServlet
    getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    INIT_PARAMETER_MODEL_URL

    public static final java.lang.String INIT_PARAMETER_MODEL_URL
    See Also:
    Constant Field Values

    INIT_PARAMETER_LOGGER_NAME

    public static final java.lang.String INIT_PARAMETER_LOGGER_NAME
    See Also:
    Constant Field Values

    INIT_PARAMETER_DEBUG_MODE

    public static final java.lang.String INIT_PARAMETER_DEBUG_MODE
    See Also:
    Constant Field Values

    INIT_PARAMETER_DEBUG_PORT

    public static final java.lang.String INIT_PARAMETER_DEBUG_PORT
    See Also:
    Constant Field Values

    INIT_PARAMETER_MUST_SUSPEND

    public static final java.lang.String INIT_PARAMETER_MUST_SUSPEND
    See Also:
    Constant Field Values

    INIT_PARAMETER_EVENT_PROCESSOR_LISTENERS

    public static final java.lang.String INIT_PARAMETER_EVENT_PROCESSOR_LISTENERS
    See Also:
    Constant Field Values

    INIT_PARAMETER_EXCEPTION_HANDLERS

    public static final java.lang.String INIT_PARAMETER_EXCEPTION_HANDLERS
    See Also:
    Constant Field Values

    VALUE_CONSOLE_LOGGER

    public static final java.lang.String VALUE_CONSOLE_LOGGER
    See Also:
    Constant Field Values

    VALUE_DEBUG_MODE_ON

    public static final java.lang.String VALUE_DEBUG_MODE_ON
    See Also:
    Constant Field Values

    VALUE_DEFAULT_PORT

    public static final int VALUE_DEFAULT_PORT
    See Also:
    Constant Field Values

    PARAMETER_EVENT_NAME

    public static final java.lang.String PARAMETER_EVENT_NAME
    See Also:
    Constant Field Values

    PARAMETER_HTTP_REQUEST

    public static final java.lang.String PARAMETER_HTTP_REQUEST
    See Also:
    Constant Field Values

    PARAMETER_HTTP_RESPONSE

    public static final java.lang.String PARAMETER_HTTP_RESPONSE
    See Also:
    Constant Field Values
    Constructor Detail

    HttpServletAdapter

    public HttpServletAdapter()
    Method Detail

    init

    public void init(javax.servlet.ServletConfig config)
              throws javax.servlet.ServletException
    Throws:
    javax.servlet.ServletException

    destroy

    public void destroy()

    service

    public void service(javax.servlet.http.HttpServletRequest req,
                        javax.servlet.http.HttpServletResponse res)
                 throws javax.servlet.ServletException,
                        java.io.IOException
    Throws:
    javax.servlet.ServletException
    java.io.IOException

    getModelURL

    protected java.lang.String getModelURL(javax.servlet.ServletConfig config)
                                    throws javax.servlet.ServletException
    Throws:
    javax.servlet.ServletException

    getEventProcessorListeners

    protected java.util.List getEventProcessorListeners(javax.servlet.ServletConfig config)
                                                 throws com.evelopers.common.exception.SystemException
    Throws:
    com.evelopers.common.exception.SystemException

    getExceptionHandlers

    protected java.util.List getExceptionHandlers(javax.servlet.ServletConfig config)
                                           throws com.evelopers.common.exception.SystemException
    Throws:
    com.evelopers.common.exception.SystemException

    getDebugMode

    protected boolean getDebugMode(javax.servlet.ServletConfig config)
                            throws com.evelopers.common.exception.SystemException
    Throws:
    com.evelopers.common.exception.SystemException

    getDebugPort

    protected int getDebugPort(javax.servlet.ServletConfig config)

    getMustSuspend

    protected boolean getMustSuspend(javax.servlet.ServletConfig config)