Tue, 07 Nov 2017 18:54:04 -0800
Added tag jdk8u162-b06 for changeset 6095742f8034
aoqi@0 | 1 | /* |
aoqi@0 | 2 | * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
aoqi@0 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
aoqi@0 | 4 | * |
aoqi@0 | 5 | * This code is free software; you can redistribute it and/or modify it |
aoqi@0 | 6 | * under the terms of the GNU General Public License version 2 only, as |
aoqi@0 | 7 | * published by the Free Software Foundation. Oracle designates this |
aoqi@0 | 8 | * particular file as subject to the "Classpath" exception as provided |
aoqi@0 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
aoqi@0 | 10 | * |
aoqi@0 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
aoqi@0 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
aoqi@0 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
aoqi@0 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
aoqi@0 | 15 | * accompanied this code). |
aoqi@0 | 16 | * |
aoqi@0 | 17 | * You should have received a copy of the GNU General Public License version |
aoqi@0 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
aoqi@0 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
aoqi@0 | 20 | * |
aoqi@0 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
aoqi@0 | 22 | * or visit www.oracle.com if you need additional information or have any |
aoqi@0 | 23 | * questions. |
aoqi@0 | 24 | */ |
aoqi@0 | 25 | |
aoqi@0 | 26 | package javax.xml.ws; |
aoqi@0 | 27 | |
aoqi@0 | 28 | import java.util.concurrent.Future; |
aoqi@0 | 29 | |
aoqi@0 | 30 | /** The <code>Dispatch</code> interface provides support |
aoqi@0 | 31 | * for the dynamic invocation of a service endpoint operations. The |
aoqi@0 | 32 | * <code>javax.xml.ws.Service</code> |
aoqi@0 | 33 | * class acts as a factory for the creation of <code>Dispatch</code> |
aoqi@0 | 34 | * instances. |
aoqi@0 | 35 | * |
aoqi@0 | 36 | * @since JAX-WS 2.0 |
aoqi@0 | 37 | **/ |
aoqi@0 | 38 | public interface Dispatch<T> extends BindingProvider { |
aoqi@0 | 39 | |
aoqi@0 | 40 | /** Invoke a service operation synchronously. |
aoqi@0 | 41 | * |
aoqi@0 | 42 | * The client is responsible for ensuring that the <code>msg</code> object |
aoqi@0 | 43 | * when marshalled is formed according to the requirements of the protocol |
aoqi@0 | 44 | * binding in use. |
aoqi@0 | 45 | * |
aoqi@0 | 46 | * @param msg An object that will form the message or payload of |
aoqi@0 | 47 | * the message used to invoke the operation. |
aoqi@0 | 48 | * @return The response message or message payload to the |
aoqi@0 | 49 | * operation invocation. |
aoqi@0 | 50 | * @throws WebServiceException If a fault occurs during communication with |
aoqi@0 | 51 | * the service |
aoqi@0 | 52 | * @throws WebServiceException If there is any error in the configuration of |
aoqi@0 | 53 | * the <code>Dispatch</code> instance |
aoqi@0 | 54 | **/ |
aoqi@0 | 55 | public T invoke(T msg); |
aoqi@0 | 56 | |
aoqi@0 | 57 | /** Invoke a service operation asynchronously. The |
aoqi@0 | 58 | * method returns without waiting for the response to the operation |
aoqi@0 | 59 | * invocation, the results of the operation are obtained by polling the |
aoqi@0 | 60 | * returned <code>Response</code>. |
aoqi@0 | 61 | * <p> |
aoqi@0 | 62 | * The client is responsible for ensuring that the <code>msg</code> object |
aoqi@0 | 63 | * when marshalled is formed according to the requirements of the protocol |
aoqi@0 | 64 | * binding in use. |
aoqi@0 | 65 | * |
aoqi@0 | 66 | * @param msg An object that will form the message or payload of |
aoqi@0 | 67 | * the message used to invoke the operation. |
aoqi@0 | 68 | * @return The response message or message payload to the |
aoqi@0 | 69 | * operation invocation. |
aoqi@0 | 70 | * @throws WebServiceException If there is any error in the configuration of |
aoqi@0 | 71 | * the <code>Dispatch</code> instance |
aoqi@0 | 72 | **/ |
aoqi@0 | 73 | public Response<T> invokeAsync(T msg); |
aoqi@0 | 74 | |
aoqi@0 | 75 | /** Invoke a service operation asynchronously. The |
aoqi@0 | 76 | * method returns without waiting for the response to the operation |
aoqi@0 | 77 | * invocation, the results of the operation are communicated to the client |
aoqi@0 | 78 | * via the passed in <code>handler</code>. |
aoqi@0 | 79 | * <p> |
aoqi@0 | 80 | * The client is responsible for ensuring that the <code>msg</code> object |
aoqi@0 | 81 | * when marshalled is formed according to the requirements of the protocol |
aoqi@0 | 82 | * binding in use. |
aoqi@0 | 83 | * |
aoqi@0 | 84 | * @param msg An object that will form the message or payload of |
aoqi@0 | 85 | * the message used to invoke the operation. |
aoqi@0 | 86 | * @param handler The handler object that will receive the |
aoqi@0 | 87 | * response to the operation invocation. |
aoqi@0 | 88 | * @return A <code>Future</code> object that may be used to check the status |
aoqi@0 | 89 | * of the operation invocation. This object MUST NOT be used to try to |
aoqi@0 | 90 | * obtain the results of the operation - the object returned from |
aoqi@0 | 91 | * <code>Future<?>.get()</code> is implementation dependent |
aoqi@0 | 92 | * and any use of it will result in non-portable behaviour. |
aoqi@0 | 93 | * @throws WebServiceException If there is any error in the configuration of |
aoqi@0 | 94 | * the <code>Dispatch</code> instance |
aoqi@0 | 95 | **/ |
aoqi@0 | 96 | public Future<?> invokeAsync(T msg, AsyncHandler<T> handler); |
aoqi@0 | 97 | |
aoqi@0 | 98 | /** Invokes a service operation using the one-way |
aoqi@0 | 99 | * interaction mode. The operation invocation is logically non-blocking, |
aoqi@0 | 100 | * subject to the capabilities of the underlying protocol, no results |
aoqi@0 | 101 | * are returned. When |
aoqi@0 | 102 | * the protocol in use is SOAP/HTTP, this method MUST block until |
aoqi@0 | 103 | * an HTTP response code has been received or an error occurs. |
aoqi@0 | 104 | * <p> |
aoqi@0 | 105 | * The client is responsible for ensuring that the <code>msg</code> object |
aoqi@0 | 106 | * when marshalled is formed according to the requirements of the protocol |
aoqi@0 | 107 | * binding in use. |
aoqi@0 | 108 | * |
aoqi@0 | 109 | * @param msg An object that will form the message or payload of |
aoqi@0 | 110 | * the message used to invoke the operation. |
aoqi@0 | 111 | * @throws WebServiceException If there is any error in the configuration of |
aoqi@0 | 112 | * the <code>Dispatch</code> instance or if an error occurs during the |
aoqi@0 | 113 | * invocation. |
aoqi@0 | 114 | **/ |
aoqi@0 | 115 | public void invokeOneWay(T msg); |
aoqi@0 | 116 | } |