javax.xml.ws
Interface Endpoint


public interface Endpoint

A Web service endpoint.

Endpoints are created using the EndpointFactory class. An endpoint is always tied to one Binding and one implementor, both set at endpoint creation time.

An endpoint is either in a published or an unpublished state. The publish methods can be used to start publishing an endpoint, at which point it starts accepting incoming requests. Conversely, the stop method can be used to stop accepting incoming requests and take the endpoint down.

An Executor may be set on the endpoint in order to gain better control over the threads used to dispatch incoming requests. For instance, thread pooling with certain parameters can be enabled by creating a ThreadPoolExecutor and registering it with the endpoint.

Handler chains can be set using the contained Binding.

An endpoint may have a list of metadata documents, such as WSDL and XMLSchema documents, bound to it. At publishing time, the JAX-WS implementation will try to reuse as much of that metadata as possible instead of generating new one based on the annotations present on the implementor.

Since:
JAX-WS 2.0
See Also:
EndpointFactory.createEndpoint(java.net.URI, java.lang.Object), Binding, Executor

Field Summary
static java.lang.String WSDL_PORT
          Standard property: name of WSDL port.
static java.lang.String WSDL_SERVICE
          Standard property: name of WSDL service.
 
Method Summary
 Binding getBinding()
          Returns the binding for this endpoint.
 java.util.concurrent.Executor getExecutor()
          Returns the executor for this Endpointinstance.
 java.lang.Object getImplementor()
          Returns the implementation object for this endpoint.
 java.util.List<javax.xml.transform.Source> getMetadata()
          Returns a list of metadata documents for the service.
 java.util.Map<java.lang.String,java.lang.Object> getProperties()
          Returns the property bag for this Endpoint instance.
 boolean isPublished()
          Returns true if the endpoint has been published.
 void publish(java.lang.Object serverContext)
          Publishes this endpoint at the provided server context.
 void publish(java.lang.String address)
          Publishes this endpoint at the given address.
 void setExecutor(java.util.concurrent.Executor executor)
          Sets the executor for this Endpoint instance.
 void setMetadata(java.util.List<javax.xml.transform.Source> metadata)
          Sets the metadata for this endpoint.
 void setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
          Sets the property bag for this Endpoint instance.
 void stop()
          Stops publishing this endpoint.
 

Field Detail

WSDL_SERVICE

static final java.lang.String WSDL_SERVICE
Standard property: name of WSDL service.

Type: javax.xml.namespace.QName

See Also:
Constant Field Values

WSDL_PORT

static final java.lang.String WSDL_PORT
Standard property: name of WSDL port.

Type: javax.xml.namespace.QName

See Also:
Constant Field Values
Method Detail

getBinding

Binding getBinding()
Returns the binding for this endpoint.

Returns:
The binding for this endpoing

getImplementor

java.lang.Object getImplementor()
Returns the implementation object for this endpoint.

Returns:
The implementor for this endpoint

publish

void publish(java.lang.String address)
Publishes this endpoint at the given address. The necessary server infrastructure will be created and configured by the JAX-WS implementation using some default configuration. In order to get more control over the server configuration, please use the javax.xml.ws.Endpoint#publish(Object) method instead.

Parameters:
address - A URI specifying the address and transport/protocol to use. By default, a http: URI results in a SOAP/HTTP binding being used. Implementations may support other URI schemes.

publish

void publish(java.lang.Object serverContext)
Publishes this endpoint at the provided server context. A server context encapsulates the server infrastructure and addressing information for a particular transport. For a call to this method to succeed, the server context passed as an argument to it must be compatible with the endpoint's binding.

Parameters:
serverContext - An object representing a server context to be used for publishing the endpoint.
Throws:
java.lang.IllegalArgumentException - If the provided server context is not supported by the implementation or turns out to be unusable in conjunction with endpoint's binding.

stop

void stop()
Stops publishing this endpoint.


isPublished

boolean isPublished()
Returns true if the endpoint has been published.

Returns:
true if the endpoint has been published

getMetadata

java.util.List<javax.xml.transform.Source> getMetadata()
Returns a list of metadata documents for the service.

Returns:
List<javax.xml.transform.Source> A list of metadata documents for the service

setMetadata

void setMetadata(java.util.List<javax.xml.transform.Source> metadata)
Sets the metadata for this endpoint.

Parameters:
metadata - A list of XML document sources containing metadata information for the endpoint (e.g. WSDL or XML Schema documents)
Throws:
java.lang.IllegalStateException - If the endpoint has already been published.

getExecutor

java.util.concurrent.Executor getExecutor()
Returns the executor for this Endpointinstance. The executor is used to dispatch an incoming request to the implementor object.

Returns:
The java.util.concurrent.Executor to be used to dispatch a request.
See Also:
Executor

setExecutor

void setExecutor(java.util.concurrent.Executor executor)
Sets the executor for this Endpoint instance. The executor is used to dispatch an incoming request to the implementor object. If this Endpoint is published using the publish(Object) method and the specified server context defines its own threading behavior, the executor may be ignored.

Parameters:
executor - The java.util.concurrent.Executor to be used to dispatch a request.
Throws:
java.lang.SecurityException - If the instance does not support setting an executor for security reasons (e.g. the necessary permissions are missing).
See Also:
Executor

getProperties

java.util.Map<java.lang.String,java.lang.Object> getProperties()
Returns the property bag for this Endpoint instance.

Returns:
Map<String,Object> The property bag associated with this instance.

setProperties

void setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
Sets the property bag for this Endpoint instance.

Parameters:
properties - The property bag associated with this instance.


Copyright © 2005 Sun Microsystems, Inc. All Rights Reserved.