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, TransportListener
Direct Known Subclasses:
AxisAdminServlet

public class AxisServlet
extends HttpServlet
implements TransportListener

Class AxisServlet

See Also:
Serialized Form

Nested Class Summary
 class AxisServlet.ProcessRESTRequest
          Ues in processing REST related Requests.
protected  class AxisServlet.ServletRequestResponseTransport
           
 
Field Summary
protected  AxisConfiguration axisConfiguration
           
protected  ConfigurationContext configContext
           
static String CONFIGURATION_CONTEXT
           
protected  boolean disableREST
           
protected  ServletConfig servletConfig
           
static String SESSION_ID
           
 
Fields inherited from interface org.apache.axis2.transport.TransportListener
HOST_ADDRESS, PARAM_PORT
 
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 disableRESTErrorMessage(HttpServletResponse response)
          Private method that deals with disabling of REST support.
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
 EndpointReference getEPRForService(String serviceName, String ip)
           
 EndpointReference[] getEPRsForService(String serviceName, String ip)
           
 SessionContext getSessionContext(MessageContext messageContext)
          Transport session management.
protected  Map 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(ConfigurationContext axisConf, TransportInDescription transprtIn)
          init(); start() and stop() wouldn't do anything.
 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 initParams()
          Initializes the Axis2 parameters.
 void start()
           
 void stop()
           
 
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

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

disableRESTErrorMessage

protected void disableRESTErrorMessage(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 -
Throws:
ServletException

destroy

public void destroy()
distroy the ConfigurationContext

Specified by:
destroy in interface Servlet
Specified by:
destroy in interface TransportListener
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 getTransportHeaders(HttpServletRequest req)
Get all transport headers.

Parameters:
req -
Returns:
Map

getEPRForService

public EndpointReference getEPRForService(String serviceName,
                                          String ip)
                                   throws AxisFault
Specified by:
getEPRForService in interface TransportListener
Throws:
AxisFault

getEPRsForService

public EndpointReference[] getEPRsForService(String serviceName,
                                             String ip)
                                      throws AxisFault
Specified by:
getEPRsForService in interface TransportListener
Throws:
AxisFault

init

public void init(ConfigurationContext axisConf,
                 TransportInDescription transprtIn)
          throws AxisFault
init(); start() and stop() wouldn't do anything.

Specified by:
init in interface TransportListener
Parameters:
axisConf -
transprtIn -
Throws:
AxisFault

start

public void start()
           throws AxisFault
Specified by:
start in interface TransportListener
Throws:
AxisFault

stop

public void stop()
          throws AxisFault
Specified by:
stop in interface TransportListener
Throws:
AxisFault

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

getSessionContext

public SessionContext getSessionContext(MessageContext messageContext)
Transport session management.

Specified by:
getSessionContext in interface TransportListener
Parameters:
messageContext -
Returns:
SessionContext