|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorca.shirako.kernel.ConcurrentTick
public class ConcurrentTick
| Nested Class Summary | |
|---|---|
protected class |
ConcurrentTick.Ticker
This is the main timer thread. |
| Field Summary | |
|---|---|
protected long |
beginningOfTime
Cycle offset in milliseconds. |
protected ActorClock |
clockFactory
The clock factory. |
protected java.lang.Object |
clockLock
Lock controlling the access to cycle. |
protected long |
cycle
The current clock value. |
protected long |
cycleMillis
Cycle length in milliseconds. |
protected LoggingTool |
logger
The logger. |
protected boolean |
manual
|
protected boolean |
stopped
Are we active? |
protected java.util.Hashtable<ITick,orca.shirako.kernel.ConcurrentTick.ItemTicker> |
tickers
All tickable items. |
protected ConcurrentTick.Ticker |
timer
The timer thread. |
| Constructor Summary | |
|---|---|
ConcurrentTick(LoggingTool logger)
|
|
| Method Summary | |
|---|---|
void |
addTickable(ITick tickable)
|
void |
clear()
Stops the ticker and unregisters all registered items. |
long |
getBeginnigOfTime()
Returns the cycle offset. |
long |
getCurrentCycle()
Returns the current time |
long |
getCycleMillis()
Returns the cyle length. |
void |
initialize()
Initializes the object. |
boolean |
isManual()
|
void |
removeTickable(ITick tickable)
|
void |
setBeginningOfTime(long value)
Sets the cycle offset. |
void |
setCurrentCycle(long cycle)
Sets the current cycle. |
void |
setCycleMillis(long cycleMillis)
Sets the cycle length. |
void |
setLogger(LoggingTool logger)
Attaches the logger. |
void |
setManual(boolean value)
|
void |
startThread()
|
void |
stop()
|
void |
tick()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ConcurrentTick.Ticker timer
protected java.util.Hashtable<ITick,orca.shirako.kernel.ConcurrentTick.ItemTicker> tickers
protected LoggingTool logger
protected boolean stopped
protected long cycleMillis
protected long beginningOfTime
protected long cycle
protected java.lang.Object clockLock
cycle.
protected ActorClock clockFactory
protected boolean manual
| Constructor Detail |
|---|
public ConcurrentTick(LoggingTool logger)
| Method Detail |
|---|
public void initialize()
throws java.lang.Exception
IInitialize
initialize in interface IInitializeinitialize in interface ITickerjava.lang.Exceptionpublic void tick()
tick in interface ITickerpublic void startThread()
startThread in interface ITickerpublic void addTickable(ITick tickable)
addTickable in interface ITickerpublic void removeTickable(ITick tickable)
removeTickable in interface ITicker
public void stop()
throws java.lang.Exception
stop in interface ITickerjava.lang.Exception
public void clear()
throws java.lang.Exception
ITicker
clear in interface ITickerjava.lang.Exceptionpublic long getCurrentCycle()
ITicker
getCurrentCycle in interface ITickerpublic void setLogger(LoggingTool logger)
ITicker
setLogger in interface ITickerlogger - logger to usepublic void setBeginningOfTime(long value)
ITicker
setBeginningOfTime in interface ITickervalue - cycle offset in millisecondspublic long getBeginnigOfTime()
ITicker
getBeginnigOfTime in interface ITickerpublic long getCycleMillis()
ITicker
getCycleMillis in interface ITickerpublic void setCycleMillis(long cycleMillis)
ITicker
setCycleMillis in interface ITickercycleMillis - cycle length in millisecondspublic void setCurrentCycle(long cycle)
ITicker
setCurrentCycle in interface ITickercycle - current cyclepublic boolean isManual()
isManual in interface ITickerpublic void setManual(boolean value)
setManual in interface ITicker
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||