public class FabricTimerManager
extends java.lang.Object
Title: Framework Support Library
Description: Defines a manager controlling FabricTimer
objects.
Copyright: Copyright (c) 2012
Company: StreamScape Technologies
Constructor and Description |
---|
FabricTimerManager() |
Modifier and Type | Method and Description |
---|---|
FabricTimer |
createTimer(java.lang.String group,
java.lang.String name,
FabricTimerTask task,
long interval,
int repeatCount)
Creates a new timer with the specified parameters.
|
void |
dropTimer(java.lang.String group,
java.lang.String name)
Drops the specified timer (this timer will be canceled before).
|
boolean |
existsTimer(java.lang.String group,
java.lang.String name)
Checks if the specified timer exists in the specified group.
|
boolean |
existsTimerGroup(java.lang.String group)
Checks if the specified group exists.
|
static FabricTimerManager |
getInstance()
Returns an instance of the singleton.
|
FabricTimer |
getTimer(java.lang.String group,
java.lang.String name)
Returns the specified timer containing in the specified group.
|
java.util.List |
listTimerGroups()
Returns a list of the all groups.
|
java.util.List |
listTimers(java.lang.String group)
Returns a list of names of all timers in the specified group.
|
public static FabricTimerManager getInstance()
public FabricTimer createTimer(java.lang.String group, java.lang.String name, FabricTimerTask task, long interval, int repeatCount) throws FabricTimerException
group
- the name of the timer's group.name
- the name of the timer (it should be unique within the group).task
- the TimerTask
that is executed in response to the timer state change.interval
- the timer countdown interval in milliseconds.repeatCount
- the number of times this timer should be executed (creating a repeating loop).
If value <= 0 then the task will be executed infinitely until a canceling.FabricTimerException
- if the specified timer already exists or any parameter is invalid.public void dropTimer(java.lang.String group, java.lang.String name)
group
- the name of the timer's group.name
- the name of the timer.public boolean existsTimerGroup(java.lang.String group)
group
- the name of the group.true
if the specified group exists, false
otherwise.public java.util.List listTimerGroups()
public boolean existsTimer(java.lang.String group, java.lang.String name)
group
- the name of the timer's group.name
- the name of the timer.true
if the specified timer exists in the specified group, false
otherwise.public FabricTimer getTimer(java.lang.String group, java.lang.String name)
group
- the name of the timer's group.name
- the name of the timer.null
if the timer is not found.public java.util.List listTimers(java.lang.String group)
group
- the name of the timer's group.Copyright © 2015-2024 StreamScape Technologies. All rights reserved.