org.opennms.jicmp.standalone
Class AbstractPinger<T extends InetAddress>

java.lang.Object
  extended by org.opennms.jicmp.standalone.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
protected  Metric m_metric
           
protected  AtomicReference<Throwable> m_throwable
           
 
Constructor Summary
protected AbstractPinger(NativeDatagramSocket pingSocket)
           
 
Method Summary
 void addPingReplyListener(PingReplyListener listener)
           
 void closeSocket()
           
 int getCount()
           
protected  List<PingReplyListener> getListeners()
           
protected  NativeDatagramSocket getPingSocket()
           
 boolean isFinished()
           
abstract  PingReplyMetric ping(T addr, int id, int sequenceNumber, int count, long interval)
           
 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

m_throwable

protected final AtomicReference<Throwable> m_throwable

m_metric

protected final Metric m_metric
Constructor Detail

AbstractPinger

protected AbstractPinger(NativeDatagramSocket pingSocket)
Method Detail

getPingSocket

protected NativeDatagramSocket getPingSocket()
Returns:
the pingSocket

getCount

public int getCount()

isFinished

public boolean isFinished()

start

public void start()

stop

public void stop()
          throws InterruptedException
Throws:
InterruptedException

closeSocket

public void closeSocket()

getListeners

protected List<PingReplyListener> getListeners()

ping

public abstract PingReplyMetric ping(T addr,
                                     int id,
                                     int sequenceNumber,
                                     int count,
                                     long interval)
                              throws InterruptedException
Throws:
InterruptedException

addPingReplyListener

public void addPingReplyListener(PingReplyListener listener)


Copyright © 2011. All Rights Reserved.