com.sun.xml.ws.api.server
Class AbstractServerAsyncTransport<T>

java.lang.Object
  extended by com.sun.xml.ws.api.server.AbstractServerAsyncTransport<T>
Direct Known Subclasses:
HttpAdapter.AsyncTransport

public abstract class AbstractServerAsyncTransport<T>
extends Object

Partial server side async transport implementation. It manages pooling of Codec and other details.


Constructor Summary
AbstractServerAsyncTransport(WSEndpoint endpoint)
          WSEndpoint.setExecutor(java.util.concurrent.Executor) should be called before creating the transport
 
Method Summary
protected  Packet decodePacket(T connection, Codec codec)
          decodes the transport data to Packet
protected abstract  void encodePacket(T connection, Packet packet, Codec codec)
          Encodes the Packet to infoset and writes on the connection.
protected abstract  String getAcceptableMimeTypes(T connection)
          If the request has Accept header, return that value
protected abstract  PropertySet getPropertySet(T connection)
          If there are any properties associated with the connection, those will be added to Packet
protected abstract  TransportBackChannel getTransportBackChannel(T connection)
          TransportBackChannel used by jax-ws runtime to close the connection while the processing of the request is still continuing.
protected abstract  WebServiceContextDelegate getWebServiceContextDelegate(T connection)
          Return a WebServiceContextDelegate using the underlying connection.
protected  void handle(T connection)
          Reads and decodes infoset from the connection and invokes the endpoints.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractServerAsyncTransport

public AbstractServerAsyncTransport(WSEndpoint endpoint)
WSEndpoint.setExecutor(java.util.concurrent.Executor) should be called before creating the transport

Parameters:
endpoint - webservices requests are directed towards this endpoint
Method Detail

decodePacket

protected Packet decodePacket(T connection,
                              @NotNull
                              Codec codec)
                       throws IOException
decodes the transport data to Packet

Parameters:
connection - that carries the web service request
codec - for encoding/decoding Message
Returns:
decoded Packet
Throws:
IOException - if an i/o error happens while encoding/decoding

encodePacket

protected abstract void encodePacket(T connection,
                                     @NotNull
                                     Packet packet,
                                     @NotNull
                                     Codec codec)
                              throws IOException
Encodes the Packet to infoset and writes on the connection.

Parameters:
connection - that carries the web service request
packet - that needs to encoded to infoset
codec - that does the encoding of Packet
Throws:
IOException - if an i/o error happens while encoding/decoding

getAcceptableMimeTypes

@Nullable
protected abstract String getAcceptableMimeTypes(T connection)
If the request has Accept header, return that value

Parameters:
connection - that carries the web service request
Returns:
Accept MIME types

getTransportBackChannel

@Nullable
protected abstract TransportBackChannel getTransportBackChannel(T connection)
TransportBackChannel used by jax-ws runtime to close the connection while the processing of the request is still continuing. In oneway HTTP case, a response code needs to be sent before invoking the endpoint.

Parameters:
connection - that carries the web service request
Returns:
TransportBackChannel instance using the connection

getPropertySet

@NotNull
protected abstract PropertySet getPropertySet(T connection)
If there are any properties associated with the connection, those will be added to Packet

Parameters:
connection - that carries the web service request
Returns:
PropertySet for the connection

getWebServiceContextDelegate

@NotNull
protected abstract WebServiceContextDelegate getWebServiceContextDelegate(T connection)
Return a WebServiceContextDelegate using the underlying connection.

Parameters:
connection - that carries the web service request
Returns:
non-null WebServiceContextDelegate instance

handle

protected void handle(T connection)
               throws IOException
Reads and decodes infoset from the connection and invokes the endpoints. The response is encoded and written to the connection. The response could be written using a different thread.

Parameters:
connection - that carries the web service request
Throws:
IOException - if an i/o error happens while encoding/decoding