|
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.TcpServer
This class implement the server features necessary to receive events from incomming connections.
Field Summary | |
private java.lang.Thread |
m_context
The thread which is executing the server context |
private java.util.List |
m_handlers
The list of event handlers |
private java.lang.String |
m_logPrefix
The logging context |
private Fiber |
m_parent
The parent fiber. |
private java.util.LinkedList |
m_receivers
The list of receivers that are currently being processed. |
private int |
m_recsPerConn
the events per connection |
private boolean |
m_stop
When set true the server thread will exit. |
private int |
m_tcpPort
The TCP/IP Port for the server socket's binding. |
private java.net.ServerSocket |
m_tcpSock
The TCP/IP Port for the server socket's binding. |
(package private) static int |
TCP_PORT
The default TCP/IP port where the server listens for connections. |
Constructor Summary | |
(package private) |
TcpServer(Fiber parent,
java.util.List handlers)
Constructs a new instance of an server to handle incomming tcp connections. |
(package private) |
TcpServer(Fiber parent,
java.util.List handlers,
int port)
Constructs a new instance of an server to handle incomming tcp connections. |
Method Summary | |
(package private) boolean |
isAlive()
Returns true if this runnable is executing. |
void |
run()
The logic execution context to accept and process incomming connection requests. |
void |
setEventsPerConnection(int number)
|
void |
setLogPrefix(java.lang.String prefix)
|
(package private) void |
stop()
This is called inform the current execution of this object is stopped. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final int TCP_PORT
private int m_tcpPort
TCP_PORT
but it can be overridden in the
constructor.
private java.net.ServerSocket m_tcpSock
TCP_PORT
but it can be overridden in the
constructor.
private volatile boolean m_stop
private java.util.LinkedList m_receivers
The list of receivers that are currently being processed. Each instance
in this list is of type Thread
and will remain
in the list so long as it's alive.
This list is periodically cleaned by the main server thread.
private java.lang.Thread m_context
private Fiber m_parent
private java.util.List m_handlers
private java.lang.String m_logPrefix
private int m_recsPerConn
Constructor Detail |
TcpServer(Fiber parent, java.util.List handlers) throws java.io.IOException
parent
- The parent fiberTcpServer(Fiber parent, java.util.List handlers, int port) throws java.io.IOException
parent
- The parent fiberport
- The port to listen on.Method Detail |
void stop() throws java.lang.InterruptedException
java.lang.InterruptedException
boolean isAlive()
public void run()
run
in interface java.lang.Runnable
public void setLogPrefix(java.lang.String prefix)
public void setEventsPerConnection(int number)
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |