Package org.switchyard.metadata

Examples of org.switchyard.metadata.InOnlyService


        _httpInbound.start();

        compositeService = composite.getServices().get(1);
        HttpBindingModel config2 = (HttpBindingModel)compositeService.getBindings().get(0);

        _domain.registerService(config2.getServiceName(), new InOnlyService(), new MockHandler());
        _domain.registerServiceReference(config2.getServiceName(), new HelloInterface());
        _httpInbound2 = new InboundHandler(config2, _domain);
        _httpInbound2.start();

        CompositeReferenceModel compositeReference = composite.getReferences().get(0);
View Full Code Here


        when(bindingModel.getComponentURI()).thenReturn(URI.create("direct:to"));
        when(bindingModel.getName()).thenReturn("mockOutputHandler");
        when(bindingModel.getReference()).thenReturn(referenceModel);
        _messageComposer = CamelComposition.getMessageComposer();
        _serviceDomain.registerService(_targetService.getServiceName(),
            new InOnlyService(),
            new OutboundHandler(bindingModel,
                (SwitchYardCamelContext) context, _messageComposer, _serviceDomain
            ) {
            {
                setState(State.STARTED);
            }
        }
        );
        _service = _serviceDomain.registerServiceReference(
            _targetService.getServiceName(), new InOnlyService());
    }
View Full Code Here

        bindingModel = mock(CamelBindingModel.class);
        when(bindingModel.getComponentURI()).thenReturn(URI.create("transaction:foo?transactionManager=%23jtaTransactionManager"));
        when(bindingModel.getReference()).thenReturn(referenceModel);
        _messageComposer = CamelComposition.getMessageComposer();
        _serviceDomain.registerService(_targetService.getServiceName(),
            new InOnlyService(),
            new OutboundHandler(bindingModel,
                (SwitchYardCamelContext) context, _messageComposer, null
            ) {
            {
                setState(State.STARTED);
            }
        }
        );
        _service = _serviceDomain.registerServiceReference(
            _targetService.getServiceName(), new InOnlyService());
        Exchange exchange = _service.createExchange();

        MockEndpoint endpoint = getMockEndpoint("mock:result");
        endpoint.expectedBodiesReceived("foo");
        exchange.send(exchange.createMessage().setContent("foo"));
View Full Code Here

    private ServiceDomain serviceDomain;

    @Test
    public void testCallService() throws Exception {
        final Holder holder = new Holder();
        serviceDomain.registerService(new QName("CallService"), new InOnlyService(), new BaseHandler(){
            public void handleMessage(Exchange exchange) throws HandlerException {
                holder.setValue("message handled");
            }
        });
        serviceDomain.registerServiceReference(new QName("CallService"), new InOnlyService());
        KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
        kbuilder.add(ResourceFactory.newClassPathResource(CALL_SERVICE_BPMN), ResourceType.BPMN2);
        KieBase kbase = kbuilder.newKnowledgeBase();
        KieSession ksession = kbase.newKieSession();
        SwitchYardServiceTaskHandler ssth = new SwitchYardServiceTaskHandler();
View Full Code Here

    }

    @Test
    public void testControlProcess() throws Exception {
        final Holder holder = new Holder();
        Service callService = serviceDomain.registerService(new QName("CallService"), new InOnlyService(), new BaseHandler(){
            public void handleMessage(Exchange exchange) throws HandlerException {
                holder.setValue("message handled");
            }
        });
        serviceDomain.registerServiceReference(callService.getName(), callService.getInterface(), callService.getProviderHandler());
View Full Code Here

    }

    private void runCorrelateProcess(final boolean bomb) throws Exception {
        final AtomicInteger counter = new AtomicInteger();
        final Holder holder = new Holder();
        Service callService = serviceDomain.registerService(new QName("CallService"), new InOnlyService(), new BaseHandler(){
            public void handleMessage(Exchange exchange) throws HandlerException {
                int count = counter.incrementAndGet();
                holder.setValue(String.valueOf(count));
            }
        });
View Full Code Here

    @Test
    public void testSignalAllProcesses() throws Exception {
        final AtomicInteger counter = new AtomicInteger();
        final Holder holder = new Holder();
        Service callService = serviceDomain.registerService(new QName("CallService"), new InOnlyService(), new BaseHandler(){
            public void handleMessage(Exchange exchange) throws HandlerException {
                int count = counter.incrementAndGet();
                holder.setValue(String.valueOf(count));
            }
        });
View Full Code Here

    public void testFaultResultProcessFailure() throws Exception {
        runFaultResultProcess(true);
    }

    private void runFaultResultProcess(final boolean bomb) throws Exception {
        serviceDomain.registerService(new QName("TestService"), new InOnlyService(), new BaseHandler(){
            public void handleMessage(Exchange exchange) throws HandlerException {
                if (bomb) {
                    throw new HandlerException("BOOM!");
                }
            }
View Full Code Here

    public void testFaultEventProcessFailure() throws Exception {
        runFaultEventProcess(true);
    }

    private void runFaultEventProcess(final boolean bomb) throws Exception {
        serviceDomain.registerService(new QName("TestService"), new InOnlyService(), new BaseHandler(){
            public void handleMessage(Exchange exchange) throws HandlerException {
                if (bomb) {
                    throw new HandlerException("BOOM!");
                }
            }
View Full Code Here

    public void testFaultBoundaryProcessFailure() throws Exception {
        runFaultBoundaryProcess(true);
    }

    private void runFaultBoundaryProcess(final boolean bomb) throws Exception {
        serviceDomain.registerService(new QName("TestService"), new InOnlyService(), new BaseHandler(){
            public void handleMessage(Exchange exchange) throws HandlerException {
                if (bomb) {
                    throw new HandlerException("BOOM!");
                }
            }
View Full Code Here

TOP

Related Classes of org.switchyard.metadata.InOnlyService

Copyright © 2018 www.massapicom. 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.