@Override public void exitIntegrationFlowDefStatement(WUMLParser.IntegrationFlowDefStatementContext ctx) { // Create the integration flow when definition is found integrationFlow = new WUMLConfigurationBuilder.IntegrationFlow(ctx.INTEGRATIONFLOWNAME().getText()); super.exitIntegrationFlowDefStatement(ctx); }
@Override public void exitInvokeFromSource(WUMLParser.InvokeFromSourceContext ctx) { // String inbountEndpointName = ctx.INBOUNDENDPOINTNAME().getText(); String pipelineName = ctx.PIPELINENAME().getText(); integrationFlow.getEsbConfigHolder().getInboundEndpoint().setPipeline(pipelineName); pipelineStack.push(pipelineName); // activePipeline = pipelineName; super.exitInvokeFromSource(ctx); }
@Override public void exitIfStatement(WUMLParser.IfStatementContext ctx) { // ctx.expression().EXPRESSIONX() ifMultiThenBlockStarted = false; ifElseBlockStarted = false; if (!filterMediatorStack.isEmpty()) { filterMediatorStack.pop(); } super.exitIfStatement(ctx); }
@Override public void exitOutboundEndpointDefStatement(WUMLParser.OutboundEndpointDefStatementContext ctx) { String protocolName = StringParserUtil.getValueWithinDoubleQuotes( ctx.outboundEndpointDef().PROTOCOLDEF().getText()); String uri = StringParserUtil.getValueWithinDoubleQuotes(ctx.outboundEndpointDef().HOSTDEF().getText()); OutboundEndpoint outboundEndpoint = OutboundEndpointFactory.getOutboundEndpoint( OutboundEndpointType.valueOf(protocolName), ctx.OUTBOUNDENDPOINTNAME().getText(), uri); integrationFlow.getEsbConfigHolder().addOutboundEndpoint(outboundEndpoint); super.exitOutboundEndpointDefStatement(ctx); }
@Override public void exitMessageProcessingDef(WUMLParser.MessageProcessingDefContext ctx) { String mediatorName = ctx.MEDIATORNAME().getText(); String configurations = StringParserUtil.getValueWithinDoubleQuotes(ctx.ARGUMENTLISTDEF().getText()); Mediator mediator = MediatorFactory.getInstance().getMediator(mediatorName, configurations); if (ifMultiThenBlockStarted) { filterMediatorStack.peek().addThenMediator(mediator); } else if (ifElseBlockStarted) { filterMediatorStack.peek().addOtherwiseMediator(mediator); } else { integrationFlow.getEsbConfigHolder().getPipeline(pipelineStack.peek()).addMediator(mediator); } super.exitMessageProcessingDef(ctx); }
@Override public void exitConditionStatement(WUMLParser.ConditionStatementContext ctx) { String sourceDefinition = StringParserUtil.getValueWithinDoubleQuotes(ctx.conditionDef().SOURCEDEF().getText()); Source source = new Source(sourceDefinition); Condition condition = new Condition( source, Pattern.compile( StringParserUtil.getValueWithinDoubleQuotes( ctx.conditionDef().PATTERNDEF().getText()))); FilterMediator filterMediator = new FilterMediator(condition); integrationFlow .getEsbConfigHolder() .getPipeline(pipelineStack.peek()) .addMediator(filterMediator); filterMediatorStack.push(filterMediator); super.exitConditionStatement(ctx); }
@Override public void exitInboundEndpointDefStatement(WUMLParser.InboundEndpointDefStatementContext ctx) { String protocolName = StringParserUtil.getValueWithinDoubleQuotes( ctx.inboundEndpointDef().PROTOCOLDEF().getText()); int port = Integer.parseInt( StringParserUtil.getValueWithinBrackets(ctx.inboundEndpointDef().PORTDEF().getText())); String context = StringParserUtil.getValueWithinDoubleQuotes( ctx.inboundEndpointDef().CONTEXTDEF().getText()); InboundEndpoint inboundEndpoint = InboundEndpointFactory.getInboundEndpoint( InboundEndpointType.valueOf(protocolName), ctx.INBOUNDENDPOINTNAME().getText(), port); if (inboundEndpoint instanceof HTTPInboundEP) { ((HTTPInboundEP) inboundEndpoint).setContext(context); } integrationFlow.getEsbConfigHolder().setInboundEndpoint(inboundEndpoint); super.exitInboundEndpointDefStatement(ctx); }
@Override public void exitInvokeToSource(WUMLParser.InvokeToSourceContext ctx) { Mediator mediator = MediatorFactory.getInstance().getMediator("respond", null); if (ifMultiThenBlockStarted) { filterMediatorStack.peek().addThenMediator(mediator); } else if (ifElseBlockStarted) { filterMediatorStack.peek().addOtherwiseMediator(mediator); } else { // String mediatorName = // StringParserUtil.getValueWithinDoubleQuotes(ctx.MEDIATORNAMESTRINGX().getText()); // String configurations = // StringParserUtil.getValueWithinDoubleQuotes(ctx.CONFIGSDEF().getText()); // Mediator mediator = // MediatorFactory.getMediator(MediatorType.valueOf(mediatorName), configurations); integrationFlow.getEsbConfigHolder().getPipeline(pipelineStack.peek()).addMediator(mediator); } pipelineStack.pop(); super.exitInvokeToSource(ctx); }
@Override public void exitScript(WUMLParser.ScriptContext ctx) { super.exitScript(ctx); }
@Override public void exitHandler(WUMLParser.HandlerContext ctx) { super.exitHandler(ctx); }
@Override public void exitRefStatement(WUMLParser.RefStatementContext ctx) { pipelineStack.push(ctx.PIPELINENAME().getText()); super.exitRefStatement(ctx); }
@Override public void exitExpression(WUMLParser.ExpressionContext ctx) { super.exitExpression(ctx); }
@Override public void enterIfElseBlock(WUMLParser.IfElseBlockContext ctx) { ifMultiThenBlockStarted = false; ifElseBlockStarted = true; super.enterIfElseBlock(ctx); }
@Override public void exitIfElseBlock(WUMLParser.IfElseBlockContext ctx) { ifElseBlockStarted = false; super.exitIfElseBlock(ctx); }
@Override public void exitPipelineDef(WUMLParser.PipelineDefContext ctx) { super.exitPipelineDef(ctx); }
@Override public void exitProcessingStatement(WUMLParser.ProcessingStatementContext ctx) { super.exitProcessingStatement(ctx); }
@Override public void exitPipelineDefStatement(WUMLParser.PipelineDefStatementContext ctx) { Pipeline pipeline = new Pipeline(ctx.PIPELINENAME().getText()); integrationFlow.getEsbConfigHolder().addPipeline(pipeline); super.exitPipelineDefStatement(ctx); }
@Override public void exitParElseBlock(WUMLParser.ParElseBlockContext ctx) { super.exitParElseBlock(ctx); }
@Override public void exitMediatorDef(WUMLParser.MediatorDefContext ctx) { super.exitMediatorDef(ctx); }
@Override public void exitInvokeFromTarget(WUMLParser.InvokeFromTargetContext ctx) { String pipelineName = ctx.PIPELINENAME().getText(); pipelineStack.push(pipelineName); super.exitInvokeFromTarget(ctx); }
@Override public void exitOutboundEndpointDef(WUMLParser.OutboundEndpointDefContext ctx) { super.exitOutboundEndpointDef(ctx); }
@Override public void exitStatement(WUMLParser.StatementContext ctx) { super.exitStatement(ctx); }
@Override public void exitMediatorDefStatement(WUMLParser.MediatorDefStatementContext ctx) { super.exitMediatorDefStatement(ctx); }
@Override public void exitParticipantStatement(WUMLParser.ParticipantStatementContext ctx) { super.exitParticipantStatement(ctx); }
@Override public void exitIntegrationFlowDef(WUMLParser.IntegrationFlowDefContext ctx) { super.exitIntegrationFlowDef(ctx); }
@Override public void exitTitleStatement(WUMLParser.TitleStatementContext ctx) { // Create the integration flow when definition is found integrationFlow = new WUMLConfigurationBuilder.IntegrationFlow(ctx.IDENTIFIER().getText()); super.exitTitleStatement(ctx); }
@Override public void exitParMultiThenBlock(WUMLParser.ParMultiThenBlockContext ctx) { super.exitParMultiThenBlock(ctx); }