Examples of ReferenceBindingProvider


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

    private void addBindingInterceptor(ComponentReference reference,
                                       Binding binding,
                                       InvocationChain chain,
                                       Operation operation) {
        try {
            ReferenceBindingProvider provider = ((RuntimeComponentReference)reference).getBindingProvider(binding);
            if (provider != null) {
                Invoker invoker = provider.createInvoker(operation);
                if (invoker != null) {
                    chain.addInvoker(invoker);
                }
            }
        } catch (RuntimeException e) {
View Full Code Here

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

     * @param reference
     * @param binding
     * @param chain
     */
    private void addNonBlockingInterceptor(ComponentReference reference, Binding binding, InvocationChain chain) {
        ReferenceBindingProvider provider = ((RuntimeComponentReference)reference).getBindingProvider(binding);
        if (provider != null) {
            boolean supportsOneWayInvocation = provider.supportsOneWayInvocation();
            if (!supportsOneWayInvocation) {
                chain.addInterceptor(new NonBlockingInterceptor(workScheduler));
            }
        }
    }
View Full Code Here

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

    public void start(RuntimeComponent component, RuntimeComponentReference ref) {
        synchronized (ref) {
            resolveTargets(ref);
            for (Binding binding : ref.getBindings()) {
                ReferenceBindingProvider provider = ref.getBindingProvider(binding);
                if (provider == null) {
                    provider = addReferenceBindingProvider(component, ref, binding);
                }
                if (provider != null) {
                    provider.start();
                }
                addReferenceWire(component, ref, binding);
            }
        }
    }
View Full Code Here

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

                                                                 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) {
View Full Code Here

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

                logger.fine("Starting component reference: " + component.getURI() + "#" + reference.getName());
            }
            RuntimeComponentReference runtimeRef = ((RuntimeComponentReference)reference);
            runtimeRef.setComponent(runtimeComponent);
            for (Binding binding : reference.getBindings()) {
                ReferenceBindingProvider bindingProvider = runtimeRef.getBindingProvider(binding);
                if (bindingProvider != null) {
                    bindingProvider.start();
                }
            }
        }

        for (ComponentService service : component.getServices()) {
            if (logger.isLoggable(Level.FINE)) {
                logger.fine("Starting component service: " + component.getURI() + "#" + service.getName());
            }
            RuntimeComponentService runtimeService = (RuntimeComponentService)service;
            for (Binding binding : service.getBindings()) {
                ServiceBindingProvider bindingProvider = runtimeService.getBindingProvider(binding);
                if (bindingProvider != null) {
                    bindingProvider.start();
                }
            }
        }

        Implementation implementation = component.getImplementation();
View Full Code Here

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

            if (logger.isLoggable(Level.FINE)) {
                logger.fine("Starting component reference: " + component.getURI() + "#" + reference.getName());
            }
            RuntimeComponentReference runtimeRef = ((RuntimeComponentReference)reference);
            for (Binding binding : reference.getBindings()) {
                ReferenceBindingProvider bindingProvider = runtimeRef.getBindingProvider(binding);
                if (bindingProvider != null) {
                    bindingProvider.stop();
                }
            }
        }
        Implementation implementation = component.getImplementation();
        if (implementation instanceof Composite) {
View Full Code Here

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

     * @param binding
     * @return
     */
    private InterfaceContract getInterfaceContract(ComponentReference reference, Binding binding) {
        InterfaceContract interfaceContract = reference.getInterfaceContract();
        ReferenceBindingProvider provider = ((RuntimeComponentReference)reference).getBindingProvider(binding);
        if (provider != null) {
            InterfaceContract bindingContract = provider.getBindingInterfaceContract();
            if (bindingContract != null) {
                interfaceContract = bindingContract;
            }
        }
        return interfaceContract.makeUnidirectional(false);
View Full Code Here

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

        resolve();

        eprBinder.bindRunTime(domainRegistry, this);

        // start the binding provider
        final ReferenceBindingProvider bindingProvider = getBindingProvider();

        if (bindingProvider != null) {
            // Allow bindings to add shutdown hooks. Requires RuntimePermission shutdownHooks in policy.
            AccessController.doPrivileged(new PrivilegedAction<Object>() {
                public Object run() {
                    bindingProvider.start();
                    return null;
                }
            });
        }
        for (PolicyProvider policyProvider : getPolicyProviders()) {
View Full Code Here

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

    }

    private void initReferenceBindingInvocationChains() {

        // add the binding interceptors to the reference binding wire
        ReferenceBindingProvider provider = getBindingProvider();
        if ((provider != null) && (provider instanceof EndpointReferenceProvider)) {
            ((EndpointReferenceProvider)provider).configure();
        }

        // add the policy interceptors to the service binding wire
View Full Code Here

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

     * @param binding
     * @param chain
     * @param operation
     */
    private void addReferenceBindingInterceptor(InvocationChain chain, Operation operation) {
        ReferenceBindingProvider provider = getBindingProvider();
        if (provider != null) {
            Invoker invoker = provider.createInvoker(operation);
            if (invoker != null) {
                chain.addInvoker(invoker);
            }
        }
        List<PolicyProvider> pps = getPolicyProviders();
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.