Package org.apache.tuscany.core.system.config

Examples of org.apache.tuscany.core.system.config.SystemExternalServiceContextFactory


                || !(externalService.getBindings().get(0) instanceof SystemBinding)) {
            return;
        }
        SystemBinding binding = (SystemBinding)externalService.getBindings().get(0);
        if (binding.getTargetName() != null) {
            SystemExternalServiceContextFactory contextFactory = new SystemExternalServiceContextFactory(externalService
                    .getName(), new InterCompositeReferenceFactory(binding.getTargetName()));
            externalService.setContextFactory(contextFactory);
        } else if (externalService.getConfiguredService().getPort().getServiceContract().getInterface() != null) {
            // autowire
            Class<Object> claz = externalService.getConfiguredService().getPort().getServiceContract().getInterface();
            if (claz == null) {
                BuilderException e = new BuilderConfigException("Interface type not specified");
                e.setIdentifier(externalService.getName());
                e.addContextName(externalService.getName());
                throw e;
            }
            SystemExternalServiceContextFactory config = new SystemExternalServiceContextFactory(externalService
                    .getName(), new AutowireObjectFactory<Object>(claz));
            externalService.setContextFactory(config);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.core.system.config.SystemExternalServiceContextFactory

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.