OpenNMS API 1.2.3

org.opennms.protocols.snmp
Class SnmpTimer

java.lang.Object
  extended byorg.opennms.protocols.snmp.SnmpTimer

class SnmpTimer
extends java.lang.Object

Provides a simple timer scheduler for use by the internal SnmpSession class. Resolution is provided at the millisecond level.

Version:
1.1.1.1
Author:
Brian Weaver
See Also:
SnmpSession

Nested Class Summary
private  class SnmpTimer.Scheduler
          This object is the thread of execution that monitors and executes the scheduled runnables.
private  class SnmpTimer.TimeoutElement
          Used to track the individual runnables and when the runnable "expires".
 
Field Summary
private  boolean m_exit
          when true the internal thread should exit
private  java.util.LinkedList m_list
          The list of runnable objects (stored as TimeoutElement)
private  java.lang.Object m_sync
          The synchronization object
private  java.lang.Thread m_thread
          The thread doing the scheduling
 
Constructor Summary
(package private) SnmpTimer()
          Creates an SnmpTime object and it's internal thread that is used to schedual the execution of the runnables.
 
Method Summary
(package private)  void cancel()
          Cancels the current timer object and terminates the internal thread
(package private)  void schedule(java.lang.Runnable runner, long milliseconds)
          Schedules the runnable to be run after AT LEAST ms milliseconds of time has expired.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_list

private java.util.LinkedList m_list
The list of runnable objects (stored as TimeoutElement)


m_thread

private java.lang.Thread m_thread
The thread doing the scheduling


m_exit

private boolean m_exit
when true the internal thread should exit


m_sync

private java.lang.Object m_sync
The synchronization object

Constructor Detail

SnmpTimer

SnmpTimer()
Creates an SnmpTime object and it's internal thread that is used to schedual the execution of the runnables.

Method Detail

schedule

void schedule(java.lang.Runnable runner,
              long milliseconds)
Schedules the runnable to be run after AT LEAST ms milliseconds of time has expired. The runnable may be invoked in a delayed manner, but will not be run BEFORE ms milliseconds have expired.

Parameters:
runner - The runnable object
milliseconds - The number of milliseconds to wait

cancel

void cancel()
Cancels the current timer object and terminates the internal thread


OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.