|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IProcessListener
A listener for Process
events.
Process.addEventListener(IProcessListener)
Field Summary | |
---|---|
static int |
PE_FLOW_ADDED
A constant indicating that a flow was added to the process. |
static int |
PE_FLOW_REMOVED
A constant indicating that a flow was removed from the process. |
static int |
PE_FLOW_SUSPENDED
A constant indicating that a flow was suspended. |
static int |
PE_RESUMING_FLOW
A constant indicating that a suspended flow is about to be resumed. |
Method Summary | |
---|---|
void |
onEvent(Process sender,
int event,
Flow flow)
Called when an event happens on a process. |
Field Detail |
---|
static final int PE_FLOW_ADDED
Flow.joinProcess(Process)
. If a flow
that belongs to the process is subject to Flow.fork(int)
or
Flow.split(int)
, the new flows are automatically added to the
process, triggering this event.
The added flow may be Flow.ACTIVE
or Flow.SUSPENDED
.
static final int PE_FLOW_REMOVED
Flow.end()
method, it's removed
from its process. Flows can be explicitly removed from a process using
Flow.leaveProcess()
. If a flow that belongs to the process is
subject to Flow.merge()
, it's also removed from the process,
triggerind this process.
static final int PE_FLOW_SUSPENDED
Flow.suspend(Object)
method, but some APIs such as
Process.receive(Object)
may cause a flow to be temporarily
suspended.
static final int PE_RESUMING_FLOW
Flow.split(int)
is issued on a flow that belongs to a process,
new suspended flows are created, then added to the process, and finally
they are resumed. Some APIs such as Process.receive(Object)
may
cause a flow to be temporarily suspended and resumed.
Method Detail |
---|
void onEvent(Process sender, int event, Flow flow)
Process
becomes idle, so it can be
passivated immediately or in the future.
This method should execute briefly and must not throw an exception. Any
thrown exception is simply logged and then ignored. This method is called
inside a synchronized block on the informed process, so that
Thread.holdsLock(sender)
always return
true
during execution of this method.
sender
- The process on which the event happened.event
- The event that happened on the process. See the
PE_
constants declared on this interface.flow
- The flow associated with the event. This is the flow being
added, removed, suspended or resumed. May be null
if
the event is not about a flow.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |