org.opennms.netmgt.icmp.jna
Class AbstractPinger<T extends InetAddress>

java.lang.Object
  extended by org.opennms.netmgt.icmp.jna.AbstractPinger<T>
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
V4Pinger, V6Pinger

public abstract class AbstractPinger<T extends InetAddress>
extends Object
implements Runnable

JnaPinger

Author:
brozow

Field Summary
static double NANOS_PER_MILLI
           
 
Constructor Summary
protected AbstractPinger(int pingerId, NativeDatagramSocket pingSocket)
           
 
Method Summary
 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)
           
protected  void setThrowable(Throwable e)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Field Detail

NANOS_PER_MILLI

public static final double NANOS_PER_MILLI
See Also:
Constant Field Values
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)
                   throws InterruptedException
Throws:
InterruptedException

addPingReplyListener

public void addPingReplyListener(PingReplyListener listener)

notifyPingListeners

protected void notifyPingListeners(InetAddress address,
                                   EchoPacket echoReply)

setThrowable

protected void setThrowable(Throwable e)


Copyright © 2011. All Rights Reserved.