BasicDaemon
public interface DaemonService
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 | Description |
---|---|---|
static java.lang.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.
|
static java.lang.String |
DaemonTrace |
Trace flag that can be used by Daemons to print stuff out
|
static int |
TIMER_DELAY |
Modifier and Type | Method | Description |
---|---|---|
void |
clear() |
Clear all the queued up work from this daemon.
|
boolean |
enqueue(Serviceable newClient,
boolean serviceNow) |
Request a one time service from the Daemon.
|
void |
pause() |
Pause.
|
void |
resume() |
Resume service after a pause
|
void |
serviceNow(int clientNumber) |
Service this subscription ASAP.
|
void |
stop() |
End this daemon service
|
int |
subscribe(Serviceable newClient,
boolean onDemandOnly) |
Add a new client that this daemon needs to service
|
void |
unsubscribe(int clientNumber) |
Get rid of a client from the daemon.
|
void |
waitUntilQueueIsEmpty() |
static final int TIMER_DELAY
static final java.lang.String DaemonTrace
static final java.lang.String DaemonOff
int subscribe(Serviceable newClient, boolean onDemandOnly)
newClient
- a Serviceable object this daemon will service from time to timeonDemandOnly
- only service this client when it ask for service with a serviceNow requestvoid unsubscribe(int clientNumber)
performWork()
method even after unsubscribe()
has returned.clientNumber
- the number that uniquely identify the clientvoid serviceNow(int clientNumber)
performWork()
method is guaranteed to be
invoked at some point in the future. However, there is no guarantee that
a subscriber's performWork()
is called the same number of
times as the subscriber calls this method. More precisely, if a
subscriber is waiting for this daemon service to invoke its
performWork()
method, the daemon service may, but is not
required to, ignore requests from that subscriber until the
performWork()
method has been invoked.clientNumber
- the number that uniquely identifies the clientboolean enqueue(Serviceable newClient, boolean serviceNow)
newClient
- the object that needs a one time serviceserviceNow
- 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.void pause()
void resume()
void stop()
void clear()
void waitUntilQueueIsEmpty()
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.