It is up to each DaemonService implementation to define its
level of service, including
MT - all routines on the interface must be MT-safe.
Serviceable
| Modifier and Type | Field and Description |
|---|---|
| public static final String | DaemonOff
Trace flag that can be used to turn off background daemons If DaemonOff is set, background Daemon will not attempt to do anything. |
| public static final String | DaemonTrace
Trace flag that can be used by Daemons to print stuff out |
| public static final int |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public boolean | Returns: true if the daemon indicates it is being overloaded, false it's happy.the object that needs a one time service newClient, boolean if true, this client should be serviced ASAP, as if a
serviceNow has been issued. If false, then this client will be
serviced with the normal scheduled. serviceNow)Request a one time service from the Daemon. |
| public void | |
| public void | |
| public void | serviceNow(int
the number that uniquely identifies the client clientNumber)Service this subscription ASAP. |
| public void | |
| public int | Returns: a client number that uniquely identifies this client (this subscription)a Serviceable object this daemon will service from time to time newClient, boolean only service this client when it ask for service with a serviceNow request onDemandOnly)Add a new client that this daemon needs to service |
| public void | unsubscribe(int
the number that uniquely identify the client clientNumber)Get rid of a client from the daemon. |
| public void |
| DaemonOff | back to summary |
|---|---|
| public static final String DaemonOff Trace flag that can be used to turn off background daemons If DaemonOff is set, background Daemon will not attempt to do anything. | |
| DaemonTrace | back to summary |
|---|---|
| public static final String DaemonTrace Trace flag that can be used by Daemons to print stuff out | |
| TIMER_DELAY | back to summary |
|---|---|
| public static final int TIMER_DELAY | |
| clear | back to summary |
|---|---|
| public void clear() Clear all the queued up work from this daemon. Subscriptions are not affected. | |
| enqueue | back to summary |
|---|---|
| public boolean enqueue(Serviceable newClient, boolean serviceNow) Request a one time service from the Daemon. Unless performWork returns REQUEUE (see Serviceable), the daemon will service this client once and then it will get rid of this client. Since no client number is associated with this client, it cannot request to be serviced or be unsubscribed. The work is always added to the deamon, regardless of the state it returns.
| |
| pause | back to summary |
|---|---|
| public void pause() Pause. No new service is performed until a resume is issued. | |
| resume | back to summary |
|---|---|
| public void resume() Resume service after a pause | |
| serviceNow | back to summary |
|---|---|
| public void serviceNow(int clientNumber) Service this subscription ASAP. When this method is called, the
subscriber's
| |
| stop | back to summary |
|---|---|
| public void stop() End this daemon service | |
| subscribe | back to summary |
|---|---|
| public int subscribe(Serviceable newClient, boolean onDemandOnly) Add a new client that this daemon needs to service
| |
| unsubscribe | back to summary |
|---|---|
| public void unsubscribe(int clientNumber) Get rid of a client from the daemon. If a client is being serviced when
the call is made, the implementation may choose whether or not the call
should block until the client has completed its work. If the call does
not block, the client must be prepared to handle calls to its
| |
| waitUntilQueueIsEmpty | back to summary |
|---|---|
| public void waitUntilQueueIsEmpty() | |