|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.catalina.tribes.transport.ReceiverBase org.apache.catalina.tribes.transport.nio.NioReceiver
public class NioReceiver
Field Summary | |
---|---|
protected LinkedList<Runnable> |
events
|
protected long |
lastCheck
|
protected static StringManager |
sm
The string manager for this package. |
Fields inherited from class org.apache.catalina.tribes.transport.ReceiverBase |
---|
OPTION_DIRECT_BUFFER |
Fields inherited from interface org.apache.catalina.tribes.ChannelReceiver |
---|
MAX_UDP_SIZE |
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()
Stop listening for messages |
protected void |
stopListening()
Close Selector. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final StringManager sm
protected LinkedList<Runnable> events
protected long lastCheck
Constructor Detail |
---|
public NioReceiver()
Method Detail |
---|
public String getInfo()
<description>/<version>
.
public void stop()
ChannelReceiver
stop
in interface ChannelReceiver
stop
in class ReceiverBase
public void start() throws IOException
start
in interface ChannelReceiver
start
in class ReceiverBase
IOException
ChannelReceiver.start()
public AbstractRxTask createRxTask()
createRxTask
in interface RxTaskPool.TaskCreator
protected void bind() throws IOException
IOException
public void addEvent(Runnable event)
public void events()
public static void cancelledKey(SelectionKey key)
protected void socketTimeouts()
protected void listen() throws Exception
IOException
ClosedChannelException
Exception
protected void stopListening()
ReceiverBase.stop()
protected void registerChannel(Selector selector, SelectableChannel channel, int ops, Object attach) throws Exception
Exception
public void run()
run
in interface Runnable
protected void readDataFromSocket(SelectionKey key) throws Exception
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.
Exception
|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |