|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.selector.SelectionKeyHandler rice.pastry.socket.SocketCollectionManager.SourceRouteManager
protected class SocketCollectionManager.SourceRouteManager
Private class which is tasked with maintaining a source route which goes through this node. This class maintains to sockets, and transfers the data between them. It also is responsible for performing the initial handshake and sending the data across the wire.
Constructor Summary | |
---|---|
SocketCollectionManager.SourceRouteManager(java.nio.channels.SelectionKey key)
Constructor which accepts an incoming connection, represented by the selection key. |
Method Summary | |
---|---|
protected void |
acceptConnection(java.nio.channels.SelectionKey key)
Accepts a new connection on the given key |
protected void |
addInterestOp(java.nio.channels.SelectableChannel channel,
int op)
Internal method which adds an interest op to the given channel's interest set. |
void |
close()
Method which closes down this socket manager, by closing the socket, cancelling the key and setting the key to be interested in nothing |
void |
connect(java.nio.channels.SelectionKey key)
Specified by the SelectionKeyHandler interface - calling this tells this socket manager that the connection has completed and we can now read/write. |
protected void |
createConnection(EpochInetSocketAddress address)
Creates the outgoing socket to the remote handle |
void |
read(java.nio.channels.SelectionKey key)
Reads from the socket attached to this connector. |
protected void |
removeInterestOp(java.nio.channels.SelectableChannel channel,
int op)
Internal method which removes an interest op to the given key's interest set. |
void |
shutdown(java.nio.channels.SocketChannel channel)
Method which initiates a shutdown of this socket by calling shutdownOutput(). |
java.lang.String |
toString()
|
void |
write(java.nio.channels.SelectionKey key)
Writes to the socket attached to this socket manager. |
Methods inherited from class rice.selector.SelectionKeyHandler |
---|
accept, modifyKey |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SocketCollectionManager.SourceRouteManager(java.nio.channels.SelectionKey key) throws java.io.IOException
key
- The server accepting key for the channel
java.io.IOException
- DESCRIBE THE EXCEPTIONMethod Detail |
---|
protected void addInterestOp(java.nio.channels.SelectableChannel channel, int op) throws java.io.IOException
channel
- The channelop
- The operation to add to the key's interest set
java.io.IOException
protected void removeInterestOp(java.nio.channels.SelectableChannel channel, int op) throws java.io.IOException
channel
- The channelop
- The operation to remove from the key's interest set
java.io.IOException
public void shutdown(java.nio.channels.SocketChannel channel)
public void close()
public void connect(java.nio.channels.SelectionKey key)
connect
in class SelectionKeyHandler
key
- The key which is connectable.public void read(java.nio.channels.SelectionKey key)
read
in class SelectionKeyHandler
key
- The selection key for this managerpublic void write(java.nio.channels.SelectionKey key)
write
in class SelectionKeyHandler
key
- The selection key for this managerprotected void acceptConnection(java.nio.channels.SelectionKey key) throws java.io.IOException
serverKey
- The server socket key
java.io.IOException
- DESCRIBE THE EXCEPTIONprotected void createConnection(EpochInetSocketAddress address) throws java.io.IOException
address
- The accress to connect to
java.io.IOException
- DESCRIBE THE EXCEPTIONpublic java.lang.String toString()
toString
in class java.lang.Object
|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |