Package org.apache.tuscany.sca.provider

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


     * @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

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

    public InterfaceContract getBindingInterfaceContract() {
        resolve();
        if (bindingInterfaceContract != null) {
            return bindingInterfaceContract;
        }
        ReferenceBindingProvider provider = getBindingProvider();
        if (provider != null) {
            bindingInterfaceContract = provider.getBindingInterfaceContract();
        }
        if (bindingInterfaceContract == null) {
            bindingInterfaceContract = getComponentReferenceInterfaceContract();
        }
        if (bindingInterfaceContract == null) {
View Full Code Here

                epr.getStatus() == EndpointReference.Status.RESOLVED_BINDING){
               
                // As we only care about starting references at build time in the
                // async case at the moment check that the binding supports native async
                // and that the reference is an async reference
                ReferenceBindingProvider bindingProvider = epr.getBindingProvider();
                if (bindingProvider instanceof EndpointReferenceAsyncProvider &&
                    ((EndpointReferenceAsyncProvider)bindingProvider).supportsNativeAsync() &&
                    epr.isAsyncInvocation()){
                    // it's resolved so start it now
                    try {
View Full Code Here

            CompositeContext compositeContext = epr.getCompositeContext();
            if (compositeContext == null) {
                throw new IllegalStateException("The endpoint reference is not bound");
            }
            compositeContext.getEndpointRegistry().removeEndpointReference(epr);
            ReferenceBindingProvider bindingProvider = epr.getBindingProvider();
            if (bindingProvider != null) {
                try {
                    bindingProvider.stop();
                } catch (Throwable ex){
                    Monitor.error(monitor, this, "core-messages", "StopException", ex);
               
            }
            for (PolicyProvider policyProvider : epr.getPolicyProviders()) {
View Full Code Here

            return null;
        RuntimeEndpointReference epr = (RuntimeEndpointReference)source;
        if (!isAsyncInvocation(epr)) return null;
       
        // Check to see if the binding supports async invocation natively
        ReferenceBindingProvider eprProvider = epr.getBindingProvider();
        if( eprProvider instanceof EndpointReferenceAsyncProvider) {
          if( ((EndpointReferenceAsyncProvider)eprProvider).supportsNativeAsync() ) return null;
        } // end if
       
        RuntimeEndpoint endpoint;
View Full Code Here

            return false;
        RuntimeEndpointReference epr = (RuntimeEndpointReference)source;
       
        // TODO - need to update this once BindingProvider interface is refactored to contain
        // supportsNativeAsync directly...
        ReferenceBindingProvider provider = epr.getBindingProvider();
        if( provider instanceof EndpointReferenceAsyncProvider ) {
          return ((EndpointReferenceAsyncProvider)provider).supportsNativeAsync();
        } else {
          return false;
        } // end if
View Full Code Here

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

                }
            }
        }
        for (ComponentReference reference : component.getReferences()) {
            for (Binding binding : reference.getBindings()) {
                ReferenceBindingProvider bindingProvider = ((RuntimeComponentReference)reference)
                    .getBindingProvider(binding);
                if (bindingProvider != null) {
                    bindingProvider.start();
                }
            }
        }

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

TOP

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

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.