public abstract class BaseWorkerResponseContext extends Object implements WorkerResponseContext
WorkerResponseContext
.Modifier and Type | Field and Description |
---|---|
protected WorkerSignal |
currentSignal |
protected List<CallableUnitCallback> |
responseCallbacks |
protected int[] |
retRegIndexes |
protected WorkerExecutionContext |
targetCtx |
protected int |
workerCount |
protected Map<String,WorkerDataChannel> |
workerDataChannels |
Constructor and Description |
---|
BaseWorkerResponseContext(int workerCount) |
Modifier and Type | Method and Description |
---|---|
protected void |
doFailCallbackNotify(BMap<String,BValue> error) |
protected void |
doSuccessCallbackNotify() |
WorkerDataChannel |
getWorkerDataChannel(String name)
Creates and returns the data channels used to communicate between the workers.
|
WorkerExecutionContext |
joinTargetContextInfo(WorkerExecutionContext targetCtx,
int[] retRegIndexes)
Joins a new target worker execution context to the current response
context.
|
protected void |
modifyDebugCommands(WorkerExecutionContext parent,
WorkerExecutionContext child) |
protected WorkerExecutionContext |
onError(WorkerSignal signal) |
protected WorkerExecutionContext |
onHalt(WorkerSignal signal) |
protected void |
onMessage(WorkerSignal signal) |
protected WorkerExecutionContext |
onReturn(WorkerSignal signal) |
protected WorkerExecutionContext |
onTimeout(WorkerSignal signal) |
void |
registerResponseCallback(CallableUnitCallback responseCallback)
Registers a response callback handler with this context.
|
WorkerExecutionContext |
signal(WorkerSignal signal)
This is called by the workers to signal the response context of any
signal that needs to be passed into.
|
protected int[] retRegIndexes
protected WorkerSignal currentSignal
protected List<CallableUnitCallback> responseCallbacks
protected WorkerExecutionContext targetCtx
protected Map<String,WorkerDataChannel> workerDataChannels
protected int workerCount
public WorkerExecutionContext signal(WorkerSignal signal)
WorkerResponseContext
signal
in interface WorkerResponseContext
signal
- the signal to be passed inprotected WorkerExecutionContext onTimeout(WorkerSignal signal)
protected void onMessage(WorkerSignal signal)
protected WorkerExecutionContext onHalt(WorkerSignal signal)
protected WorkerExecutionContext onError(WorkerSignal signal)
protected WorkerExecutionContext onReturn(WorkerSignal signal)
protected void modifyDebugCommands(WorkerExecutionContext parent, WorkerExecutionContext child)
public WorkerExecutionContext joinTargetContextInfo(WorkerExecutionContext targetCtx, int[] retRegIndexes)
WorkerResponseContext
joinTargetContextInfo
in interface WorkerResponseContext
targetCtx
- the target worker execution contextretRegIndexes
- the return registry locations of the target execution context
where the current worker execution context should report topublic WorkerDataChannel getWorkerDataChannel(String name)
WorkerResponseContext
getWorkerDataChannel
in interface WorkerResponseContext
name
- the unique name of the data channel name requestedpublic void registerResponseCallback(CallableUnitCallback responseCallback)
responseCallback
- the response callbackprotected void doSuccessCallbackNotify()
Copyright © 2018 WSO2. All rights reserved.