com.sun.xml.ws.client.dispatch
Class DispatchImpl<T>

java.lang.Object
  extended by com.sun.xml.ws.client.Stub
      extended by com.sun.xml.ws.client.dispatch.DispatchImpl<T>
All Implemented Interfaces:
ResponseContextReceiver, WSBindingProvider, Closeable, javax.xml.ws.BindingProvider, javax.xml.ws.Dispatch<T>
Direct Known Subclasses:
DataSourceDispatch, JAXBDispatch, MessageDispatch, RESTSourceDispatch, SOAPMessageDispatch, SOAPSourceDispatch

public abstract class DispatchImpl<T>
extends Stub
implements javax.xml.ws.Dispatch<T>

The DispatchImpl abstract class provides support for the dynamic invocation of a service endpoint operation using XML constructs, JAXB objects or SOAPMessage. The javax.xml.ws.Service interface acts as a factory for the creation of DispatchImpl instances.


Field Summary
(package private) static long AWAIT_TERMINATION_TIME
           
(package private) static String HTTP_REQUEST_METHOD_GET
           
(package private) static String HTTP_REQUEST_METHOD_POST
           
(package private) static String HTTP_REQUEST_METHOD_PUT
           
(package private)  javax.xml.ws.Service.Mode mode
           
(package private)  QName portname
           
(package private)  SOAPVersion soapVersion
           
 
Fields inherited from class com.sun.xml.ws.client.Stub
addrVersion, binding, endpointReference, owner, requestContext, wsdlPort
 
Fields inherited from interface javax.xml.ws.BindingProvider
ENDPOINT_ADDRESS_PROPERTY, PASSWORD_PROPERTY, SESSION_MAINTAIN_PROPERTY, SOAPACTION_URI_PROPERTY, SOAPACTION_USE_PROPERTY, USERNAME_PROPERTY
 
Constructor Summary
protected DispatchImpl(QName port, javax.xml.ws.Service.Mode mode, WSServiceDelegate owner, Tube pipe, BindingImpl binding, WSEndpointReference epr)
           
 
Method Summary
(package private) static void checkNullAllowed(Object in, RequestContext rc, WSBinding binding, javax.xml.ws.Service.Mode mode)
           
static void checkValidDataSourceDispatch(WSBinding binding, javax.xml.ws.Service.Mode mode)
           
static void checkValidSOAPMessageDispatch(WSBinding binding, javax.xml.ws.Service.Mode mode)
           
(package private) abstract  Packet createPacket(T msg)
          Abstract method that is implemented by each concrete Dispatch class
static javax.xml.ws.Dispatch<Source> createSourceDispatch(QName port, javax.xml.ws.Service.Mode mode, WSServiceDelegate owner, Tube pipe, BindingImpl binding, WSEndpointReference epr)
           
 T doInvoke(T in, RequestContext rc, ResponseContextReceiver receiver)
          Synchronously invokes a service.
protected  QName getPortName()
          Gets the port name that this stub is configured to talk to.
 T invoke(T in)
           
 javax.xml.ws.Response<T> invokeAsync(T param)
           
 Future<?> invokeAsync(T param, javax.xml.ws.AsyncHandler<T> asyncHandler)
           
 void invokeOneWay(T in)
           
(package private) static boolean isPAYLOADMode(javax.xml.ws.Service.Mode mode)
           
(package private) static boolean isXMLHttp(WSBinding binding)
           
(package private) static boolean methodNotOk(RequestContext rc)
           
(package private)  void resolveEndpointAddress(Packet message, RequestContext requestContext)
           
protected  String resolveURI(URI endpointURI, String pathInfo, String queryString)
           
protected  AttachmentSet setOutboundAttachments()
           
 void setOutboundHeaders(Object... headers)
          Sets the out-bound headers to be added to messages sent from this BindingProvider.
(package private)  void setProperties(Packet packet, boolean expectReply)
           
(package private) abstract  T toReturnValue(Packet response)
          Obtains the value to return from the response message.
 
Methods inherited from class com.sun.xml.ws.client.Stub
close, getBinding, getEndpointReference, getEndpointReference, getExecutor, getInboundHeaders, getRequestContext, getResponseContext, getServiceName, process, processAsync, setAddress, setOutboundHeaders, setOutboundHeaders, setResponseContext, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.xml.ws.BindingProvider
getBinding, getEndpointReference, getEndpointReference, getRequestContext, getResponseContext
 

Field Detail

mode

final javax.xml.ws.Service.Mode mode

portname

final QName portname

soapVersion

final SOAPVersion soapVersion

AWAIT_TERMINATION_TIME

static final long AWAIT_TERMINATION_TIME
See Also:
Constant Field Values

HTTP_REQUEST_METHOD_GET

static final String HTTP_REQUEST_METHOD_GET
See Also:
Constant Field Values

