|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.eventd.adaptors.tcp.TcpRecordHandler
This class is used to do the initial read of data from the input stream and break it up into records. Each record is written to a piped writer. This means that the reader never gets too far ahead of the parse. It means more threads for less memory useage. As always there is a tradeoff
Nested Class Summary | |
private static class |
TcpRecordHandler.StateManager
This class is use to model the set of states, the attached TcpRecordHandler, and the transition actions. |
Field Summary | |
private java.net.Socket |
m_connection
The input stream socket |
private java.lang.Thread |
m_context
The thread context running this runnable |
private java.io.OutputStream |
m_out
The current pipe. |
private boolean |
m_stop
When set the runnable should exit as fast as possible. |
private TcpRecordHandler.StateManager[] |
m_tokenizer
The set of state managers |
private java.util.List |
m_xchange
The list of piped output streams and execptions. |
Constructor Summary | |
(package private) |
TcpRecordHandler(java.net.Socket s,
java.util.List xchange)
Constructs a new record handler. |
Method Summary | |
private void |
closeStream()
Closes the current stream if any |
private void |
forward(char ch)
forwards the characters to the attached pipe. |
(package private) boolean |
isAlive()
Returns true if the context is alive |
private void |
newStream()
Allocates a new stream |
void |
run()
The execution context. |
(package private) void |
stop()
Stops and joins the current context. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private volatile boolean m_stop
private java.lang.Thread m_context
private java.util.List m_xchange
private java.net.Socket m_connection
private java.io.OutputStream m_out
private TcpRecordHandler.StateManager[] m_tokenizer
Constructor Detail |
TcpRecordHandler(java.net.Socket s, java.util.List xchange)
s
- The socket to read fromxchange
- The io exchangeMethod Detail |
private void closeStream() throws java.io.IOException
java.io.IOException
private void newStream() throws java.io.IOException
java.io.IOException
private void forward(char ch) throws java.io.IOException
java.io.IOException
boolean isAlive()
void stop() throws java.lang.InterruptedException
java.lang.InterruptedException
public void run()
run
in interface java.lang.Runnable
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |