com.sun.xml.ws.api.pipe
Class Stubs

java.lang.Object
  extended by com.sun.xml.ws.api.pipe.Stubs

public abstract class Stubs
extends Object

Factory methods of various stubs.

This class provides various methods to create "stub"s, which are the component that turns a method invocation into a Message and back into a return value.

This class is meant to serve as the API from JAX-WS to Tango, so that they don't have hard-code dependency on our implementation classes.

Common Parameters and Their Meanings

Pipe next

Stubs turn a method invocation into a Pipe.process(com.sun.xml.ws.api.message.Packet) invocation, and this pipe passed in as the next parameter will receive a Message from newly created stub.

BindingImpl binding

Stubs implement BindingProvider, and its BindingProvider.getBinding() will return this binding object. Stubs often also use this information to decide which SOAP version a Message should be created in.

WSService service

This object represents a Service that owns the newly created stub. For example, asynchronous method invocation will use Service.getExecutor().

WSEndpointReference epr

If you want the created Dispatch to talk to the given EPR, specify the parameter. Otherwise leave it null. Note that the addressing needs to be enabled separately for this to take effect.


Method Summary
static javax.xml.ws.Dispatch<javax.activation.DataSource> createDataSourceDispatch(QName portName, WSService owner, WSBinding binding, javax.xml.ws.Service.Mode mode, Tube next, WSEndpointReference epr)
          Creates a new Dispatch stub for DataSource.
static
<T> javax.xml.ws.Dispatch<T>
createDispatch(QName portName, WSService owner, WSBinding binding, Class<T> clazz, javax.xml.ws.Service.Mode mode, Tube next, WSEndpointReference epr)
          Creates a new Dispatch stub that connects to the given pipe.
static javax.xml.ws.Dispatch<Object> createJAXBDispatch(QName portName, WSService owner, WSBinding binding, JAXBContext jaxbContext, javax.xml.ws.Service.Mode mode, Tube next, WSEndpointReference epr)
          Creates a new JAXB-based Dispatch stub that connects to the given pipe.
static javax.xml.ws.Dispatch<Message> createMessageDispatch(QName portName, WSService owner, WSBinding binding, Tube next, WSEndpointReference epr)
          Creates a new Message-based Dispatch stub that connects to the given pipe.
<T> T
createPortProxy(WSService service, WSBinding binding, SEIModel model, Class<T> portInterface, Tube next, WSEndpointReference epr)
          Creates a new strongly-typed proxy object that implements a given port interface.
static javax.xml.ws.Dispatch<javax.xml.soap.SOAPMessage> createSAAJDispatch(QName portName, WSService owner, WSBinding binding, javax.xml.ws.Service.Mode mode, Tube next, WSEndpointReference epr)
          Creates a new Dispatch stub for SOAPMessage.
static javax.xml.ws.Dispatch<Source> createSourceDispatch(QName portName, WSService owner, WSBinding binding, javax.xml.ws.Service.Mode mode, Tube next, WSEndpointReference epr)
          Creates a new Dispatch stub for Source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createSAAJDispatch

public static javax.xml.ws.Dispatch<javax.xml.soap.SOAPMessage> createSAAJDispatch(QName portName,
                                                                                   WSService owner,
                                                                                   WSBinding binding,
                                                                                   javax.xml.ws.Service.Mode mode,
                                                                                   Tube next,
                                                                                   @Nullable
                                                                                   WSEndpointReference epr)
Creates a new Dispatch stub for SOAPMessage. This is short-cut of calling
 createDispatch(port,owner,binding,SOAPMessage.class,mode,next);
 


createDataSourceDispatch

public static javax.xml.ws.Dispatch<javax.activation.DataSource> createDataSourceDispatch(QName portName,
                                                                                          WSService owner,
                                                                                          WSBinding binding,
                                                                                          javax.xml.ws.Service.Mode mode,
                                                                                          Tube next,
                                                                                          @Nullable
                                                                                          WSEndpointReference epr)
Creates a new Dispatch stub for DataSource. This is short-cut of calling
 createDispatch(port,owner,binding,DataSource.class,mode,next);
 


createSourceDispatch

public static javax.xml.ws.Dispatch<Source> createSourceDispatch(QName portName,
                                                                 WSService owner,
                                                                 WSBinding binding,
                                                                 javax.xml.ws.Service.Mode mode,
                                                                 Tube next,
                                                                 @Nullable
                                                                 WSEndpointReference epr)
Creates a new Dispatch stub for Source. This is short-cut of calling
 createDispatch(port,owner,binding,Source.class,mode,next);
 


createDispatch

public static <T> javax.xml.ws.Dispatch<T> createDispatch(QName portName,
                                                          WSService owner,
                                                          WSBinding binding,
                                                          Class<T> clazz,
                                                          javax.xml.ws.Service.Mode mode,
                                                          Tube next,
                                                          @Nullable
                                                          WSEndpointReference epr)
Creates a new Dispatch stub that connects to the given pipe.

Parameters:
portName - see Service.createDispatch(QName, Class, Service.Mode).
owner - see common parameters
binding - see common parameters
clazz - Type of the Dispatch to be created. See Service.createDispatch(QName, Class, Service.Mode).
mode - The mode of the dispatch. See Service.createDispatch(QName, Class, Service.Mode).
next - see common parameters
epr - see common parameters TODO: are these parameters making sense?

createJAXBDispatch

public static javax.xml.ws.Dispatch<Object> createJAXBDispatch(QName portName,
                                                               WSService owner,
                                                               WSBinding binding,
                                                               JAXBContext jaxbContext,
                                                               javax.xml.ws.Service.Mode mode,
                                                               Tube next,
                                                               @Nullable
                                                               WSEndpointReference epr)
Creates a new JAXB-based Dispatch stub that connects to the given pipe.

Parameters:
portName - see Service.createDispatch(QName, Class, Service.Mode).
owner - see common parameters
binding - see common parameters
jaxbContext - JAXBContext used to convert between objects and XML.
mode - The mode of the dispatch. See Service.createDispatch(QName, Class, Service.Mode).
next - see common parameters
epr - see common parameters

createMessageDispatch

public static javax.xml.ws.Dispatch<Message> createMessageDispatch(QName portName,
                                                                   WSService owner,
                                                                   WSBinding binding,
                                                                   Tube next,
                                                                   @Nullable
                                                                   WSEndpointReference epr)
Creates a new Message-based Dispatch stub that connects to the given pipe. The returned dispatch is always Service.Mode#MESSAGE.

Parameters:
portName - see Service.createDispatch(QName, Class, Service.Mode).
owner - see common parameters
binding - see common parameters
next - see common parameters
epr - see common parameters

createPortProxy

public <T> T createPortProxy(WSService service,
                             WSBinding binding,
                             SEIModel model,
                             Class<T> portInterface,
                             Tube next,
                             @Nullable
                             WSEndpointReference epr)
Creates a new strongly-typed proxy object that implements a given port interface.

Parameters:
service - see common parameters
binding - see common parameters
model - This model shall represent a port interface. TODO: can model be constructed from portInterface and binding? Find out and update.
portInterface - The port interface that has operations as Java methods.
next - see common parameters
epr - see common parameters