|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread bexee.core.Dispatcher
This class is used to lookup or create a ProcessInstance
given
an inbound BexeeMessage
and dispatch the message to the
ProcessController
either synchronously or asynchronoulsy.
To do this, create the object and then use its dispatch()
method.
When the Dispatcher
kicks off the
ProcessController
it will know, whether a synchronous or
asynchronous BPEL process is to be started. Depending on that it will either
return right away after starting the process for an asynchronous BPEL process
or it will wait until the result is available for a synchronous BPEL process.
Either way the ProcessController
's
processMessage()
method is started in a new Thread, but in
case of a synchronous BPEL process the Dispatcher
will wait
until the result is available. This happens by obtaining a lock on the
ProcessContext
, which will notify the Dispatcher
when the result is available.
Field Summary | |
static java.lang.String |
ASYNC_RESULT
Result when processing an asynchronous result. |
protected ProcessController |
controller
|
protected ProcessInstance |
instance
|
protected BexeeMessage |
message
|
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
Dispatcher(BexeeMessage message)
Creates a new Dispatcher object. |
Method Summary | |
java.lang.Object |
dispatch()
Calls the ProcessController s
ProcessController.processMessage(ProcessInstance, BexeeMessage)
method either synchronously or asynchronously.
|
protected BPELProcess |
getBPELProcess(BexeeMessage message)
Gets the BPELProcess belonging to the incoming message. |
protected ProcessContext |
getProcessContext(BexeeMessage message)
Gets the ProcessContext belonging to the incoming message. |
void |
run()
Do not use this method directly. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String ASYNC_RESULT
protected ProcessController controller
protected ProcessInstance instance
protected BexeeMessage message
Constructor Detail |
public Dispatcher(BexeeMessage message)
Dispatcher
object.
message
- the incoming messageMethod Detail |
public java.lang.Object dispatch() throws DispatcherException
ProcessController
s
ProcessController.processMessage(ProcessInstance, BexeeMessage)
method either synchronously or asynchronously.
Note that this method may take minutes or hours for long-running synchronous processes.
DispatcherException
- If something went wrong dispatching the message. This can
happen for example if the BPELProcess
or the
ProcessContext
can't be found or created or if
something went wrong processing the message in the
ProcessController
.public void run()
dispatch()
instead.
protected ProcessContext getProcessContext(BexeeMessage message)
ProcessContext
belonging to the incoming message.
message
- the incoming message
ProcessContext
if there is currently no
process running or the ProcessContext
instance
belonging to the incoming message if there is a process running
already.protected BPELProcess getBPELProcess(BexeeMessage message)
BPELProcess
belonging to the incoming message.
message
- the incoming message
BPELProcess
that will be identified by the
incoming message or null if it can't be found.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |