A thread which can poll Pollable classes at regular intervals.
The PollThread is not started until the startPolling()
method is invoked. PollThreads can poll as many resources as necessary.
Pollable resources are added to the thread with the add(Pollable p)
method. If a Pollable object is already in the PollThread's list of
resources then it will not be added again. Resources can be added after
polling has been started.
Here is an example of creating a poll thread:
PollThread t = new PollThread();
t.add(pollable);
t.startPolling();
author: Anthony Eden |