|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.TimerTask
stella.io.PollingRS485Server.Poller
protected class PollingRS485Server.Poller
The polling timer task. Once started this thread writes a command to the
serial server and block-reads the return value. This return value is then
stored in the embedding class's chache. After one value has been
retrieved this thread is rescheduled after a certain time, specified by
PollingRS485Server.KEY_POLLBASE. To allow different read-out times in active and
passive states, the poller drops some read cycles, depending on
PollingRS485Server.KEY_ACTIVEDROP and PollingRS485Server.KEY_PASSIVEDROP.
| Field Summary | |
|---|---|
private Trigger |
cycle
True if polling is retrieving data. |
private int |
dropcycle
The dropping counter. |
private int |
listindex
The actual index in the list. |
private Object |
monitor
An object to notify on the start of each run. |
private int |
polldrop
The actual polldrop of the poller. |
private List |
pollist
The actual poller's list of keys to poll. |
private boolean |
running
True if poller is running. |
| Constructor Summary | |
|---|---|
protected |
PollingRS485Server.Poller()
Constructs a new polling thread. |
| Method Summary | |
|---|---|
boolean |
cancel()
Cancels this polling thread. |
boolean |
isRunning()
Returns the status of the running flag. |
private void |
notifyCacheList(String key,
String newval)
Notifies all listeners subscribed to the specified key. |
void |
run()
The run method of the poller. |
private void |
setMonitor(Object mon)
Sets an object that should be notified at the start of each run cycle. |
protected void |
setPollingDrop(int newdrop)
Sets the list of command this poller should query. |
protected void |
setPollingList(List newlist)
Sets the list of command this poller should query. |
| Methods inherited from class java.util.TimerTask |
|---|
scheduledExecutionTime |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private List pollist
private int listindex
private int polldrop
private int dropcycle
private Trigger cycle
private boolean running
private Object monitor
| Constructor Detail |
|---|
protected PollingRS485Server.Poller()
| Method Detail |
|---|
private void setMonitor(Object mon)
public void run()
CacheChangedListeners. The null element is allowed in the
cache and may even spark the listener's notification.
A call to cancel() allows this thread to die.
run in interface Runnablerun in class TimerTaskpublic boolean cancel()
PollingRS485Server.KEY_POLLBASE multiplied by the current drop
rate.
cancel in class TimerTaskpublic boolean isRunning()
protected void setPollingList(List newlist)
protected void setPollingDrop(int newdrop)
private void notifyCacheList(String key,
String newval)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||