Package org.apache.tuscany.sca.provider

Examples of org.apache.tuscany.sca.provider.BindingProviderFactory


    }

    public synchronized ServiceBindingProvider getBindingProvider() {
        resolve();
        if (bindingProvider == null) {
            BindingProviderFactory factory =
                (BindingProviderFactory)providerFactories.getProviderFactory(getBinding().getClass());
            if (factory == null) {
                throw new ServiceRuntimeException("No provider factory is registered for binding " + getBinding()
                    .getType());
            }
            this.bindingProvider = factory.createServiceBindingProvider(this);
        }
        return bindingProvider;
    }
View Full Code Here


        // For the case that binding.sca is implemented by another binding
        if (binding == null) {
            return null;
        }
        if (bindingProvider == null) {
            BindingProviderFactory factory =
                (BindingProviderFactory)providerFactories.getProviderFactory(getBinding().getClass());
            if (factory == null) {
                throw new ServiceRuntimeException("No provider factory is registered for binding " + getBinding()
                    .getType());
            }
            this.bindingProvider = factory.createReferenceBindingProvider(this);
        }
        return bindingProvider;
    }
View Full Code Here

     * @param binding
     */
    private ReferenceBindingProvider addReferenceBindingProvider(RuntimeComponent component,
                                                                 RuntimeComponentReference reference,
                                                                 Binding binding) {
        BindingProviderFactory providerFactory =
            (BindingProviderFactory)providerFactories.getProviderFactory(binding.getClass());
        if (providerFactory != null) {
            @SuppressWarnings("unchecked")
            ReferenceBindingProvider bindingProvider =
                providerFactory.createReferenceBindingProvider((RuntimeComponent)component,
                                                               (RuntimeComponentReference)reference,
                                                               binding);
            if (bindingProvider != null) {
                ((RuntimeComponentReference)reference).setBindingProvider(binding, bindingProvider);
            }
View Full Code Here

     * @param binding
     */
    private ServiceBindingProvider addServiceBindingProvider(RuntimeComponent component,
                                                             RuntimeComponentService service,
                                                             Binding binding) {
        BindingProviderFactory providerFactory =
            (BindingProviderFactory)providerFactories.getProviderFactory(binding.getClass());
        if (providerFactory != null) {
            @SuppressWarnings("unchecked")
            ServiceBindingProvider bindingProvider =
                providerFactory.createServiceBindingProvider((RuntimeComponent)component,
                                                             (RuntimeComponentService)service,
                                                             binding);
            if (bindingProvider != null) {
                ((RuntimeComponentService)service).setBindingProvider(binding, bindingProvider);
            }
View Full Code Here

     * @param binding
     */
    private ReferenceBindingProvider addReferenceBindingProvider(RuntimeComponent component,
                                                                 RuntimeComponentReference reference,
                                                                 Binding binding) {
        BindingProviderFactory providerFactory =
            (BindingProviderFactory)providerFactories.getProviderFactory(binding.getClass());
        if (providerFactory != null) {
            @SuppressWarnings("unchecked")
            ReferenceBindingProvider bindingProvider =
                providerFactory.createReferenceBindingProvider((RuntimeComponent)component,
                                                               (RuntimeComponentReference)reference,
                                                               binding);
            if (bindingProvider != null) {
                ((RuntimeComponentReference)reference).setBindingProvider(binding, bindingProvider);
            }
View Full Code Here

     * @param binding
     */
    private ServiceBindingProvider addServiceBindingProvider(RuntimeComponent component,
                                                             RuntimeComponentService service,
                                                             Binding binding) {
        BindingProviderFactory providerFactory =
            (BindingProviderFactory)providerFactories.getProviderFactory(binding.getClass());
        if (providerFactory != null) {
            @SuppressWarnings("unchecked")
            ServiceBindingProvider bindingProvider =
                providerFactory.createServiceBindingProvider((RuntimeComponent)component,
                                                             (RuntimeComponentService)service,
                                                             binding);
            if (bindingProvider != null) {
                ((RuntimeComponentService)service).setBindingProvider(binding, bindingProvider);
            }
View Full Code Here

        // For the case that binding.sca is implemented by another binding
        if (binding == null) {
            return null;
        }
        if (bindingProvider == null) {
            BindingProviderFactory factory =
                (BindingProviderFactory)providerFactories.getProviderFactory(getBinding().getClass());
            if (factory == null) {
                throw new ServiceRuntimeException("No provider factory is registered for binding " + getBinding()
                    .getType());
            }
            this.bindingProvider = factory.createReferenceBindingProvider(this);
        }
        return bindingProvider;
    }
View Full Code Here

    }

    public synchronized ServiceBindingProvider getBindingProvider() {
        resolve();
        if (bindingProvider == null) {
            BindingProviderFactory factory =
                (BindingProviderFactory)providerFactories.getProviderFactory(getBinding().getClass());
            if (factory == null) {
                throw new ServiceRuntimeException("No provider factory is registered for binding " + getBinding()
                    .getType());
            }
            this.bindingProvider = factory.createServiceBindingProvider(this);
        }
        return bindingProvider;
    }
View Full Code Here

    protected void configureComposite(Composite composite) throws IncompatibleInterfaceContractException {
        for (Component component : composite.getComponents()) {

            for (ComponentService service : component.getServices()) {
                for (Binding binding : service.getBindings()) {
                    BindingProviderFactory providerFactory = (BindingProviderFactory)providerFactories
                        .getProviderFactory(binding.getClass());
                    if (providerFactory != null) {
                        ServiceBindingProvider bindingProvider = providerFactory
                            .createServiceBindingProvider((RuntimeComponent)component,
                                                          (RuntimeComponentService)service,
                                                          binding);
                        if (bindingProvider != null) {
                            ((RuntimeComponentService)service).setBindingProvider(binding, bindingProvider);
                        }
                    } else {
                        throw new IllegalStateException("Provider factory not found for class: " + binding.getClass()
                                                            .getName());
                    }
                }
            }
            for (ComponentReference reference : component.getReferences()) {
                for (Binding binding : reference.getBindings()) {
                    BindingProviderFactory providerFactory = (BindingProviderFactory)providerFactories
                        .getProviderFactory(binding.getClass());
                    if (providerFactory != null) {
                        ReferenceBindingProvider bindingProvider = providerFactory
                            .createReferenceBindingProvider((RuntimeComponent)component,
                                                            (RuntimeComponentReference)reference,
                                                            binding);
                        if (bindingProvider != null) {
                            ((RuntimeComponentReference)reference).setBindingProvider(binding, bindingProvider);
                        }
                    } else {
                        throw new IllegalStateException("Provider factory not found for class: " + binding.getClass()
                                                            .getName());
                    }
                }
            }

            Implementation implementation = component.getImplementation();
            if (implementation instanceof Composite) {
                configureComposite((Composite)implementation);
            } else if (implementation != null) {
                ImplementationProviderFactory providerFactory = (ImplementationProviderFactory)providerFactories
                    .getProviderFactory(implementation.getClass());
                if (providerFactory != null) {
                    ImplementationProvider implementationProvider = providerFactory
                        .createImplementationProvider((RuntimeComponent)component, implementation);
                    if (implementationProvider != null) {
                        ((RuntimeComponent)component).setImplementationProvider(implementationProvider);
                    }
                } else {
View Full Code Here

            if (bindingActivator.getBindingClass() != null) {
                // Add a ProviderFactory
                ProviderFactoryExtensionPoint providerFactories =
                    registry.getExtensionPoint(ProviderFactoryExtensionPoint.class);

                providerFactories.addProviderFactory(new BindingProviderFactory() {
                    public ReferenceBindingProvider createReferenceBindingProvider(final RuntimeComponent rc,
                                                                                   final RuntimeComponentReference rcr,
                                                                                   final Binding b) {
                        return new ReferenceBindingProvider() {
                            List<InvokerProxy> invokers = new ArrayList<InvokerProxy>();
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.provider.BindingProviderFactory

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.