com.sun.xml.ws.transport.http.servlet
Class ServletAdapter

java.lang.Object
  extended by com.sun.xml.ws.api.server.Adapter<HttpAdapter.HttpToolkit>
      extended by com.sun.xml.ws.transport.http.HttpAdapter
          extended by com.sun.xml.ws.transport.http.servlet.ServletAdapter
All Implemented Interfaces:
BoundEndpoint

public final class ServletAdapter
extends HttpAdapter
implements BoundEndpoint

HttpAdapter for servlets.

This is a thin wrapper around HttpAdapter with some description specified in the deployment (in particular those information are related to how a request is routed to a ServletAdapter.

This class implements BoundEndpoint and represent the servlet-WSEndpoint association for


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.xml.ws.api.server.Adapter
Adapter.Toolkit
 
Field Summary
(package private)  String name
           
 
Fields inherited from class com.sun.xml.ws.transport.http.HttpAdapter
dump, owner, publishStatusPage, revWsdls, urlPattern, wsdls
 
Fields inherited from class com.sun.xml.ws.api.server.Adapter
endpoint, pool
 
Constructor Summary
protected ServletAdapter(String name, String urlPattern, WSEndpoint endpoint, ServletAdapterList owner)
           
 
Method Summary
 URI getAddress()
          The address of the bound endpoint.
 URI getAddress(String baseAddress)
          The address of the bound endpoint using the base address.
 String getName()
          Gets the name of the endpoint as given in the sun-jaxws.xml deployment descriptor.
 QName getPortName()
          Convenient method to return a port name from WSEndpoint.
 void handle(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Version of HttpAdapter.handle(WSHTTPConnection) that takes convenient parameters for servlet.
 void publishWSDL(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Deprecated. Use handle(ServletContext, HttpServletRequest, HttpServletResponse)
 String toString()
           
 
Methods inherited from class com.sun.xml.ws.transport.http.HttpAdapter
createAlone, createToolkit, getValidPath, handle, invokeAsync, publishWSDL
 
Methods inherited from class com.sun.xml.ws.api.server.Adapter
getEndpoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.xml.ws.api.server.BoundEndpoint
getEndpoint
 

Field Detail

name

final String name
Constructor Detail

ServletAdapter

protected ServletAdapter(String name,
                         String urlPattern,
                         WSEndpoint endpoint,
                         ServletAdapterList owner)
Method Detail

getName

public String getName()
Gets the name of the endpoint as given in the sun-jaxws.xml deployment descriptor.


getAddress

@NotNull
public URI getAddress()
Description copied from interface: BoundEndpoint
The address of the bound endpoint.

For example, if this endpoint is bound to a servlet endpoint "http://foobar/myapp/myservice", then this method should return that address.

Specified by:
getAddress in interface BoundEndpoint
Returns:
address of the endpoint

getAddress

@NotNull
public URI getAddress(String baseAddress)
Description copied from interface: BoundEndpoint
The address of the bound endpoint using the base address. Often times, baseAddress is only avaialble during the request.

If the endpoint is bound to a servlet endpoint, the base address won't include the url-pattern, so the base address would be "http://host:port/context". This method would include url-pattern for the endpoint and return that address for e.g. "http://host:port/context/url-pattern"

Specified by:
getAddress in interface BoundEndpoint
Parameters:
baseAddress - that is used in computing the full address
Returns:
address of the endpoint

getPortName

public QName getPortName()
Convenient method to return a port name from WSEndpoint.

Returns:
null if WSEndpoint isn't tied to any paritcular port.

handle

public void handle(javax.servlet.ServletContext context,
                   javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws IOException
Version of HttpAdapter.handle(WSHTTPConnection) that takes convenient parameters for servlet.

Throws:
IOException

publishWSDL

public void publishWSDL(javax.servlet.ServletContext context,
                        javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
                 throws IOException
Deprecated. Use handle(ServletContext, HttpServletRequest, HttpServletResponse)

Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object