|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--org.opennms.bb.dp.common.components.PollerThread | +--org.opennms.bb.dp.discovery.components.DiscPinger
DiscPinger is the type of thread that is maintained in the ping manager's thread pool. This is responsible for actually creating, sending and retrying the PING packets.
Note however that object does not directly receive echo replies. The manager receives the replies and notifies this thread that a response to the request sent out has been received
Field Summary | |
private IPPollAddress |
m_addr
The IP Address object to poll. |
private short |
m_filterID
This is the filterID to include in the icmp echo request message. |
private QuantumSemaphore |
m_limiter
The limiter is used to ensure that only a specific number of packets are sent within a specific time quantium. |
private DaemonConnection |
m_portal
This is the connection to the icmp daemon that sends and receives request for the discovery process. |
private PCQueue |
m_requestQ
|
private boolean |
m_responded
When the manager calls the receive method this variable will be updated with the value of true if the responding address matches the value of m_addr. |
private Object |
m_sync
This object is used to synchronize access to the m_addr and m_responded. |
private long |
m_tid
The thread key for this particular thread. |
Fields inherited from class org.opennms.bb.dp.common.components.PollerThread |
m_curOpStatus, STATUS_MASK, STATUS_NORMAL, STATUS_PAUSED, STATUS_PAUSING, STATUS_RESUMING, STATUS_SHUTDOWN, STATUS_STARTING, STATUS_TERMINATING |
Fields inherited from class java.lang.Thread |
contextClassLoader, daemon, eetop, group, inheritableThreadLocals, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadLocals, threadQ |
Constructor Summary | |
DiscPinger(long lThreadID,
PCQueue requestQ,
DaemonConnection portal,
short pingFilterID,
QuantumSemaphore pktLimiter)
Creates a new discovery ping thread that will attempt to poll addresses as they are set by the manager. |
Method Summary | |
IPPollAddress |
getIPAddress()
Return the current IP Address being polled by this thread. |
long |
getThreadID()
Returns the thread id as specified by the manager. |
boolean |
received(String ipAddress)
The ping manager calls this function to indicate that the request sent by this thread has been received. |
void |
run()
The run() method does the hard work of the discovery poller thread. |
Methods inherited from class org.opennms.bb.dp.common.components.PollerThread |
getCtrlStatus, getOpStatus, pauseOperation, pauseThread, resumeOperation, resumeThread, setCtrlStatus, setOpStatus, setUserStatus, shutdown, shutdownThread |
Methods inherited from class java.lang.Thread |
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private long m_tid
The thread key for this particular thread. This key is placed into all the icmp echo requests that are sent by this thread. The manager can the use this id to find the sending thread.
private PCQueue m_requestQ
private DaemonConnection m_portal
This is the connection to the icmp daemon that sends and receives request for the discovery process. Since most process must have superuser privilage to send and receive icmp messages, the icmpd is used to isolate the java code from the operating system.
private QuantumSemaphore m_limiter
The limiter is used to ensure that only a specific number of packets are sent within a specific time quantium. The number is reset to the maximum each time quantum.
private short m_filterID
This is the filterID to include in the icmp echo request message. Unless this id is included in the sending packet the echo reply will be discarded by the icmpd.
private Object m_sync
This object is used to synchronize access to the m_addr and m_responded. Those member variables should not be modified unless the lock for m_sync is held. Also, while waiting on those modification the m_sync.wait() will be called instead of the thread's wait() method.
private IPPollAddress m_addr
The IP Address object to poll.
private boolean m_responded
When the manager calls the receive method this variable will be updated with the value of true if the responding address matches the value of m_addr.
Constructor Detail |
public DiscPinger(long lThreadID, PCQueue requestQ, DaemonConnection portal, short pingFilterID, QuantumSemaphore pktLimiter)
Creates a new discovery ping thread that will attempt to poll addresses as they are set by the manager.
lThreadId
- The thread identifer used by the manager.Q
- The Q from which to read off the address to pingportal
- The connection to the icmp daemon.pingFilterID
- The filter id used by the icmp daemon.pktLimiter
- Limits the packets per quantum.Method Detail |
public IPPollAddress getIPAddress()
Return the current IP Address being polled by this thread. If no address is being polled then a null pointer will be returned.
public long getThreadID()
Returns the thread id as specified by the manager.
public boolean received(String ipAddress)
The ping manager calls this function to indicate that the request sent by this thread has been received. If the thread is currently attempting to query the remote host then a value of true will be returned.
ipAddress
- The remote echo reply address.public void run()
The run() method does the hard work of the discovery poller thread. It waits for new addresses to be served out by the manager and then polls each address. When either the retries are exhausted or the manager informs the object that the remote has responded, the thread will go back to an idle state and wait for a new address.
run
in class Thread
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |