|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
To use a DaemonService, one implements the Serviceable interface. Only one DaemonService will call this at any given time. However, if this Serviceable object subscribes to or enqueues to the DeamonService multiple times, then multiple DaemonService threads may call this Serviceable object at the same time. The Serviceable object must decide what synchronization it needs to provide depending on what work it needs to do. The Serviceable interface does not provide a way to pass a work object to identify what work needs to be done, it is assumed that the Serviceable object knows that. If a Serviceable object has different work for the DaemonService to do, it must somehow encapsulate or identify the different work by an intermediary object which implements the Serviceable interface and which can an identify the different work and pass it along to the object that can deal with them.
Field Summary | |
static int |
DONE
return status for performWork - only meaningful for enqueued client |
static int |
REQUEUE
|
Method Summary | |
int |
performWork(ContextManager context)
Do whatever it is that you want the daemon to do for you. |
boolean |
serviceASAP()
If this work should be done as soon as possible, then return true. |
boolean |
serviceImmediately()
If this work should be done immediately on the user thread then return true. |
Field Detail |
public static final int DONE
public static final int REQUEUE
Method Detail |
public int performWork(ContextManager context) throws StandardException
context
- the contextManager set up by the DaemonService. There
may or may not be the necessary context on it, depending on which other
Serviceable object it has done work for.
StandardException
- Standard cloudscape exception policy
MT - depends on the work. Be wary of multiple DaemonService thread calling at the same time if you subscribe or enqueue multiple times.
public boolean serviceASAP()
MT - MT safe
public boolean serviceImmediately()
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |