Package org.opennms.netmgt.icmp.jna
Class AbstractPinger<T extends InetAddress>
- java.lang.Object
-
- org.opennms.netmgt.icmp.jna.AbstractPinger<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected AtomicReference<Throwable>m_throwablestatic doubleNANOS_PER_MILLI
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPinger(int pingerId, NativeDatagramSocket pingSocket)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddPingReplyListener(PingReplyListener listener)voidcloseSocket()protected intgetPingerId()protected NativeDatagramSocketgetPingSocket()booleanisFinished()protected voidnotifyPingListeners(InetAddress address, EchoPacket echoReply)abstract voidping(T addr, int identifier, int sequenceNumber, long threadId, long count, long interval, int packetSize)protected voidsetThrowable(Throwable e)voidstart()voidstop()
-
-
-
Field Detail
-
NANOS_PER_MILLI
public static final double NANOS_PER_MILLI
- See Also:
- Constant Field Values
-
m_throwable
protected final AtomicReference<Throwable> m_throwable
-
-
Constructor Detail
-
AbstractPinger
protected AbstractPinger(int pingerId, NativeDatagramSocket pingSocket)
-
-
Method Detail
-
getPingSocket
protected NativeDatagramSocket getPingSocket()
- Returns:
- the pingSocket
-
getPingerId
protected int getPingerId()
-
isFinished
public boolean isFinished()
-
start
public void start()
-
stop
public void stop() throws InterruptedException- Throws:
InterruptedException
-
closeSocket
public void closeSocket()
-
ping
public abstract void ping(T addr, int identifier, int sequenceNumber, long threadId, long count, long interval, int packetSize) throws InterruptedException
- Throws:
InterruptedException
-
addPingReplyListener
public void addPingReplyListener(PingReplyListener listener)
-
notifyPingListeners
protected void notifyPingListeners(InetAddress address, EchoPacket echoReply)
-
setThrowable
protected void setThrowable(Throwable e)
-
-