|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.werken.blissed.ProcessEngine
Process controller engine.
Constructor Summary | |
ProcessEngine()
Construct. |
Method Summary | |
void |
call(Process process,
ProcessContext context)
Call another Process from another instance. |
boolean |
checkTransitions(ProcessContext context)
Check a ProcessContext for progress possibilities. |
protected void |
enterState(State state,
ProcessContext context)
Enter a State for a particular
ProcessContext . |
protected void |
exitState(State state,
ProcessContext context)
Exit a State for a particular
ProcessContext . |
protected void |
finishProcess(Process process,
ProcessContext context)
Finish a Process for a particular
ProcessContext . |
protected void |
followTransition(ProcessContext context,
Transition transition)
Cause a ProcessContext to follow a passing
Transition . |
int |
getThreads()
Retrieve the number of service threads. |
boolean |
hasContextToService()
Determine if this engine has a ProcessContext
waiting in the queue. |
boolean |
isStarted()
Determine if this ProcessEngine is started. |
void |
run()
Run the service thread loop. |
void |
setThreads(int numThreads)
Set the number of service threads. |
ProcessContext |
spawn(Process process)
Spawn an instance of a Process . |
ProcessContext |
spawn(Process process,
boolean async)
Spawn an instance of a Process . |
ProcessContext |
spawn(Process process,
ProcessContext parent)
Spawn an instance of a Process as a child
of another instance. |
void |
start()
Start the service threads. |
protected void |
startProcess(Process process,
ProcessContext context)
Begin a Process for a particular
ProcessContext . |
void |
stop()
Stop the service threads. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ProcessEngine()
Method Detail |
public void setThreads(int numThreads)
numThreads
- Number of service threads.public int getThreads()
public void start()
public void stop() throws java.lang.InterruptedException
java.lang.InterruptedException
- If the calling thread is interrupted
while waiting for service threads to terminate.public boolean isStarted()
ProcessEngine
is started.true
if this process engine is started
and servicing the queue, otherwise false
.public void run()
run
in interface java.lang.Runnable
public boolean hasContextToService()
ProcessContext
waiting in the queue.true
if a process context is available
for servicing, otherwise false
.public ProcessContext spawn(Process process) throws ActivityException, InvalidMotionException
Process
.process
- The process to spawn.ProcessContext
representing the
instance of the newly spawned process.ActivityException
- If an activity causes an error.InvalidMotionException
- If a motion error occurs while
attempting to spawn the process.public ProcessContext spawn(Process process, boolean async) throws ActivityException, InvalidMotionException
Process
.process
- The process to spawn.async
- Flag indicating if processing of context should
occur asynchronously, or if it should use the
calling thread for motion.ProcessContext
representing the
instance of the newly spawned process.ActivityException
- If an activity causes an error.InvalidMotionException
- If a motion error occurs while
attempting to spawn the process.public ProcessContext spawn(Process process, ProcessContext parent) throws ActivityException, InvalidMotionException
Process
as a child
of another instance.process
- The process to spawn.parent
- The parent context.ProcessContext
representing the
instance of the newly spawned process.ActivityException
- If an activity causes an error.InvalidMotionException
- If a motion error occurs while
attempting to spawn the process.public void call(Process process, ProcessContext context) throws ActivityException, InvalidMotionException
Process
from another instance.process
- The process to call.context
- The process context.ActivityException
- If an activity causes an error.InvalidMotionException
- If a motion error occurs while
attempting to spawn the process.protected void startProcess(Process process, ProcessContext context) throws ActivityException, InvalidMotionException
Process
for a particular
ProcessContext
.process
- The process to start.context
- The process context.ActivityException
- If an activity causes an error.InvalidMotionException
- If a motion error occurs while
attempting to begin a process.protected void enterState(State state, ProcessContext context) throws ActivityException, InvalidMotionException
State
for a particular
ProcessContext
.state
- The state to enter.context
- The process context.ActivityException
- If an activity causes an error.InvalidMotionException
- If a motion error occurs while
attempting to enter a state.protected void exitState(State state, ProcessContext context) throws InvalidMotionException
State
for a particular
ProcessContext
.state
- The state to exit.context
- The process context.InvalidMotionException
- If a motion error occurs while
attempting to exit a state.protected void finishProcess(Process process, ProcessContext context) throws InvalidMotionException
Process
for a particular
ProcessContext
.process
- The process to finish.context
- The process context.InvalidMotionException
- If a motion error occurs while
attempting to finish a process.public boolean checkTransitions(ProcessContext context) throws ActivityException, InvalidMotionException
ProcessContext
for progress possibilities.context
- The context to check.true
if the ProcessContext
performed
motion, otherwise false
.ActivityException
- If an activity causes an error.InvalidMotionException
- If the transitions of the context attempt
an invalid motion.protected void followTransition(ProcessContext context, Transition transition) throws ActivityException, InvalidMotionException
ProcessContext
to follow a passing
Transition
.context
- The process context.transition
- The passing transition.ActivityException
- If an activity causes an error.InvalidMotionException
- If the process context may not
transition.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |