use of io.s4.message.SinglePERequest in project core by s4.
the class ControlEventProcessor method execute.
protected void execute(EventWrapper e, PrototypeWrapper p) {
List<CompoundKeyInfo> keyInfoList = e.getCompoundKeys();
Object event = e.getEvent();
if (event instanceof SinglePERequest) {
// Handle Requests to individual PEs
if (keyInfoList.isEmpty())
return;
CompoundKeyInfo keyInfo = keyInfoList.get(0);
String keyVal = keyInfo.getCompoundValue();
ProcessingElement pe = p.lookupPE(keyVal);
Response response = ((SinglePERequest) event).evaluate(pe);
String stream = response.getRInfo().getStream();
dispatcher.dispatchEvent(stream, response);
} else if (event instanceof PrototypeRequest) {
// Or handle aggregate requests to Prototypes.
Response response = ((PrototypeRequest) event).evaluate(p);
String stream = response.getRInfo().getStream();
dispatcher.dispatchEvent(stream, response);
}
}
Aggregations