Package org.switchyard.component.rules.exchange

Examples of org.switchyard.component.rules.exchange.RulesExchangeHandler.start()


        RulesComponentImplementationModel rci_model = (RulesComponentImplementationModel)new RulesSwitchYardScanner().scan(AccessAttachment.class).getImplementation();
        QName serviceName = new QName("AccessAttachment");
        RulesExchangeHandler handler = new RulesExchangeHandler(rci_model, serviceDomain, serviceName);
        Service service = serviceDomain.registerService(serviceName, JavaService.fromClass(AccessAttachment.class), handler);
        serviceDomain.registerServiceReference(service.getName(), service.getInterface(), service.getProviderHandler());
        handler.start();
        DataSource attachment = new TestDataSource("someAttach", "text/plain", "someAttachData");
        new Invoker(serviceDomain, serviceName).operation("process").attachment(attachment.getName(), attachment).sendInOnly(holder);
        handler.stop();
        Assert.assertEquals("someAttachData", holder.getValue());
    }
View Full Code Here


        RulesComponentImplementationModel rci_model = (RulesComponentImplementationModel)new RulesSwitchYardScanner().scan(DecisionTable.class).getImplementation();
        QName serviceName = new QName("DecisionTable");
        RulesExchangeHandler handler = new RulesExchangeHandler(rci_model, serviceDomain, serviceName);
        Service service = serviceDomain.registerService(serviceName, JavaService.fromClass(DecisionTable.class), handler);
        serviceDomain.registerServiceReference(service.getName(), service.getInterface(), service.getProviderHandler());
        handler.start();
        List<Object> list = new ArrayList<Object>();
        Invoker invoker = new Invoker(serviceDomain, serviceName);
        invoker.operation("insert").property("list", list).sendInOnly(new Cheese("stilton", 42));
        invoker.operation("insert").sendInOnly(new Person("michael", "stilton", 42));
        invoker.operation("fireAllRules").sendInOnly(null);
View Full Code Here

        RulesComponentImplementationModel rci_model = (RulesComponentImplementationModel)new RulesSwitchYardScanner().scan(NamedWorksheet.class).getImplementation();
        QName serviceName = new QName("NamedWorksheet");
        RulesExchangeHandler handler = new RulesExchangeHandler(rci_model, serviceDomain, serviceName);
        Service service = serviceDomain.registerService(serviceName, JavaService.fromClass(NamedWorksheet.class), handler);
        serviceDomain.registerServiceReference(service.getName(), service.getInterface(), service.getProviderHandler());
        handler.start();
        List<Object> list = new ArrayList<Object>();
        Invoker invoker = new Invoker(serviceDomain, serviceName);
        invoker.operation("insert").property("list", list).sendInOnly(new Cheese("cheddar", 42));
        invoker.operation("insert").sendInOnly(new Person("michael", "stilton", 25));
        invoker.operation("fireAllRules").sendInOnly(null);
View Full Code Here

        RulesComponentImplementationModel rci_model = (RulesComponentImplementationModel)new RulesSwitchYardScanner().scan(DeclareFacts.class).getImplementation();
        QName serviceName = new QName("DeclareFacts");
        RulesExchangeHandler handler = new RulesExchangeHandler(rci_model, serviceDomain, serviceName);
        Service service = serviceDomain.registerService(serviceName, JavaService.fromClass(DeclareFacts.class), handler);
        serviceDomain.registerServiceReference(service.getName(), service.getInterface(), service.getProviderHandler());
        handler.start();
        new Invoker(serviceDomain, serviceName).operation("process").sendInOnly(holder);
        handler.stop();
        Assert.assertEquals("handled", holder.getValue());
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.