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:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, TransportListener
Direct Known Subclasses:
AxisAdminServlet

public class AxisServlet
extends javax.servlet.http.HttpServlet
implements TransportListener

Class AxisServlet

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 java.lang.String CONFIGURATION_CONTEXT
           
protected  java.lang.String contextRoot
           
protected  boolean disableREST
           
protected  javax.servlet.ServletConfig servletConfig
           
static java.lang.String SESSION_ID
           
 
Fields inherited from interface org.apache.axis2.transport.TransportListener
HOST_ADDRESS, PARAM_PORT
 
Constructor Summary
AxisServlet()
           
 
Method Summary
protected  MessageContext createMessageContext(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          This method assumes, that the created MessageContext will be used in only SOAP invocation.
protected  MessageContext createMessageContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean invocationType)
           
 void destroy()
          distroy the ConfigurationContext
protected  void doDelete(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Implementation of DELETE interface
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Implementation for GET interface
protected  void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Implementaion of POST interface
protected  void doPut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Implementation of PUT interface
 EndpointReference getEPRForService(java.lang.String serviceName, java.lang.String ip)
           
 EndpointReference[] getEPRsForService(java.lang.String serviceName, java.lang.String ip)
           
 SessionContext getSessionContext(MessageContext messageContext)
          Transport session management.
protected  java.util.Map getTransportHeaders(javax.servlet.http.HttpServletRequest req)
          Get all transport headers.
protected  void handleFault(MessageContext msgContext, java.io.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(javax.servlet.ServletConfig config)
          Main init method
protected  ConfigurationContext initConfigContext(javax.servlet.ServletConfig config)
          Initialize the Axis configuration context
 void initContextRoot(javax.servlet.http.HttpServletRequest req)
          Set the context root if it is not set already.
protected  void initParams()
          Initializes the Axis2 parameters.
protected  void showRestDisabledErrorMessage(javax.servlet.http.HttpServletResponse response)
          Private method that deals with disabling of REST support.
 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 java.lang.String CONFIGURATION_CONTEXT
See Also:
Constant Field Values

SESSION_ID

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

configContext

protected transient ConfigurationContext configContext

axisConfiguration

protected transient AxisConfiguration axisConfiguration

servletConfig

protected transient javax.servlet.ServletConfig servletConfig

agent

protected transient ListingAgent agent

contextRoot

protected transient java.lang.String contextRoot

disableREST

protected boolean disableREST
Constructor Detail

AxisServlet

public AxisServlet()
Method Detail

doPost

protected void doPost(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      java.io.IOException
Implementaion of POST interface

Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
request -
response -
Throws:
javax.servlet.ServletException
java.io.IOException

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     java.io.IOException
Implementation for GET interface

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request -
response -
Throws:
javax.servlet.ServletException
java.io.IOException

doDelete

protected void doDelete(javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
                 throws javax.servlet.ServletException,
                        java.io.IOException
Implementation of DELETE interface

Overrides:
doDelete in class javax.servlet.http.HttpServlet
Parameters:
request -
response -
Throws:
javax.servlet.ServletException
java.io.IOException

doPut

protected void doPut(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     java.io.IOException
Implementation of PUT interface

Overrides:
doPut in class javax.servlet.http.HttpServlet
Parameters:
request -
response -
Throws:
javax.servlet.ServletException
java.io.IOException

showRestDisabledErrorMessage

protected void showRestDisabledErrorMessage(javax.servlet.http.HttpServletResponse response)
                                     throws java.io.IOException
Private method that deals with disabling of REST support.

Parameters:
response -
Throws:
java.io.IOException

handleFault

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

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Main init method

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
config -
Throws:
javax.servlet.ServletException

destroy

public void destroy()
distroy the ConfigurationContext

Specified by:
destroy in interface javax.servlet.Servlet
Specified by:
destroy in interface TransportListener
Overrides:
destroy in class javax.servlet.GenericServlet

initParams

protected void initParams()
Initializes the Axis2 parameters.


init

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

Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

initConfigContext

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

Parameters:
config - Servlet configuration
Returns:
ConfigurationContext
Throws:
javax.servlet.ServletException

initContextRoot

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

Parameters:
req -

getTransportHeaders

protected java.util.Map getTransportHeaders(javax.servlet.http.HttpServletRequest req)
Get all transport headers.

Parameters:
req -
Returns:
Map

getEPRForService

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

getEPRsForService

public EndpointReference[] getEPRsForService(java.lang.String serviceName,
                                             java.lang.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(javax.servlet.http.HttpServletRequest request,
                                              javax.servlet.http.HttpServletResponse response,
                                              boolean invocationType)
                                       throws java.io.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:
java.io.IOException

createMessageContext

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

Parameters:
req -
resp -
Returns:
MessageContext
Throws:
java.io.IOException

getSessionContext

public SessionContext getSessionContext(MessageContext messageContext)
Transport session management.

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


Copyright © 2007 Apache Web Services Project. All Rights Reserved.