com.sun.jini.discovery.internal
Class EndpointBasedServer.ListenContextImpl

java.lang.Object
  extended by com.sun.jini.discovery.internal.EndpointBasedServer.ListenContextImpl
All Implemented Interfaces:
ServerEndpoint.ListenContext
Enclosing class:
EndpointBasedServer

private static class EndpointBasedServer.ListenContextImpl
extends Object
implements ServerEndpoint.ListenContext

Listen context that listens on the endpoint it is given, and stores the resulting handle.


Field Summary
private  ServerEndpoint.ListenHandle handle
           
 
Constructor Summary
private EndpointBasedServer.ListenContextImpl()
           
 
Method Summary
 ServerEndpoint.ListenCookie addListenEndpoint(ServerEndpoint.ListenEndpoint endpoint)
          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.
(package private)  ServerEndpoint.ListenHandle getListenHandle()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handle

private ServerEndpoint.ListenHandle handle
Constructor Detail

EndpointBasedServer.ListenContextImpl

private EndpointBasedServer.ListenContextImpl()
Method Detail

addListenEndpoint

public ServerEndpoint.ListenCookie addListenEndpoint(ServerEndpoint.ListenEndpoint endpoint)
                                              throws IOException
Description copied from interface: ServerEndpoint.ListenContext
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.

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.

Specified by:
addListenEndpoint in interface ServerEndpoint.ListenContext
Parameters:
endpoint - the ListenEndpoint to add to this ListenContext and to return a ListenCookie for
Returns:
a ListenCookie that represents an active listen operation on listenEndpoint
Throws:
IOException - if an invocation of listen on listenEndpoint throws an IOException

getListenHandle

ServerEndpoint.ListenHandle getListenHandle()


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.