Package org.switchyard

Examples of org.switchyard.ServiceDomain


    public DefaultExchangeSecurity(Exchange exchange) {
        _exchange = exchange;
        SecurityMetadata securityMetadata = SecurityMetadata.getSecurityMetadata(exchange);
        ServiceSecurity serviceSecurity = securityMetadata.getServiceSecurity();
        _securityDomain = serviceSecurity != null ? serviceSecurity.getSecurityDomain() : null;
        ServiceDomain serviceDomain = securityMetadata.getServiceDomain();
        _securityContextManager = serviceDomain != null ? new SecurityContextManager(serviceDomain) : null;
    }
View Full Code Here


                sink.getReceivedCount() < NUM_SENDS);
    }
   
    @Test
    public void throttleWithTimePeriod() throws Exception {
        ServiceDomain domain = new MockDomain();
        domain.setProperty(CamelContextConfigurator.SHUTDOWN_TIMEOUT, "5");
        initDomain(domain);
       
        QName name = new QName("testThrottleTimePeriod");
        final ExchangeSink sink = new ExchangeSink();
        final Service service = new MockService(name, new InOnlyService(), sink);
View Full Code Here

     * Create and initialise the deployment.
     * @throws Exception creating the deployment.
     */
    private final void deploy() throws Exception {
        _deployment = createDeployment();
        ServiceDomain domain = new ServiceDomainManager().createDomain(
                ServiceDomainManager.ROOT_DOMAIN, _deployment.getConfig());

        _activators = ActivatorLoader.createActivators(domain);
        SwitchYardTestCaseConfig testCaseConfig = _testInstance.getClass().getAnnotation(SwitchYardTestCaseConfig.class);

View Full Code Here

        MockDomain serviceDomain = new MockDomain();
        deployment.init(serviceDomain, ActivatorLoader.createActivators(serviceDomain));

        // Check that the transformers are deployed...
        ServiceDomain domain = deployment.getDomain();
        Transformer<?,?> abTransformer = domain.getTransformerRegistry().getTransformer(new QName("A"), new QName("B"));
        Transformer<?,?> cdTransformer = domain.getTransformerRegistry().getTransformer(new QName("C"), new QName("D"));

        Assert.assertTrue(abTransformer instanceof ABTransformer);
        Assert.assertTrue(cdTransformer instanceof CDTransformer);

        deployment.destroy();
View Full Code Here

        MockDomain serviceDomain = new MockDomain();
        deployment.init(serviceDomain, ActivatorLoader.createActivators(serviceDomain));

        // Check that the validators are deployed...
        ServiceDomain domain = deployment.getDomain();
        Validator<?> aValidator = domain.getValidatorRegistry().getValidator(new QName("A"));
        Validator<?> bValidator = domain.getValidatorRegistry().getValidator(new QName("B"));
       
        Assert.assertTrue(aValidator instanceof AValidator);
        Assert.assertTrue(bValidator instanceof BValidator);
       
        deployment.destroy();
View Full Code Here

        Deployment deployment = new Deployment(syConfigStream);
        syConfigStream.close();


        // initialize the deployment
        ServiceDomain domain = new ServiceDomainManager().createDomain();
        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() {
View Full Code Here

                    swConfigStream.close();
                } catch (IOException ioEx) {
                    ioEx.getMessage(); // keeps checkstyle happy
                }
            }
            ServiceDomain domain = new ServiceDomainManager().createDomain();
            _deployment.init(domain, ActivatorLoader.createActivators(domain));
            _deployment.start();
        }
    }
View Full Code Here

    public OrderProcessor() {
    }

    @Override
    public void process(Exchange exchange) throws Exception {
        ServiceDomain domain = ((SwitchYardCamelContext)exchange.getContext()).getServiceDomain();
        String socketAddr = (String)domain.getProperty("soapClientPort");
        String socketAddrFault = (String)domain.getProperty("httpPort");

        Order order = exchange.getIn().getBody(Order.class);
        System.out.println("Received Order " + order.getItem() + " with quantity " + order.getQuantity() + ".");
        if (order.getItem().equals("Airbus")) {
            throw new UnknownItem("Sorry, Airbus is no longer available with us!");
View Full Code Here

TOP

Related Classes of org.switchyard.ServiceDomain

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.