HTTP_REQUEST_METHOD_POST

static final String HTTP_REQUEST_METHOD_POST
See Also:
Constant Field Values

HTTP_REQUEST_METHOD_PUT

static final String HTTP_REQUEST_METHOD_PUT
See Also:
Constant Field Values
Constructor Detail

DispatchImpl

protected DispatchImpl(QName port,
                       javax.xml.ws.Service.Mode mode,
                       WSServiceDelegate owner,
                       Tube pipe,
                       BindingImpl binding,
                       @Nullable
                       WSEndpointReference epr)
Parameters:
port - dispatch instance is asssociated with this wsdl port qName
mode - Service.mode associated with this Dispatch instance - Service.mode.MESSAGE or Service.mode.PAYLOAD
owner - Service that created the Dispatch
pipe - Master pipe for the pipeline
binding - Binding of this Dispatch instance, current one of SOAP/HTTP or XML/HTTP
Method Detail

createPacket

abstract Packet createPacket(T msg)
Abstract method that is implemented by each concrete Dispatch class

Parameters:
msg - message passed in from the client program on the invocation
Returns:
The Message created returned as the Interface in actuallity a concrete Message Type

toReturnValue

abstract T toReturnValue(Packet response)
Obtains the value to return from the response message.


invokeAsync

public final javax.xml.ws.Response<T> invokeAsync(T param)
Specified by:
invokeAsync in interface javax.xml.ws.Dispatch<T>

invokeAsync

public final Future<?> invokeAsync(T param,
                                   javax.xml.ws.AsyncHandler<T> asyncHandler)
Specified by:
invokeAsync in interface javax.xml.ws.Dispatch<T>

doInvoke

public final T doInvoke(T in,
                        RequestContext rc,
                        ResponseContextReceiver receiver)
Synchronously invokes a service. See Stub.process(Packet, RequestContext, ResponseContextReceiver) on why it takes a RequestContext and ResponseContextReceiver as a parameter.


invoke

public final T invoke(T in)
Specified by:
invoke in interface javax.xml.ws.Dispatch<T>

invokeOneWay

public final void invokeOneWay(T in)
Specified by:
invokeOneWay in interface javax.xml.ws.Dispatch<T>

setProperties

void setProperties(Packet packet,
                   boolean expectReply)

isXMLHttp

static boolean isXMLHttp(@NotNull
                         WSBinding binding)

isPAYLOADMode

static boolean isPAYLOADMode(@NotNull
                             javax.xml.ws.Service.Mode mode)

checkNullAllowed

static void checkNullAllowed(@Nullable
                             Object in,
                             RequestContext rc,
                             WSBinding binding,
                             javax.xml.ws.Service.Mode mode)

methodNotOk

static boolean methodNotOk(@NotNull
                           RequestContext rc)

checkValidSOAPMessageDispatch

public static void checkValidSOAPMessageDispatch(WSBinding binding,
                                                 javax.xml.ws.Service.Mode mode)

checkValidDataSourceDispatch

public static void checkValidDataSourceDispatch(WSBinding binding,
                                                javax.xml.ws.Service.Mode mode)

getPortName

@NotNull
protected final QName getPortName()
Description copied from class: Stub
Gets the port name that this stub is configured to talk to.

When Stub.wsdlPort is non-null, the port name is always the same as WSDLPort.getName(), but this method returns a port name even if no WSDL is available for this stub.

Specified by:
getPortName in class Stub

resolveEndpointAddress

void resolveEndpointAddress(@NotNull
                            Packet message,
                            @NotNull
                            RequestContext requestContext)

resolveURI

@NotNull
protected String resolveURI(@NotNull
                                    URI endpointURI,
                                    @Nullable
                                    String pathInfo,
                                    @Nullable
                                    String queryString)

setOutboundAttachments

protected AttachmentSet setOutboundAttachments()

setOutboundHeaders

public void setOutboundHeaders(Object... headers)
Description copied from interface: WSBindingProvider
Sets the out-bound headers to be added to messages sent from this BindingProvider.

Each object must be a JAXB-bound object that is understood by the JAXBContext object known by this WSBindingProvider (that is, if this is a Dispatch with JAXB, then JAXBContext given to Service.createDispatch(QName,JAXBContext,Mode) and if this is a typed proxy, then JAXBContext implicitly created by the JAX-WS RI.)

Specified by:
setOutboundHeaders in interface WSBindingProvider
Parameters:
headers - Can be null or empty.

createSourceDispatch

public static javax.xml.ws.Dispatch<Source> createSourceDispatch(QName port,
                                                                 javax.xml.ws.Service.Mode mode,
                                                                 WSServiceDelegate owner,
                                                                 Tube pipe,
                                                                 BindingImpl binding,
                                                                 WSEndpointReference epr)