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_throwable
static double
NANOS_PER_MILLI
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPinger(int pingerId, NativeDatagramSocket pingSocket)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addPingReplyListener(PingReplyListener listener)
void
closeSocket()
protected int
getPingerId()
protected NativeDatagramSocket
getPingSocket()
boolean
isFinished()
protected void
notifyPingListeners(InetAddress address, EchoPacket echoReply)
abstract void
ping(T addr, int identifier, int sequenceNumber, long threadId, long count, long interval, int packetSize)
protected void
setThrowable(Throwable e)
void
start()
void
stop()
-
-
-
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)
-
-