public final class _Call extends Object implements _Operation
Instantiate and execute a subordinate state machine.
SMBuilder doubler = new SMBuilder(); doubler._return(new ObjectFunc() { public Object get(StateMachine sm) { int req = ((Integer) sm.request).intValue(); return req * 2; } }); SMBuilder main = new SMBuilder(); main._call(doubler, new ObjectFunc() { public Object get(StateMachine sm) { return sm.request; } }, "rsp"); main._return(new ObjectFunc() { public Object get(StateMachine sm) { return sm.get("rsp"); } }); main.call(3, rp); Response: 6
Modifier and Type | Field and Description |
---|---|
ObjectFunc |
request
The (indirect, optional) argument passed when the state machine was invoked.
|
Constructor and Description |
---|
_Call(_SMBuilder parentSMB,
_SMBuilder smb,
ObjectFunc request,
String resultName)
Create a _Call.
|
public ObjectFunc request
public _Call(_SMBuilder parentSMB, _SMBuilder smb, ObjectFunc request, String resultName)
parentSMB
- The parent builder.smb
- The builder of the state machine to be executed.request
- An (indirect) optional argument passed when the state machine is invoked.resultName
- The name of the result, or null.public void call(SimpleMachine stateMachine, RP rp) throws Exception
call
in interface _Operation
stateMachine
- The state machine driving the operation.rp
- The response processor.Exception
- Any uncaught exceptions raised while performing the operation.Copyright © 2012. All Rights Reserved.