org.apache.catalina.tribes.transport.nio
public class NioReceiver extends ReceiverBase implements Runnable, ChannelReceiver, ListenCallback
Version: $Revision: 538977 $ $Date: 2007-05-17 17:43:49 +0200 (Thu, 17 May 2007) $
Field Summary | |
---|---|
protected LinkedList | events |
protected long | lastCheck |
protected static Log | log |
protected StringManager | sm
The string manager for this package. |
Constructor Summary | |
---|---|
NioReceiver() |
Method Summary | |
---|---|
void | addEvent(Runnable event) |
protected void | bind() |
static void | cancelledKey(SelectionKey key) |
AbstractRxTask | createRxTask() |
void | events() |
String | getInfo()
Return descriptive information about this implementation and the
corresponding version number, in the format
<description>/<version> . |
protected void | listen()
get data from channel and store in byte array
send it to cluster |
protected void | readDataFromSocket(SelectionKey key)
Sample data handler method for a channel with data ready to read. |
protected void | registerChannel(Selector selector, SelectableChannel channel, int ops, Object attach)
Register the given channel with the given selector for
the given operations of interest |
void | run()
Start thread and listen |
protected void | socketTimeouts() |
void | start()
start cluster receiver |
void | stop() |
protected void | stopListening()
Close Selector.
|
<description>/<version>
.Throws: IOException java.nio.channels.ClosedChannelException
Parameters: key A SelectionKey object associated with a channel determined by the selector to be ready for reading. If the channel returns an EOF condition, it is closed here, which automatically invalidates the associated key. The selector will then de-register the channel on the next select call.
Throws: Exception
See Also: org.apache.catalina.tribes.ClusterReceiver#start()
See Also: org.apache.catalina.tribes.transport.ClusterReceiverBase#stopListening()