Package org.switchyard

Examples of org.switchyard.ServiceReference


        domain.setProperty(CamelContextConfigurator.SHUTDOWN_TIMEOUT, "10");
        deployment.init(domain, ActivatorLoader.createActivators(domain));
        deployment.start();
       
        // we want to invoke a mock so we can check for messages received
        final ServiceReference reference = domain.getServiceReference(svcName);
        domain.getServices(svcName).get(0).unregister();
        final MockHandler service = new MockHandler();
        domain.registerService(svcName, new InOnlyService(), service);
       
               
        final int NUM_SENDS = 5;
        for (int i = 0; i < NUM_SENDS; i++) {
            new Thread(new Runnable() {
                public void run() {
                    Exchange exchange = reference.createExchange();
                    Message message = exchange.createMessage();
                    exchange.send(message);
                }
            }).start();
        }
View Full Code Here


                new QName("urn:test:config-mock-binding:1.0", "TestService")).get(0);
        Assert.assertNotNull(implService.getServiceMetadata().getRegistrant());
        Assert.assertTrue(implService.getServiceMetadata().getRequiredPolicies().contains(TransactionPolicy.MANAGED_TRANSACTION_LOCAL));
        Assert.assertTrue(implService.getServiceMetadata().getRequiredPolicies().contains(TransactionPolicy.SUSPENDS_TRANSACTION));

        ServiceReference implReference = deployment.getDomain().getServiceReference(
                new QName("urn:test:config-mock-binding:1.0", "TestService/TestReference"));
        Assert.assertNotNull(implReference.getServiceMetadata().getRegistrant());
        Assert.assertTrue(implReference.getServiceMetadata().getRequiredPolicies().contains(TransactionPolicy.SUSPENDS_TRANSACTION));
        deployment.destroy();
    }
View Full Code Here

    @Test
    public void testReferenceEvents() {
        _domain.addEventObserver(_observer, ReferenceRegistrationEvent.class)
            .addEventObserver(_observer, ReferenceUnregistrationEvent.class);
       
        ServiceReference ref = _domain.registerServiceReference(new QName("test"), new InOutService());
        Assert.assertTrue(_observer.referenceRegistrationCalled);
        ref.unregister();
        Assert.assertTrue(_observer.referenceUnregistrationCalled);
    }
View Full Code Here

TOP

Related Classes of org.switchyard.ServiceReference

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.