Endpoints are created using the static methods defined in this
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.
Once stopped, an endpoint cannot be published again.
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 ones based on the annotations
present on the implementor.
Creates an endpoint with the specified implementor object. If there is
a binding specified via a BindingType annotation then it MUST be used else
a default of SOAP 1.1 / HTTP binding MUST be used.
bindingId - A URI specifying the binding to use. If the bindingID is
null and no binding is specified via a BindingType
annotation then a default SOAP 1.1 / HTTP binding MUST be used.
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 publish(Object) method instead.
Parameters:
address - A URI specifying the address to use. The address
MUST be compatible with the binding specified at the
time the endpoint was created.
Throws:
IllegalArgumentException - If the provided address URI is not usable
in conjunction with the endpoint's binding.
IllegalStateException - If the endpoint has been published already or it has been stopped.
SecurityException - If a java.lang.SecurityManger
is being used and the application doesn't have the
WebServicePermission("publishEndpoint") permission.
Creates and publishes an endpoint for the specified implementor
object 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 create(String,Object) and
publish(Object) methods instead.
Parameters:
address - A URI specifying the address and transport/protocol
to use. A http: URI MUST result in the SOAP 1.1/HTTP
binding being used. Implementations may support other
URI schemes.
implementor - The endpoint implementor.
Returns:
The newly created endpoint.
Throws:
SecurityException - If a java.lang.SecurityManger
is being used and the application doesn't have the
WebServicePermission("publishEndpoint") permission.
publish
public abstract void publish(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:
IllegalArgumentException - If the provided server context is not
supported by the implementation or turns
out to be unusable in conjunction with the
endpoint's binding.
IllegalStateException - If the endpoint has been published already or it has been stopped.
SecurityException - If a java.lang.SecurityManger
is being used and the application doesn't have the
WebServicePermission("publishEndpoint") permission.
stop
public abstract void stop()
Stops publishing this endpoint.
If the endpoint is not in a published state, this method
has no effect.
isPublished
public abstract boolean isPublished()
Returns true if the endpoint is in the published state.
public abstract void setExecutor(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:
SecurityException - If the instance does not support
setting an executor for security reasons (e.g. the
necessary permissions are missing).
Returns the EndpointReference associated with
this Endpoint instance.
If the Binding for this bindingProvider is
either SOAP1.1/HTTP or SOAP1.2/HTTP, then a
W3CEndpointReference MUST be returned.
Parameters:
referenceParameters - Reference parameters to be associated with the
returned EndpointReference instance.
Returns:
EndpointReference of this Endpoint instance.
If the returned EndpointReference is of type
W3CEndpointReference then it MUST contain the
the specified referenceParameters.
Throws:
WebServiceException - If any error in the creation of
the EndpointReference or if the Endpoint is
not in the published state.
public abstract <T extends EndpointReference> T getEndpointReference(Class<T> clazz,
Element... referenceParameters)
Returns the EndpointReference associated with
this Endpoint instance.
Parameters:
clazz - Specifies the type of EndpointReference that MUST be returned.
referenceParameters - Reference parameters to be associated with the
returned EndpointReference instance.
Returns:
EndpointReference of type clazz of this
Endpoint instance.
If the returned EndpointReference is of type
W3CEndpointReference then it MUST contain the
the specified referenceParameters.
Throws:
WebServiceException - If any error in the creation of
the EndpointReference or if the Endpoint is
not in the published state or if the clazz is not a supported
EndpointReference type.
Submit a bug or feature For further API reference and developer documentation, see Java SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.