Home » xml-commons-external-1.4.01-src » javax » xml » messaging » [javadoc | source]

    1   /*
    2    * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    3    *
    4    * Copyright 2000-2007 Sun Microsystems, Inc. All rights reserved. 
    5    *
    6    * The contents of this file are subject to the terms of either the GNU
    7    * General Public License Version 2 only ("GPL") or the Common Development
    8    * and Distribution License ("CDDL") (collectively, the "License").  You may
    9    * not use this file except in compliance with the License.  You can obtain
   10    * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
   11    * or mq/legal/LICENSE.txt.  See the License for the specific language
   12    * governing permissions and limitations under the License.
   13    * 
   14    * When distributing the software, include this License Header Notice in each
   15    * file and include the License file at mq/legal/LICENSE.txt.  Sun designates
   16    * this particular file as subject to the "Classpath" exception as provided by
   17    * Sun in the GPL Version 2 section of the License file that accompanied this
   18    * code.  If applicable, add the following below the License Header, with the
   19    * fields enclosed by brackets [] replaced by your own identifying information:
   20    * "Portions Copyrighted [year] [name of copyright owner]"
   21    * 
   22    * Contributor(s):
   23    * 
   24    * If you wish your version of this file to be governed by only the CDDL or
   25    * only the GPL Version 2, indicate your decision by adding "[Contributor]
   26    * elects to include this software in this distribution under the [CDDL or GPL
   27    * Version 2] license."  If you don't indicate a single choice of license, a
   28    * recipient has the option to distribute your version of this file under
   29    * either the CDDL, the GPL Version 2 or  to extend the choice of license to
   30    * its licensees as provided above.  However, if you add GPL Version 2 code
   31    * and therefore, elected the GPL Version 2 license, then the option applies
   32    * only if the new code is made subject to such option by the copyright holder. 
   33    */
   34   
   35   /*
   36    * @(#)ReqRespListener.java	1.4 07/02/07
   37    */ 
   38   
   39   package javax.xml.messaging;
   40   
   41   import javax.xml.soap;
   42   
   43   /**
   44    * A marker interface for components that are 
   45    * intended to be consumers of request-response messages.
   46    * In the request-response style of messaging, sending a request and receiving
   47    * the response are both done in a single operation. This means that the 
   48    * client sending the request cannot do anything else until after it has
   49    * received the response.
   50    * <P>
   51    * From the standpoint of the
   52    * sender, a message is sent via the <code>SOAPConnection</code> method
   53    * <code>call</code> in a point-to-point fashion.  The method <code>call</code>
   54    * blocks, waiting until it gets a  response message that it can return.  
   55    * The sender may be a standalone client, or it may be deployed in a container.
   56    * <P>
   57    * The receiver, typically a service operating in a servlet, implements the 
   58    * <code>ReqRespListener</code> method <code>onMessage</code> to specify
   59    * how to respond to the requests it receives.
   60    *<P>
   61    * It is possible that a standalone client might use the method <code>call</code>
   62    * to send a message that does not require a response.  For such cases,
   63    * the receiver must implement the method <code>onMessage</code> such that 
   64    * it returns a message whose only purpose is to unblock the 
   65    * <code>call</code> method.
   66    *
   67    * @see JAXMServlet
   68    * @see OnewayListener
   69    * @see javax.xml.soap.SOAPConnection#call
   70    */
   71   public interface ReqRespListener {
   72   
   73       /**
   74        * Passes the given <code>SOAPMessage</code> object to this
   75        * <code>ReqRespListener</code> object and returns the response.  
   76        * This method is invoked behind the scenes, typically by the
   77        * container (servlet or EJB container) after the messaging provider
   78        * delivers the message to the container. 
   79        *
   80        * It is expected that EJB Containers will deliver JAXM messages
   81        * to EJB components using message driven Beans that implement the
   82        * <code>javax.xml.messaging.ReqRespListener</code> interface.
   83        *
   84        * @param message the <code>SOAPMessage</code> object to be passed to this
   85        *                <code>ReqRespListener</code> object
   86        *
   87        * @return the response. If this is <code>null</code>, then the
   88        *         original message is treated as a "oneway" message.
   89        */
   90       public SOAPMessage onMessage(SOAPMessage message);
   91   }

Home » xml-commons-external-1.4.01-src » javax » xml » messaging » [javadoc | source]