org.apache.axis2.transport.http
Class AxisServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.apache.axis2.transport.http.AxisServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig
Direct Known Subclasses:
AxisAdminServlet, OSGiAxisServlet

public class AxisServlet
extends HttpServlet

Servlet implementing the HTTP and HTTPS transport. Note that this class doesn't implement TransportListener. There are two reasons for this:

The TransportListener implementation is provided by AxisServletListener. An instance of that class must be declared in axis2.xml for each protocol (HTTP/HTTPS) that the servlet should accept.

See Also:
Serialized Form

Nested Class Summary
protected  class AxisServlet.RestRequestProcessor
          Ues in processing REST related Requests.
protected  class AxisServlet.ServletRequestResponseTransport
           
 
Field Summary
protected  ListingAgent agent
           
protected  AxisConfiguration axisConfiguration
           
protected  ConfigurationContext configContext
           
static String CONFIGURATION_CONTEXT
           
protected  String contextRoot
           
protected  boolean disableREST
           
protected  ServletConfig servletConfig
           
static String SESSION_ID
           
 
Constructor Summary
AxisServlet()
           
 
Method Summary
protected  MessageContext createMessageContext(HttpServletRequest req, HttpServletResponse resp)
          This method assumes, that the created MessageContext will be used in only SOAP invocation.
protected  MessageContext createMessageContext(HttpServletRequest request, HttpServletResponse response, boolean invocationType)
           
 void destroy()
          distroy the ConfigurationContext
protected  void doDelete(HttpServletRequest request, HttpServletResponse response)
          Implementation of DELETE interface
protected  void doGet(HttpServletRequest request, HttpServletResponse response)
          Implementation for GET interface
protected  void doPost(HttpServletRequest request, HttpServletResponse response)
          Implementaion of POST interface
protected  void doPut(HttpServletRequest request, HttpServletResponse response)
          Implementation of PUT interface
protected  Map<String,String> getTransportHeaders(HttpServletRequest req)
          Get all transport headers.
protected  void handleFault(MessageContext msgContext, OutputStream out, AxisFault e)
           
 void init()
          Convenient method to re-initialize the ConfigurationContext
 void init(ServletConfig config)
          Main init method
protected  ConfigurationContext initConfigContext(ServletConfig config)
          Initialize the Axis configuration context
 void initContextRoot(HttpServletRequest req)
          Set the context root if it is not set already.
protected  void initGetRequestProcessors(ServletConfig config)
          Initialize HTTP GET request processors
protected  void initParams()
          Initializes the Axis2 parameters.
protected  void initTransports()
          Initialize HTTP transports
protected  void showRestDisabledErrorMessage(HttpServletResponse response)
          Private method that deals with disabling of REST support.
 
Methods inherited from class javax.servlet.http.HttpServlet
doHead, doOptions, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIGURATION_CONTEXT

public static final String CONFIGURATION_CONTEXT
See Also:
Constant Field Values

SESSION_ID

public static final String SESSION_ID
See Also:
Constant Field Values

configContext

protected transient ConfigurationContext configContext

axisConfiguration

protected transient AxisConfiguration axisConfiguration

servletConfig

protected transient ServletConfig servletConfig

agent

protected transient ListingAgent agent

contextRoot

protected transient String contextRoot

disableREST

protected boolean disableREST
Constructor Detail

AxisServlet

public AxisServlet()
Method Detail

doPost

protected void doPost(HttpServletRequest request,
                      HttpServletResponse response)
               throws ServletException,
                      IOException
Implementaion of POST interface

Overrides:
doPost in class HttpServlet
Parameters:
request -
response -
Throws:
ServletException
IOException

doGet

protected void doGet(HttpServletRequest request,
                     HttpServletResponse response)
              throws ServletException,
                     IOException
Implementation for GET interface

Overrides:
doGet in class HttpServlet
Parameters:
request -
response -
Throws:
ServletException
IOException

doDelete

protected void doDelete(HttpServletRequest request,
                        HttpServletResponse response)
                 throws ServletException,
                        IOException
Implementation of DELETE interface

Overrides:
doDelete in class HttpServlet
Parameters:
request -
response -
Throws:
ServletException
IOException

doPut

protected void doPut(HttpServletRequest request,
                     HttpServletResponse response)
              throws ServletException,
                     IOException
Implementation of PUT interface

Overrides:
doPut in class HttpServlet
Parameters:
request -
response -
Throws:
ServletException
IOException

showRestDisabledErrorMessage

protected void showRestDisabledErrorMessage(HttpServletResponse response)
                                     throws IOException
Private method that deals with disabling of REST support.

Parameters:
response -
Throws:
IOException

handleFault

protected void handleFault(MessageContext msgContext,
                           OutputStream out,
                           AxisFault e)
                    throws AxisFault
Throws:
AxisFault

init

public void init(ServletConfig config)
          throws ServletException
Main init method

Specified by:
init in interface Servlet
Overrides:
init in class GenericServlet
Parameters:
config - The ServletConfig
Throws:
ServletException

initGetRequestProcessors

protected void initGetRequestProcessors(ServletConfig config)
Initialize HTTP GET request processors

Parameters:
config - The ServletConfig of this Servlet

initTransports

protected void initTransports()
                       throws AxisFault
Initialize HTTP transports

Throws:
AxisFault - If an error occurs while initializing transports

destroy

public void destroy()
distroy the ConfigurationContext

Specified by:
destroy in interface Servlet
Overrides:
destroy in class GenericServlet

initParams

protected void initParams()
Initializes the Axis2 parameters.


init

public void init()
          throws ServletException
Convenient method to re-initialize the ConfigurationContext

Overrides:
init in class GenericServlet
Throws:
ServletException

initConfigContext

protected ConfigurationContext initConfigContext(ServletConfig config)
                                          throws ServletException
Initialize the Axis configuration context

Parameters:
config - Servlet configuration
Returns:
ConfigurationContext
Throws:
ServletException

initContextRoot

public void initContextRoot(HttpServletRequest req)
Set the context root if it is not set already.

Parameters:
req -

getTransportHeaders

protected Map<String,String> getTransportHeaders(HttpServletRequest req)
Get all transport headers.

Parameters:
req -
Returns:
Map

createMessageContext

protected MessageContext createMessageContext(HttpServletRequest request,
                                              HttpServletResponse response,
                                              boolean invocationType)
                                       throws IOException
Parameters:
request -
response -
invocationType - : If invocationType=true; then this will be used in SOAP message invocation. If invocationType=false; then this will be used in REST message invocation.
Returns:
MessageContext
Throws:
IOException

createMessageContext

protected MessageContext createMessageContext(HttpServletRequest req,
                                              HttpServletResponse resp)
                                       throws IOException
This method assumes, that the created MessageContext will be used in only SOAP invocation.

Parameters:
req -
resp -
Returns:
MessageContext
Throws:
IOException


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.