SELECT ?p ?o WHERE { {url} ?p ?o }
to retrieve all triples for the requested resource By using a different callback, the read can be done asynchronously in its own dispatched thread:
endpoint.fillInterested("ContextObj",new ExecutorCallback<String>(executor) { public void onCompleted(String context) { int filled=endpoint.fill(mybuffer); ... } public void onFailed(String context,Throwable cause) {...} });
The executor callback can also be customized to not dispatch in some circumstances when it knows it can use the callback thread and does not need to dispatch.
The write contract is that the callback complete is not called until all data has been written or there is a failure. For blocking this looks like:
FutureCallback<String> future = new FutureCallback<>(); endpoint.write("ContextObj",future,headerBuffer,contentBuffer); String context = future.get(); // This blocks
Note also that multiple buffers may be passed in write so that gather writes can be done:
endpoint.write("ContextObj",new ExecutorCallback<String>(executor) { public void onCompleted(String context) { int filled=endpoint.fill(mybuffer); ... } public void onFailed(String context,Throwable cause) {...} },headerBuffer,contentBuffer);
@author Philippe Riand
file:/
URLs... An Endpoint
may contain both sources and sinks for different media types, to provide bidirectional communication.
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. @since JAX-WS 2.0 @see javax.xml.ws.Binding @see javax.xml.ws.BindingType @see javax.xml.ws.soap.SOAPBinding @see java.util.concurrent.Executor
The other purpose of this class is to provide convenience methods that read from a socket into a bytebuffer, or write from a bytebuffer to the socket. If the socket is not ready for business, the endpoint (and hence the task) simply yields, without registering with the {@link NioSelectorScheduler}. The idea is to give the other runnable tasks a chance to run before retrying the operation (on resumption); this avoids waking up the selector -- an expensive operation -- as much as possible, and introduces a delay between retries. If, after a fixed number of times ( {@link #YIELD_COUNT}), the operation still hasn't succeeded, the endpoint registers itself with the {@link NioSelectorScheduler}, and waits for a socket-ready event from the selector. This scheme is adaptive to load, in that the delay between retries is proportional to the number of runnable tasks. Busy sockets tend to get serviced more often as the socket is always ready.
An Endpoint
instance contains the information necessary to send requests to the remote endpoint. For example, a TCP-based Endpoint
implementation typically contains the remote host address and TCP port to connect to.
The {@link #newRequest newRequest} method can be used to send arequest to the remote endpoint that this object represents.
An instance of this interface should be serializable and should implement {@link Object#equals Object.equals} to returntrue
if and only if the argument is equivalent to the instance in trust, content, and function. That is, the equals
method should be a sufficient substitute for {@link TrustEquivalence#checkTrustEquivalence TrustEquivalence.checkTrustEquivalence}. But unlike checkTrustEquivalence
, the equals
method cannot assume that the implementations of any of the invoked instance's pluggable component objects are trusted (whether pluggable through public APIs or deserialization). Therefore, the equals
method should not invoke comparison methods (such as equals
) on any such component without first verifying that the component's implementation is at least as trusted as the implementation of the corresponding component in the equals
argument (such as by verifying that the corresponding component objects have the same actual class). If any such verification fails, the equals
method should return false
without invoking a comparison method on the component. Furthermore, these guidelines should be recursively obeyed by the comparison methods of each such component for its subcomponents.
If an Endpoint
is an instance of {@link TrustEquivalence}, then its equals
method must obey the above guidelines and its checkTrustEquivalence
method must not return true
if its equals
method would not return true
for the same argument.
All aspects of the underlying communication mechanism that are not specified here are defined by the particular implementation of this interface. @author Sun Microsystems, Inc. @see ServerEndpoint @since 2.0
SELECT ?p ?o WHERE { {url} ?p ?o }
to retrieve all triples for the requested resource By using a different callback, the read can be done asynchronously in its own dispatched thread:
endpoint.fillInterested("ContextObj",new ExecutorCallback<String>(executor) { public void onCompleted(String context) { int filled=endpoint.fill(mybuffer); ... } public void onFailed(String context,Throwable cause) {...} });
The executor callback can also be customized to not dispatch in some circumstances when it knows it can use the callback thread and does not need to dispatch.
The write contract is that the callback complete is not called until all data has been written or there is a failure. For blocking this looks like:
FutureCallback<String> future = new FutureCallback<>(); endpoint.write("ContextObj",future,headerBuffer,contentBuffer); String context = future.get(); // This blocks
Note also that multiple buffers may be passed in write so that gather writes can be done:
endpoint.write("ContextObj",new ExecutorCallback<String>(executor) { public void onCompleted(String context) { int filled=endpoint.fill(mybuffer); ... } public void onFailed(String context,Throwable cause) {...} },headerBuffer,contentBuffer);
EndpointProvider
provides the necessary information to create an entry in the service locator for an endpoint.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|