|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eu.mayrhofer.authentication.SafetyBeltTimer
public class SafetyBeltTimer
This is a currently safety belt against the dongle being stuck in authentication mode or the other dongle never entering authentication mode. I.e., it is a safeguard against that specific loop ending up being an endless loop (which is not good in terms of fault tolerance). This helper class implements a "grenade timer" that will let the main event loop bail out with a timeout when it is stuck for too long at the same round number. It is also useful for other purposes, even if it has been created specifically for DongleProtocolHandler#handleDongleCommunication for safeguarding its main loop. There is no need to explicitly stop the thread, it will just time out and stop.
| Constructor Summary | |
|---|---|
SafetyBeltTimer(int time)
|
|
| Method Summary | |
|---|---|
boolean |
isTriggered()
Returns true when the timer has triggered and the task should terminate. |
void |
reset()
Allows to send a hearbeat signal to the timer by resetting it. |
void |
run()
Implements the timer background thread. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SafetyBeltTimer(int time)
time - The time, in milliseconds, that this timer will use.| Method Detail |
|---|
public void run()
run in interface java.lang.Runnablepublic boolean isTriggered()
public void reset()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||