// create viewable per port
final EPLSelectViewable[] viewables = new EPLSelectViewable[context.getInputPorts().size()];
this.viewablesPerPort = viewables;
for (Map.Entry<Integer, DataFlowOpInputPort> entry : context.getInputPorts().entrySet()) {
EPLSelectViewable viewable = new EPLSelectViewable(entry.getValue().getTypeDesc().getEventType());
viewables[entry.getKey()] = viewable;
}
ViewableActivatorFactory activatorFactory = new ViewableActivatorFactory() {
public ViewableActivator createActivator(FilterStreamSpecCompiled filterStreamSpec) {
EPLSelectViewable found = null;
for (EPLSelectViewable viewable : viewables) {
if (viewable.getEventType() == filterStreamSpec.getFilterSpec().getFilterForEventType()) {
found = viewable;
}
}
if (found == null) {
throw new IllegalStateException("Failed to find viewable for filter");
}
final EPLSelectViewable viewable = found;
return new ViewableActivator() {
public ViewableActivationResult activate(AgentInstanceContext agentInstanceContext, boolean isSubselect, boolean isRecoveringResilient) {
return new ViewableActivationResult(viewable, new StopCallback() {public void stop() {}}, null, null, false, false);
}
};