|
||||||||||
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.MonitorPinger
MonitorPinger is another type of thread that is maintained in the ping manager's thread pool(the other being DiscPinger). This type of thread is responsible for creating, sending and retrying the PING packets as well as notifying the ICMP Service Monitor via JSDT of the result of the PING attempt(s).
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
Inner Class Summary | |
private static class |
MonitorPinger.ReplyToSoapDocument
This static class is used to build a compliant SOAP document that is sent to the ICMP service monitor. |
Field Summary | |
private static String |
JSDT_CLIENT_RECEIVER_NAME_PREFIX
This the prefix for the JSDT client to which ICMP poll result messages will be sent. |
private IPPollAddress |
m_addr
The IP Address object to poll. |
private static com.sun.media.jsdt.Channel |
m_channel
JSDT channel through which replies are sent to the ICMP service monitor. |
private static PollerClient |
m_client
JSDT client identifier |
private short |
m_filterID
This is the filterID to include in the icmp echo request message. |
private PCQueue |
m_monitorRequestQ
The monitor request queue is the link between the discovery system and the ICMP service monitor. |
private DiscPingManager |
m_pingMgr
The discover ping manager. |
private DaemonConnection |
m_portal
This is the connection to the icmp daemon that sends and receives request for the discovery process. |
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 | |
MonitorPinger(DiscPingManager pingMgr,
long lThreadID,
PCQueue requestQ,
DaemonConnection portal,
short pingFilterID)
Creates a new monitor ping thread that will attempt to poll addresses as they are added to the request queue. |
Method Summary | |
static com.sun.media.jsdt.Channel |
getChannel()
Static method for retrieving the JSDT channel through which the MonitorPinger threads forwards ICMP poll results to the ICMP service monitor. |
static PollerClient |
getClient()
Static method for retrieving the JSDT client through which the MonitorPinger threads forwards ICMP poll results to the ICMP service monitor. |
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 monitor poller thread. |
static void |
setChannel(com.sun.media.jsdt.Channel replyChannel)
Static method for setting the JSDT channel through which the MonitorPinger threads will forward ICMP poll results to the ICMP service monitor. |
static void |
setClient(PollerClient replyClient)
Static method for setting the JSDT client through which the MonitorPinger threads will forward ICMP poll results to the ICMP service monitor. |
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 static com.sun.media.jsdt.Channel m_channel
private static PollerClient m_client
private static final String JSDT_CLIENT_RECEIVER_NAME_PREFIX
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_monitorRequestQ
The monitor request queue is the link between the discovery system and the ICMP service monitor. The queue is used to hold IPPollAddress objects used by Monitor Pinger objects to generate ICMP requests directed at remote nodes. The data contained by an IPPollAddress object (IP address, timeout, retries) is received via a JSDT connection with the ICMP service monitor.
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 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 DiscPingManager m_pingMgr
The discover ping manager.
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 MonitorPinger(DiscPingManager pingMgr, long lThreadID, PCQueue requestQ, DaemonConnection portal, short pingFilterID)
Creates a new monitor ping thread that will attempt to poll addresses as they are added to the request queue.
pingMgr
- The thread managerlThreadId
- 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.Method Detail |
public static void setChannel(com.sun.media.jsdt.Channel replyChannel)
Static method for setting the JSDT channel through which the MonitorPinger threads will forward ICMP poll results to the ICMP service monitor.
replyChannel
- The JSDT channel for sending repliespublic static com.sun.media.jsdt.Channel getChannel()
Static method for retrieving the JSDT channel through which the MonitorPinger threads forwards ICMP poll results to the ICMP service monitor.
public static void setClient(PollerClient replyClient)
Static method for setting the JSDT client through which the MonitorPinger threads will forward ICMP poll results to the ICMP service monitor.
replyChannel
- The JSDT client for sending repliespublic static PollerClient getClient()
Static method for retrieving the JSDT client through which the MonitorPinger threads forwards ICMP poll results to the ICMP service monitor.
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 monitor poller thread. It waits for new addresses to be served out by the Monitor Request Receiver 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 |