public interface ServerEndpoint extends ServerCapabilities
Endpointinstance to send requests to those communication endpoints.
ServerEndpoint instance contains the information
necessary to listen for requests on the communication endpoints and
Endpoint instances. For example, a
ServerEndpoint implementation typically
contains the TCP port to listen on and the host address to put in
Endpoint instances it produces. An implementation
that supports authentication typically contains the
(if any) to use for server authentication.
method can be invoked to
ServerEndpoint, which are individually represented as
ListenEndpoint.listen) on each discrete communication endpoint by choosing, for each endpoint, either to start a new listen operation or to use an existing one, and
Endpointinstance that corresponds to the chosen listen operations
Endpointinstance can then be used to send requests to the communication endpoints being listened on as a result of that
ServerEndpoint is just used to specify
the transport layer implementation to use when exporting a remote
object; for example, some constructors of
BasicJeriExporter have a
ServerEndpoint parameter to
specify the transport layer implementation. The exporter
implementation is then responsible for using the supplied
ServerEndpoint to manage listen operations as
necessary and to obtain an
Endpoint instance for
putting in the client-side proxy.
All aspects of the underlying communication mechanism that are not specified here are defined by the particular implementation of this interface.
|Modifier and Type||Interface and Description|
A cookie to identify a listen operation as the return value of the
Represents a communication endpoint on the current (local) host to listen for and receive requests on.
Represents a listen operation that has been started on a
|Modifier and Type||Method and Description|
Enumerates the communication endpoints represented by this
Endpoint enumerateListenEndpoints(ServerEndpoint.ListenContext listenContext) throws IOException
ServerEndpointby passing the
ListenEndpointfor each of them to
listenContext, which will ensure an active listen operation on each endpoint, and returns an
Endpointinstance corresponding to the listen operations chosen by
This method uses
listenContext to cooperate
with the caller to ensure the appropriate listen operations.
In this cooperation,
ServerEndpointis responsible for declaring to the caller the discrete communication endpoints represented by this
ListenEndpointinstances passed to
ServerEndpoint.enumerateListenEndpointsinvocation corresponding to each discrete communication endpoint as
ListenCookieinstances returned from
ListenEndpoint, the caller (through
listenContext) may choose to start a new listen operation, or it may choose to reuse a previously started listen operation that it has a
This method sequentially invokes
once for each discrete communication endpoint represented by
ServerEndpoint, passing the
ListenEndpoint representing that communication
endpoint. If any of the invocations of
ListenContext.addListenEndpoint throws an
exception, this method throws that exception. Otherwise, this
method returns an
Endpoint instance that sends
requests to be received by the listen operations chosen by
ListenContextto pass this
Endpointinstance for sending requests to this
ServerEndpoint's communication endpoints being listened on
IOException- if an I/O exception occurs while attempting to listen for requests on the communication endpoints represented by this
ServerEndpoint. This could occur, for example, if an I/O resource associated with one of the communication endpoints is already in exclusive use, or if there are insufficient I/O resources for the operation.
SecurityException- if the current security context does not have the permissions necessary to listen for requests on one of the communication endpoints represented by this
IllegalArgumentException- if an invocation of the
addListenEndpointmethod on the supplied
ListenCookiethat does not correspond to the
ListenEndpointthat was passed to it
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.