com.sun.sgs.transport
Interface ConnectionHandler


public interface ConnectionHandler

Interface implemented by objects implementing a connection handler. A connection handler is passed to Transport.accept. When a new connection is received by the transport, newConnection is invoked with the new I/O channel for that connection.


Method Summary
 void newConnection(AsynchronousByteChannel channel)
          Notify the handler that a new connection has been initiated.
 void shutdown()
          Notify the handler that the transport encountered an unrecoverable error and has shutdown.
 

Method Detail

newConnection

void newConnection(AsynchronousByteChannel channel)
                   throws Exception
Notify the handler that a new connection has been initiated. If an exception is thrown the connection will be refused. The implementation of this method should return in a timely manner, starting a separate thread if necessary to perform any IO on the channel.

Parameters:
channel - on which the new connection can communicate.
Throws:
Exception - if the handler rejects the connection.

shutdown

void shutdown()
Notify the handler that the transport encountered an unrecoverable error and has shutdown.


RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved