@Override public AstBoundNode visitBoundNode(BoundNodeContext ctx) { node = new AstBoundNode(); node.setRegionInfo(asSequentialRegion(childInfos, ctx)); return node; }
@Override public AstScriptNode visit(AstConnectedNode connectedNode, State state) { switch (state.connectivityState) { case NONE: case OPENED: AstBoundNode boundNode = new AstBoundNode(); boundNode.setRegionInfo(connectedNode.getRegionInfo()); boundNode.accept(this, state); break; default: break; } // The above switch might have changed the connectivity state, so // we switch on it again switch (state.connectivityState) { case BOUND: state.streamables.add(connectedNode); state.connectivityState = ConnectivityState.CONNECTED; break; default: throw new IllegalStateException("Unexpected event: connected"); } return null; }
@Override public Configuration visit(AstBoundNode node, State state) { RegionInfo regionInfo = node.getRegionInfo(); BoundHandler handler = new BoundHandler(); handler.setRegionInfo(regionInfo); Map<String, ChannelHandler> pipelineAsMap = state.pipelineAsMap; String handlerName = String.format("bound#%d", pipelineAsMap.size() + 1); pipelineAsMap.put(handlerName, handler); return state.configuration; }
public AstBoundNodeBuilder() { this(new AstBoundNode()); }
@Override public AstBoundNode visitBoundNode(BoundNodeContext ctx) { AstBoundNodeVisitor visitor = new AstBoundNodeVisitor(factory, environment); AstBoundNode boundNode = visitor.visitBoundNode(ctx); if (boundNode != null) { childInfos().add(boundNode.getRegionInfo()); } return boundNode; }
public StreamNested(R builder) { super(new AstBoundNode(), builder); }
@Override public AstScriptNode visit(AstBoundNode boundNode, State state) { switch (state.connectivityState) { case NONE: AstOpenedNode openedNode = new AstOpenedNode(); openedNode.setRegionInfo(boundNode.getRegionInfo()); openedNode.accept(this, state); break; default: break; } // The above switch might have changed the connectivity state, so // we switch on it again switch (state.connectivityState) { case OPENED: state.streamables.add(boundNode); state.connectivityState = ConnectivityState.BOUND; break; default: throw new IllegalStateException("Unexpected event: bound"); } return null; }