javax.xml.messaging
Class  JAXMServlet
java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--javax.xml.messaging.JAXMServlet
- All Implemented Interfaces: 
- java.io.Serializable, Servlet, ServletConfig
- public abstract class JAXMServlet- extends HttpServlet
The superclass for components that
 live in a servlet container that receives JAXM messages.
 A JAXMServlet object is notified of a message's arrival
 using the HTTP-SOAP binding. 
 
 The JAXMServlet class is a support/utility class and is
 provided purely as a convenience.  It is not a mandatory component, and 
 there is no requirement that it be implemented or extended.
 
 Note that when a component that receives messages extends
 JAXMServlet, it also needs to implement either a
 ReqRespListener object or a 
 OnewayListener object,
 depending on whether the component is written for a request-response
 style of interaction or for a one-way (asynchronous) style of interaction.
- See Also: 
- Serialized Form
| Field Summary | 
| protected  MessageFactory | msgFactoryThe
 MessageFactoryobject that will be used internally
 to create theSOAPMessageobject to be passed to the
 methodonMessage. | 
 
 
 
 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
msgFactory
protected MessageFactory msgFactory
- The MessageFactoryobject that will be used internally
 to create theSOAPMessageobject to be passed to the
 methodonMessage. This new message will contain the data
 from the message that was posted to the servlet.  Using theMessageFactoryobject that is the value for this field 
 to create the new message ensures that the correct profile is used.
JAXMServlet
public JAXMServlet()
init
public void init(ServletConfig servletConfig)
          throws ServletException
- Initializes this JAXMServletobject using the givenServletConfigobject and initializing themsgFactoryfield with a defaultMessageFactoryobject.
- 
- Overrides:
- initin class- GenericServlet
 
- 
- Parameters:
- servletConfig- the- ServletConfigobject to be
        used in initializing this- JAXMServletobject
 
setMessageFactory
public void setMessageFactory(MessageFactory msgFactory)
- Sets this JAXMServletobject'smsgFactoryfield with the givenMessageFactoryobject.
 AMessageFactoryobject for a particular profile needs to
 be set before a message is received in order for the message to be 
 successfully internalized.
- 
- Parameters:
- msgFactory- the- MessageFactoryobject that will
        be used to create the- SOAPMessageobject that
        will be used to internalize the message that was posted to 
        the servlet
 
getHeaders
protected static MimeHeaders getHeaders(HttpServletRequest req)
- Returns a MimeHeadersobject that contains the headers
 in the givenHttpServletRequestobject.
- 
- Parameters:
- req- the- HttpServletRequestobject that a
        messaging provider sent to the servlet
- Returns:
- a new MimeHeadersobject containing the headers
         in the message sent to the servlet
 
putHeaders
protected static void putHeaders(MimeHeaders headers,
                                 HttpServletResponse res)
- Sets the given HttpServletResponseobject with the
 headers in the givenMimeHeadersobject.
- 
- Parameters:
- headers- the- MimeHeadersobject containing the
        the headers in the message sent to the servlet
- res- the- HttpServletResponseobject to which the
        headers are to be written
- See Also: 
- getHeaders(javax.servlet.http.HttpServletRequest)
 
doPost
public void doPost(HttpServletRequest req,
                   HttpServletResponse resp)
            throws ServletException,
                   java.io.IOException
- Internalizes the given HttpServletRequestobject
 and writes the reply to the givenHttpServletResponseobject.
 Note that the value for the msgFactoryfield will be used to
 internalize the message. This ensures that the message
 factory for the correct profile is used.
 
- 
- Overrides:
- doPostin class- HttpServlet
 
- 
- Parameters:
- req- the- HttpServletRequestobject containing the
        message that was sent to the servlet
- resp- the- HttpServletResponseobject to which the
        response to the message will be written
- Throws:
- ServletException- if there is a servlet error
- java.io.IOException- if there is an input or output error