public static interface ServerEndpoint.ListenContext
ServerEndpoint.enumerateListenEndpoints
to receive the
enumerated ListenEndpoint
instances and to choose an active listen operation for each of
them on behalf of the caller of
enumerateListenEndpoints
.Modifier and Type | Method and Description |
---|---|
ServerEndpoint.ListenCookie |
addListenEndpoint(ServerEndpoint.ListenEndpoint listenEndpoint)
Adds
listenEndpoint to this
ListenContext 's collection of
ListenEndpoint instances for the
ServerEndpoint it was passed to, starts a
listen operation on listenEndpoint if
necessary, and returns the ListenCookie for an
active listen operation on listenEndpoint . |
ServerEndpoint.ListenCookie addListenEndpoint(ServerEndpoint.ListenEndpoint listenEndpoint) throws IOException
listenEndpoint
to this
ListenContext
's collection of
ListenEndpoint
instances for the
ServerEndpoint
it was passed to, starts a
listen operation on listenEndpoint
if
necessary, and returns the ListenCookie
for an
active listen operation on listenEndpoint
.
The returned ListenCookie
must have been
obtained from a ListenHandle
returned from
some invocation of ListenEndpoint.listen
on a ListenEndpoint
equivalent to
listenEndpoint
by Object.equals
.
This method may start a new listen operation on
listenEndpoint
by invoking its
listen
method and returning the
ListenCookie
from the resulting
ListenHandle
, or it may return a
ListenCookie
for a listen operation previously
started (but still active) on an equivalent
ListenEndpoint
. If this method does invoke
listen
on listenEndpoint
and it
throws an exception, then this method throws that
exception.
The implementation of this method may invoke checkPermissions
on listenEndpoint
to verify
that a party that it is operating on behalf of has all of
the security permissions necessary to listen for requests
on listenEndpoint
.
listenEndpoint
- the ListenEndpoint
to
add to this ListenContext
and to return a
ListenCookie
forListenCookie
that represents an
active listen operation on listenEndpoint
IOException
- if an invocation of listen
on listenEndpoint
throws an
IOException
SecurityException
- if an invocation of
checkPermissions
or listen
on
listenEndpoint
throws a
SecurityException
IllegalStateException
- if this method is invoked
unexpectedly, such as before being passed to
ServerEndpoint.enumerateListenEndpoints
or
after the invocation of
ServerEndpoint.enumerateListenEndpoints
that
it was created for has returnedNullPointerException
- if listenEndpoint
is null
Copyright © 2016–2018. All rights reserved.