org.mobicents.media.server.impl.clock
Class TimerImpl

java.lang.Object
  extended by org.mobicents.media.server.impl.clock.TimerImpl
All Implemented Interfaces:
org.mobicents.media.server.spi.Timer

public class TimerImpl
extends java.lang.Object
implements org.mobicents.media.server.spi.Timer

Provides repited execution at a reqular time intervals.

Author:
Oleg Kulikov

Field Summary
static int _DEFAULT_T_PRIORITY
           
 
Constructor Summary
TimerImpl()
          Creates new instance of the timer.
 
Method Summary
 int getHeartBeat()
          Gets value of interval between timer ticks.
 long getTimestamp()
           
 void setHeartBeat(int heartBeat)
          Modify interval between timer tick
 java.util.concurrent.ScheduledFuture synchronize(java.lang.Runnable task)
          Synchronizes task from this timer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_DEFAULT_T_PRIORITY

public static final int _DEFAULT_T_PRIORITY
See Also:
Constant Field Values
Constructor Detail

TimerImpl

public TimerImpl()
Creates new instance of the timer.

Method Detail

getHeartBeat

public int getHeartBeat()
Gets value of interval between timer ticks.

Specified by:
getHeartBeat in interface org.mobicents.media.server.spi.Timer
Returns:
the int value in milliseconds.

setHeartBeat

public void setHeartBeat(int heartBeat)
Modify interval between timer tick

Specified by:
setHeartBeat in interface org.mobicents.media.server.spi.Timer
Parameters:
heartBeat - the new value of interval in milliseconds.

synchronize

public java.util.concurrent.ScheduledFuture synchronize(java.lang.Runnable task)
Synchronizes task from this timer.

Specified by:
synchronize in interface org.mobicents.media.server.spi.Timer
Parameters:
task - the task to be synchronized.
Returns:
the action which can be canceled to unsynchronize previously synchronized task

getTimestamp

public long getTimestamp()
Specified by:
getTimestamp in interface org.mobicents.media.server.spi.Timer


Copyright © 2009. All Rights Reserved.