Class IntervalTimer
java.lang.Object
com.swiftmq.impl.streams.comp.timer.IntervalTimer
- All Implemented Interfaces:
Timer
Interval Timer implementation. Executes the onTimer callback in an interval.
- Author:
- IIT Software GmbH, Muenster/Germany, (c) 2016, All Rights Reserved
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this Timer.void
collect
(long interval) Internal usedays
(int n) Adds n days to the interval.void
Internal use.TimerListener
Internal use.hours
(int n) Adds n hours to the interval.milliseconds
(long n) Adds n days to the milliseconds.minutes
(int n) Adds n minutes to the interval.name()
Returns the name of the Timer.onTimer
(TimerCallback callback) Sets the onTimer callback.void
Reconfigures this Timer and applies new settingsreset()
Resets the value of a Timerseconds
(int n) Adds n seconds to the interval.void
setTimerListener
(TimerListener listener) Internal use.void
start()
Starts this Timer.toString()
-
Method Details
-
days
Adds n days to the interval.- Parameters:
n
- days- Returns:
- IntervalTimer
-
hours
Adds n hours to the interval.- Parameters:
n
- hours- Returns:
- IntervalTimer
-
minutes
Adds n minutes to the interval.- Parameters:
n
- minutes- Returns:
- IntervalTimer
-
seconds
Adds n seconds to the interval.- Parameters:
n
- seconds- Returns:
- IntervalTimer
-
milliseconds
Adds n days to the milliseconds.- Parameters:
n
- milliseconds- Returns:
- IntervalTimer
-
executeCallback
Description copied from interface:Timer
Internal use.- Specified by:
executeCallback
in interfaceTimer
- Throws:
Exception
-
setTimerListener
public void setTimerListener(TimerListener listener) Description copied from interface:Timer
Internal use.- Specified by:
setTimerListener
in interfaceTimer
-
getTimerListener
public TimerListener getTimerListener()Description copied from interface:Timer
Internal use.- Specified by:
getTimerListener
in interfaceTimer
-
name
Description copied from interface:Timer
Returns the name of the Timer. -
onTimer
Description copied from interface:Timer
Sets the onTimer callback. -
collect
public void collect(long interval) Description copied from interface:Timer
Internal use -
start
Description copied from interface:Timer
Starts this Timer. This method is called automatically if a Timer is created outside a callback. If it is created inside, it must be called explicitly. -
reset
Description copied from interface:Timer
Resets the value of a Timer -
reconfigure
Description copied from interface:Timer
Reconfigures this Timer and applies new settings- Specified by:
reconfigure
in interfaceTimer
- Throws:
Exception
-
close
public void close()Description copied from interface:Timer
Closes this Timer. -
toString
-