diff options
Diffstat (limited to 'java/sca/modules/core/src')
-rw-r--r-- | java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/CallableReferenceImpl.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/CallableReferenceImpl.java b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/CallableReferenceImpl.java index cc3bbc1f6e..372651fcff 100644 --- a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/CallableReferenceImpl.java +++ b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/CallableReferenceImpl.java @@ -35,11 +35,13 @@ import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; import org.apache.tuscany.sca.assembly.AssemblyFactory; +import org.apache.tuscany.sca.assembly.Binding; import org.apache.tuscany.sca.assembly.ComponentService; import org.apache.tuscany.sca.assembly.CompositeService; import org.apache.tuscany.sca.assembly.EndpointReference; import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.assembly.builder.BindingBuilderExtension; +import org.apache.tuscany.sca.assembly.builder.BindingBuilder; +import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint; import org.apache.tuscany.sca.contribution.processor.ContributionReadException; import org.apache.tuscany.sca.contribution.processor.ContributionWriteException; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; @@ -49,7 +51,6 @@ import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.core.assembly.CompositeActivator; import org.apache.tuscany.sca.core.assembly.RuntimeAssemblyFactory; import org.apache.tuscany.sca.core.assembly.impl.ReferenceParametersImpl; -import org.apache.tuscany.sca.core.assembly.impl.RuntimeWireImpl; import org.apache.tuscany.sca.core.context.ComponentContextExt; import org.apache.tuscany.sca.core.context.CompositeContext; import org.apache.tuscany.sca.core.context.ServiceReferenceExt; @@ -98,6 +99,7 @@ public class CallableReferenceImpl<B> implements ServiceReferenceExt<B> { private StAXArtifactProcessor<EndpointReference> staxProcessor; private XMLInputFactory xmlInputFactory; private XMLOutputFactory xmlOutputFactory; + private CompositeBuilderExtensionPoint builders; /* * Public constructor for Externalizable serialization/deserialization @@ -164,6 +166,7 @@ public class CallableReferenceImpl<B> implements ServiceReferenceExt<B> { this.xmlOutputFactory = modelFactories.getFactory(XMLOutputFactory.class); this.staxProcessors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class); this.staxProcessor = staxProcessors.getProcessor(EndpointReference.class); + this.builders = registry.getExtensionPoint(CompositeBuilderExtensionPoint.class); } public CallableReferenceImpl(Class<B> businessInterface, RuntimeWire wire, ProxyFactory proxyFactory) { @@ -423,9 +426,13 @@ public class CallableReferenceImpl<B> implements ServiceReferenceExt<B> { this.businessInterface = (Class<B>)javaInterface.getJavaClass(); } - if (endpointReference.getBinding() instanceof BindingBuilderExtension) { - ((BindingBuilderExtension)endpointReference.getBinding()).getBuilder().build(component, reference, endpointReference.getBinding(), null); - } + Binding binding = endpointReference.getBinding(); + if (binding != null) { + BindingBuilder bindingBuilder = builders.getBindingBuilder(binding.getClass()); + if (bindingBuilder != null) { + bindingBuilder.build(component, reference, endpointReference.getBinding(), null); + } + } this.proxyFactory = compositeActivator.getCompositeContext().getProxyFactory(); } else if (compositeActivator == null) { |