Examples of ConfiguredService


Examples of org.apache.tuscany.model.assembly.ConfiguredService

            public void setOverrideOption(OverrideOption value) {

            }

            public ConfiguredService getConfiguredService() {
                return new ConfiguredService() {

                    public String getName() {

                        return null;
                    }
View Full Code Here

Examples of org.apache.tuscany.model.assembly.ConfiguredService

        ConfiguredReference configuredReference = systemFactory.createConfiguredReference();
        configuredReference.setPort(ref);
        Service service = systemFactory.createService();
        service.setServiceContract(contract);

        ConfiguredService cService = systemFactory.createConfiguredService();
        cService.setPort(service);
        cService.initialize(assemblyContext);

        configuredReference.getTargetConfiguredServices().add(cService);
        ep.setConfiguredReference(configuredReference);

        Service epService = systemFactory.createService();
        epService.setServiceContract(contract);

        ConfiguredService epCService = systemFactory.createConfiguredService();
        epCService.initialize(assemblyContext);
        epCService.setPort(epService);

        ep.setConfiguredService(epCService);
        SystemBinding binding = systemFactory.createSystemBinding();
        ep.getBindings().add(binding);
        if (target != null) {
View Full Code Here

Examples of org.apache.tuscany.model.assembly.ConfiguredService

        ConfiguredReference cRef = systemFactory.createConfiguredReference();
        Reference ref = systemFactory.createReference();
        cRef.setPort(ref);
        Service service = systemFactory.createService();
        service.setName(componentName);
        ConfiguredService cService = systemFactory.createConfiguredService();
        cService.setPort(service);
        cRef.getTargetConfiguredServices().add(cService);
        cRef.initialize(assemblyContext);
        cService.initialize(assemblyContext);
        JavaServiceContract contract = systemFactory.createJavaServiceContract();
        contract.setInterface(interfaz);
        ref.setServiceContract(contract);
        ep.setConfiguredReference(cRef);
        ep.initialize(assemblyContext);
View Full Code Here

Examples of org.apache.tuscany.model.assembly.ConfiguredService

     * Creates an external service configured with a {@link SystemBinding}
     */
    public static ExternalService createESSystemBinding(String name, String refName) {
        ExternalService es = systemFactory.createExternalService();
        es.setName(name);
        ConfiguredService configuredService = systemFactory.createConfiguredService();
        es.setConfiguredService(configuredService);
        SystemBinding binding = systemFactory.createSystemBinding();
        binding.setTargetName(refName);
        es.getBindings().add(binding);
        es.initialize(null);
View Full Code Here

Examples of org.apache.tuscany.model.assembly.ConfiguredService

        es.setName(name);
        JavaServiceContract inter = systemFactory.createJavaServiceContract();
        inter.setInterface(type);
        Service service = systemFactory.createService();
        service.setServiceContract(inter);
        ConfiguredService cService = systemFactory.createConfiguredService();
        cService.setPort(service);
        cService.initialize(assemblyContext);
        es.setConfiguredService(cService);
        es.getBindings().add(systemFactory.createSystemBinding());
        es.initialize(null);
        return es;
    }
View Full Code Here

Examples of org.apache.tuscany.model.assembly.ConfiguredService

        ExternalService es = (ExternalService) registry.load(reader, loaderContext);
        reader.require(XMLStreamConstants.END_ELEMENT, EXTERNAL_SERVICE.getNamespaceURI(), EXTERNAL_SERVICE.getLocalPart());
        assertEquals(XMLStreamConstants.END_DOCUMENT, reader.next());
        assertNotNull(es);
        assertEquals("test", es.getName());
        ConfiguredService configuredService = es.getConfiguredService();
        JavaServiceContract serviceContract = (JavaServiceContract) configuredService.getPort().getServiceContract();
        assertEquals(interfaceName, serviceContract.getInterfaceName());
    }
View Full Code Here

Examples of org.apache.tuscany.model.assembly.ConfiguredService

        EntryPoint ep = (EntryPoint) registry.load(reader, loaderContext);
        reader.require(XMLStreamConstants.END_ELEMENT, ENTRY_POINT.getNamespaceURI(), ENTRY_POINT.getLocalPart());
        assertEquals(XMLStreamConstants.END_DOCUMENT, reader.next());
        assertNotNull(ep);
        assertEquals("test", ep.getName());
        ConfiguredService configuredService = ep.getConfiguredService();
        JavaServiceContract serviceContract = (JavaServiceContract) configuredService.getPort().getServiceContract();
        assertEquals(interfaceName, serviceContract.getInterfaceName());
    }
View Full Code Here

Examples of org.apache.tuscany.model.assembly.ConfiguredService

        String name = reader.getAttributeValue(null, "name");
        entryPoint.setName(name);

        Service service = factory.createService();
        service.setName(name);
        ConfiguredService configuredService = factory.createConfiguredService();
        configuredService.setPort(service);
        entryPoint.setConfiguredService(configuredService);

        Reference reference = factory.createReference();
        reference.setMultiplicity(StAXUtil.multiplicity(reader.getAttributeValue(null, "multiplicity"), Multiplicity.ONE_ONE));
        ConfiguredReference configuredReference = factory.createConfiguredReference();
View Full Code Here

Examples of org.apache.tuscany.model.assembly.ConfiguredService

        ComponentContext ctx = this.serviceUnit.getComponent().getComponentContext();
        activated = ctx.activateEndpoint(service, endpoint);
        channel = ctx.getDeliveryChannel();
        // Get the target service
        ConfiguredReference referenceValue = entryPoint.getConfiguredReference();
        ConfiguredService targetServiceEndpoint = referenceValue.getTargetConfiguredServices().get(0);
        // Get the business interface
        Class serviceInterface = targetServiceEndpoint.getService().getServiceContract().getInterface();
        List<Class> classes = new ArrayList<Class>();
        methodMap = new HashMap<Class, Method>();
        for (Method mth : serviceInterface.getMethods()) {
            Class[] params = mth.getParameterTypes();
            if (params.length != 1) {
View Full Code Here

Examples of org.apache.tuscany.model.assembly.ConfiguredService

        }

        ExternalJbiServiceClient externalJbiServiceClient = new ExternalJbiServiceClient(externalService);
        ExternalJbiServiceContextFactory config = new ExternalJbiServiceContextFactory(externalService.getName(), new SingletonObjectFactory<ExternalJbiServiceClient>(externalJbiServiceClient));

        ConfiguredService configuredService = externalService.getConfiguredService();
        Service service = configuredService.getService();
        ServiceContract serviceContract = service.getServiceContract();
        Map<Method, InvocationConfiguration> iConfigMap = new MethodHashMap();
        ProxyFactory proxyFactory = proxyFactoryFactory.createProxyFactory();
        Set<Method> javaMethods = JavaIntrospectionHelper.getAllUniqueMethods(serviceContract.getInterface());
        for (Method method : javaMethods) {
            InvocationConfiguration iConfig = new InvocationConfiguration(method);
            iConfigMap.put(method, iConfig);
        }
        QualifiedName qName = new QualifiedName(externalService.getName() + "/" + service.getName());
        ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(), messageFactory);
        proxyFactory.setBusinessInterface(serviceContract.getInterface());
        proxyFactory.setProxyConfiguration(pConfiguration);
        config.addTargetProxyFactory(service.getName(), proxyFactory);
        configuredService.setProxyFactory(proxyFactory);
        if (policyBuilder != null) {
            // invoke the reference builder to handle additional policy metadata
            policyBuilder.build(configuredService);
        }
        // add tail interceptor
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.