You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by ant elder <an...@gmail.com> on 2007/04/13 20:19:17 UTC
Re: svn commit: r528566 - in /incubator/tuscany/java/sca: modules/core/src/main/java/org/apache/tuscany/core/deployer/ modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/ modules/interface/src/main/java/o
I'm getting a build failure as IDLTransformerTestCase fails now. Is there
something else needed to be checked in or that I should update?
Running
org.apache.tuscany.core.databinding.transformers.IDLTransformerTestCase
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.109 sec
<<< FAILURE!
testTransform(
org.apache.tuscany.core.databinding.transformers.IDLTransformerTestCase)
Time elapsed: 0.062 sec <<< ERROR!
org.apache.tuscany.spi.databinding.TransformationException: No wrapper
handler is provided for databinding: null
at
org.apache.tuscany.core.databinding.transformers.Input2InputTransformer.getWrapperHandler
(Input2InputTransformer.java:194)
at
org.apache.tuscany.core.databinding.transformers.Input2InputTransformer.transform
(Input2InputTransformer.java:105)
at
org.apache.tuscany.core.databinding.transformers.IDLTransformerTestCase.testTransform
(IDLTransformerTestCase.java:200)
...ant
On 4/13/07, Raymond Feng <en...@gmail.com> wrote:
>
> Hi,
>
> With this check-in, the echo binding reference sample is working again.
> You
> can start to try other samples.
>
> Thanks,
> Raymond
>
> ----- Original Message -----
> From: <rf...@apache.org>
> To: <tu...@ws.apache.org>
> Sent: Friday, April 13, 2007 10:49 AM
> Subject: svn commit: r528566 - in /incubator/tuscany/java/sca:
> modules/core/src/main/java/org/apache/tuscany/core/deployer/
>
> modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/
> modules/interface/src/main/java/org/apa...
>
>
> > Author: rfeng
> > Date: Fri Apr 13 10:49:14 2007
> > New Revision: 528566
> >
> > URL: http://svn.apache.org/viewvc?view=rev&rev=528566
> > Log:
> > Add the logic to deal with promoted component reference and bring up the
> > echo-binding sample
> >
> > Modified:
> >
> >
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java
> >
> >
> incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoAtomicComponent.java
> >
> >
> incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoConfiguration.java
> >
> >
> incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Operation.java
> >
> >
> incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/OperationImpl.java
> >
> >
> incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBuilder.java
> >
> >
> incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoReference.java
> >
> >
> incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/EchoBindingTestCase.java
> >
> >
> incubator/tuscany/java/sca/samples/echo-binding/src/test/resources/EchoBinding.composite
> >
> > Modified:
> >
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java
> > URL:
> >
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java?view=diff&rev=528566&r1=528565&r2=528566
> >
> ==============================================================================
> > ---
> >
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java
> > (original)
> > +++
> >
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java
> > Fri Apr 13 10:49:14 2007
> > @@ -191,44 +191,74 @@
> > for (ComponentReference ref : definition.getReferences()) {
> > List<Wire> wires = new ArrayList<Wire>();
> > String refName = ref.getName();
> > - org.apache.tuscany.assembly.Reference refDefinition =
> > getReference(definition.getImplementation(), refName);
> > + org.apache.tuscany.assembly.Reference refDefinition =
> > ref.getReference();
> > assert refDefinition != null;
> > - List<ComponentService> services = ref.getTargets();
> > - for (ComponentService service : services) {
> > - org.apache.tuscany.assembly.Component targetCompoent =
> > service.getBinding(SCABinding.class)
> > - .getComponent();
> > - Component target = (Component)getSCAObject(models,
> > targetCompoent);
> > - URI targetUri = URI.create(target.getUri() + "#" +
> > service.getName());
> > - if (target == null && (refDefinition.getMultiplicity()
> ==
> > Multiplicity.ZERO_ONE || refDefinition
> > - .getMultiplicity() == Multiplicity.ZERO_N)) {
> > - // a non-required reference, just skip
> > - continue;
> > + List<CompositeReference> promoted = ref.promotedAs();
> > + if (!promoted.isEmpty()) {
> > + // TODO: Assume a component reference can only be
> > promoted by at
> > + // most one composite reference
> > + CompositeReference compositeReference = promoted.get
> (0);
> > + Reference target = (Reference)getSCAObject(models,
> > compositeReference);
> > + // FIXME: Assume we only have one binding
> > + ReferenceBinding binding =
> > target.getReferenceBindings().get(0);
> > + URI targetUri = binding.getTargetUri();
> > + InterfaceContract contract =
> > binding.getBindingInterfaceContract();
> > + if (contract == null) {
> > + contract = refDefinition.getInterfaceContract();
> > }
> > - if (target == null) {
> > - throw new ComponentNotFoundException("Target not
> > found", targetUri);
> > - }
> > - URI sourceURI = URI.create(source.getUri() + "#" +
> > refName);
> > + QName type = binding.getBindingType();
> > + URI sourceUri = URI.create(source.getUri() + "#" +
> > refName);
> > Wire wire;
> > try {
> > - wire = createWire(sourceURI, targetUri,
> > refDefinition.getInterfaceContract(), service.getService()
> > - .getInterfaceContract(), Wire.LOCAL_BINDING);
> > + wire = createWire(sourceUri, targetUri,
> > refDefinition.getInterfaceContract(), contract, type);
> > } catch (IncompatibleInterfaceContractException e1) {
> > - throw new
> IncompatibleInterfacesException(sourceURI,
> > targetUri, e1);
> > + throw new IllegalStateException(e1);
> > }
> > + binding.setWire(wire);
> > try {
> > - attachInvokers(refName, wire, source, target);
> > + attachInvokers(targetUri.getFragment(), wire,
> > binding, binding);
> > } catch (TargetInvokerCreationException e) {
> > - throw new WireCreationException("Error creating
> > invoker", sourceURI, targetUri, e);
> > + throw new WireCreationException("Error creating
> > invoker", sourceUri, targetUri, e);
> > }
> > + wires.add(wire);
> > + } else {
> > + List<ComponentService> services = ref.getTargets();
> > + for (ComponentService service : services) {
> > + org.apache.tuscany.assembly.ComponenttargetCompoent
> > = service.getBinding(SCABinding.class)
> > + .getComponent();
> > + Component target = (Component)getSCAObject(models,
> > targetCompoent);
> > + URI targetUri = URI.create(target.getUri() + "#" +
> > service.getName());
> > + if (target == null &&
> > (refDefinition.getMultiplicity() == Multiplicity.ZERO_ONE ||
> refDefinition
> > + .getMultiplicity() == Multiplicity.ZERO_N))
> {
> > + // a non-required reference, just skip
> > + continue;
> > + }
> > + if (target == null) {
> > + throw new ComponentNotFoundException("Target
> not
> > found", targetUri);
> > + }
> > + URI sourceURI = URI.create(source.getUri() + "#" +
> > refName);
> > + Wire wire;
> > + try {
> > + wire = createWire(sourceURI, targetUri,
> > refDefinition.getInterfaceContract(), service
> > + .getService().getInterfaceContract(),
> > Wire.LOCAL_BINDING);
> > + } catch (IncompatibleInterfaceContractException e1)
> {
> > + throw new
> > IncompatibleInterfacesException(sourceURI, targetUri, e1);
> > + }
> > + try {
> > + attachInvokers(refName, wire, source, target);
> > + } catch (TargetInvokerCreationException e) {
> > + throw new WireCreationException("Error creating
> > invoker", sourceURI, targetUri, e);
> > + }
> >
> > - if (postProcessorRegistry != null) {
> > - postProcessorRegistry.process(wire);
> > - }
> > + if (postProcessorRegistry != null) {
> > + postProcessorRegistry.process(wire);
> > + }
> >
> > - optimize(source, target, wire);
> > - wires.add(wire);
> > - if (!wire.getCallbackInvocationChains().isEmpty()) {
> > - target.attachCallbackWire(wire);
> > + optimize(source, target, wire);
> > + wires.add(wire);
> > + if (!wire.getCallbackInvocationChains().isEmpty())
> {
> > + target.attachCallbackWire(wire);
> > + }
> > }
> > }
> > if (wires.size() > 1) {
> >
> > Modified:
> >
> incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoAtomicComponent.java
> > URL:
> >
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoAtomicComponent.java?view=diff&rev=528566&r1=528565&r2=528566
> >
> ==============================================================================
> > ---
> >
> incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoAtomicComponent.java
> > (original)
> > +++
> >
> incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoAtomicComponent.java
> > Fri Apr 13 10:49:14 2007
> > @@ -198,14 +198,18 @@
> > }
> > JavaElement element = entry.getValue();
> > ObjectFactory<?> factory = new
> > CallbackWireObjectFactory(element.getType(), proxyService, wires);
> > - configuration.getInjectionSites().add(element);
> > + if (!(element.getAnchor() instanceof Constructor)) {
> > + configuration.getInjectionSites().add(element);
> > + }
> > configuration.setObjectFactory(element, factory);
> > }
> > }
> > for (Reference ref :
> > configuration.getDefinition().getReferences()) {
> > JavaElement element =
> > configuration.getDefinition().getReferenceMembers().get(ref.getName());
> > if (element != null) {
> > - configuration.getInjectionSites().add(element);
> > + if (!(element.getAnchor() instanceof Constructor)) {
> > + configuration.getInjectionSites().add(element);
> > + }
> > List<Wire> wireList = wires.get(ref.getName());
> > if (ref.getMultiplicity() == Multiplicity.ONE_N ||
> > ref.getMultiplicity() == Multiplicity.ZERO_N) {
> > List<ObjectFactory<?>> factories = new
> > ArrayList<ObjectFactory<?>>();
> > @@ -380,7 +384,6 @@
> > return null;
> > }
> >
> > -
> > protected abstract <B> ObjectFactory<B> createWireFactory(Class<B>
> > interfaze, Wire wire);
> >
> > /**
> >
> > Modified:
> >
> incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoConfiguration.java
> > URL:
> >
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoConfiguration.java?view=diff&rev=528566&r1=528565&r2=528566
> >
> ==============================================================================
> > ---
> >
> incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoConfiguration.java
> > (original)
> > +++
> >
> incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoConfiguration.java
> > Fri Apr 13 10:49:14 2007
> > @@ -21,6 +21,7 @@
> > import java.lang.annotation.ElementType;
> > import java.lang.reflect.Constructor;
> > import java.lang.reflect.Field;
> > +import java.lang.reflect.Member;
> > import java.lang.reflect.Method;
> > import java.net.URI;
> > import java.util.ArrayList;
> > @@ -161,10 +162,13 @@
> > Object obj = factories.get(element);
> > if (obj instanceof ObjectFactory) {
> > ObjectFactory<?> factory = (ObjectFactory<?>)obj;
> > + Member member = (Member)element.getAnchor();
> > if (element.getElementType() == ElementType.FIELD) {
> > - injectors[i++] = new
> > FieldInjector<T>((Field)element.getAnchor(), factory);
> > - } else if (element.getElementType() ==
> > ElementType.PARAMETER && element.getAnchor() instanceof Method) {
> > - injectors[i++] = new
> > MethodInjector<T>((Method)element.getAnchor(), factory);
> > + injectors[i++] = new
> FieldInjector<T>((Field)member,
> > factory);
> > + } else if (element.getElementType() ==
> > ElementType.PARAMETER && member instanceof Method) {
> > + injectors[i++] = new
> > MethodInjector<T>((Method)member, factory);
> > + } else if (member instanceof Constructor) {
> > + // Ignore
> > } else {
> > throw new AssertionError(String.valueOf(element));
> > }
> >
> > Modified:
> >
> incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Operation.java
> > URL:
> >
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Operation.java?view=diff&rev=528566&r1=528565&r2=528566
> >
> ==============================================================================
> > ---
> >
> incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Operation.java
> > (original)
> > +++
> >
> incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Operation.java
> > Fri Apr 13 10:49:14 2007
> > @@ -149,4 +149,16 @@
> > * @param wrapperStyle the wrapperStyle to set
> > */
> > void setWrapperStyle(boolean wrapperStyle);
> > +
> > + /**
> > + * Get the databinding for the operation
> > + * @return
> > + */
> > + String getDataBinding();
> > +
> > + /**
> > + * Set the databinding for the operation
> > + * @param dataBinding
> > + */
> > + void setDataBinding(String dataBinding);
> > }
> >
> > Modified:
> >
> incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/OperationImpl.java
> > URL:
> >
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/OperationImpl.java?view=diff&rev=528566&r1=528565&r2=528566
> >
> ==============================================================================
> > ---
> >
> incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/OperationImpl.java
> > (original)
> > +++
> >
> incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/OperationImpl.java
> > Fri Apr 13 10:49:14 2007
> > @@ -43,6 +43,7 @@
> > private boolean nonBlocking;
> > private boolean wrapperStyle;
> > private WrapperInfo wrapper;
> > + private String dataBinding;
> >
> > /**
> > * @param name
> > @@ -270,6 +271,14 @@
> > */
> > public void setWrapperStyle(boolean wrapperStyle) {
> > this.wrapperStyle = wrapperStyle;
> > + }
> > +
> > + public String getDataBinding() {
> > + return dataBinding;
> > + }
> > +
> > + public void setDataBinding(String dataBinding) {
> > + this.dataBinding = dataBinding;
> > }
> >
> > }
> >
> > Modified:
> >
> incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBuilder.java
> > URL:
> >
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBuilder.java?view=diff&rev=528566&r1=528565&r2=528566
> >
> ==============================================================================
> > ---
> >
> incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBuilder.java
> > (original)
> > +++
> >
> incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBuilder.java
> > Fri Apr 13 10:49:14 2007
> > @@ -36,15 +36,15 @@
> > public ServiceBinding build(CompositeService serviceDefinition,
> > EchoBinding bindingDefinition,
> > DeploymentContext context) throws
> > BuilderException {
> > - return new EchoService(URI.create("#" +
> > serviceDefinition.getName()));
> > + return new EchoService(URI.create(context.getComponentId() +
> "#"
> > + serviceDefinition.getName()));
> > }
> >
> > @Override
> > public ReferenceBinding build(CompositeReference
> referenceDefinition,
> > EchoBinding bindingDefinition,
> > DeploymentContext context) throws
> > BuilderException {
> > - URI targetURI = bindingDefinition.getURI() != null?
> > URI.create(bindingDefinition.getURI()) : null;
> > - return new EchoReference(URI.create("#" +
> > referenceDefinition.getName()), targetURI);
> > + URI targetURI = bindingDefinition.getURI() != null ?
> > URI.create(bindingDefinition.getURI()) : null;
> > + return new EchoReference(URI.create(context.getComponentId() +
> > "#" + referenceDefinition.getName()), targetURI);
> > }
> >
> > @Override
> >
> > Modified:
> >
> incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoReference.java
> > URL:
> >
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoReference.java?view=diff&rev=528566&r1=528565&r2=528566
> >
> ==============================================================================
> > ---
> >
> incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoReference.java
> > (original)
> > +++
> >
> incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoReference.java
> > Fri Apr 13 10:49:14 2007
> > @@ -22,8 +22,6 @@
> >
> > import javax.xml.namespace.QName;
> >
> > -import org.apache.tuscany.core.binding.local.LocalCallbackTargetInvoker
> ;
> > -import org.apache.tuscany.core.binding.local.LocalTargetInvoker;
> > import org.apache.tuscany.interfacedef.Operation;
> > import org.apache.tuscany.spi.component.TargetInvokerCreationException;
> > import org.apache.tuscany.spi.extension.ReferenceBindingExtension;
> >
> > Modified:
> >
> incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/EchoBindingTestCase.java
> > URL:
> >
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/EchoBindingTestCase.java?view=diff&rev=528566&r1=528565&r2=528566
> >
> ==============================================================================
> > ---
> >
> incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/EchoBindingTestCase.java
> > (original)
> > +++
> >
> incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/EchoBindingTestCase.java
> > Fri Apr 13 10:49:14 2007
> > @@ -33,7 +33,7 @@
> >
> > protected void setUp() throws Exception {
> > SCARuntime.start("EchoBinding.composite");
> > - ComponentContext context =
> > SCARuntime.getComponentContext("ClientComponent");
> > + ComponentContext context =
> > SCARuntime.getComponentContext("Client");
> > ServiceReference<Client> service =
> > context.createSelfReference(Client.class);
> > client = service.getService();
> > }
> >
> > Modified:
> >
> incubator/tuscany/java/sca/samples/echo-binding/src/test/resources/EchoBinding.composite
> > URL:
> >
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/test/resources/EchoBinding.composite?view=diff&rev=528566&r1=528565&r2=528566
> >
> ==============================================================================
> > ---
> >
> incubator/tuscany/java/sca/samples/echo-binding/src/test/resources/EchoBinding.composite
> > (original)
> > +++
> >
> incubator/tuscany/java/sca/samples/echo-binding/src/test/resources/EchoBinding.composite
> > Fri Apr 13 10:49:14 2007
> > @@ -24,7 +24,7 @@
> >
> > <service name="ClientService" promote="Client">
> > <interface.java
> > interface="org.apache.tuscany.binding.echo.Client"/>
> > - <binding.echo/>
> > + <binding.echo uri="echo://tmp" />
> > </service>
> >
> > <component name="Client">
> > @@ -33,7 +33,7 @@
> >
> > <reference name="EchoReference" promote="Client/echoReference">
> > <interface.java interface="org.apache.tuscany.binding.echo.Echo
> "/>
> > - <binding.echo/>
> > + <binding.echo uri="echo://tmp" />
> > </reference>
> >
> > </composite>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-commits-help@ws.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
Re: svn commit: r528566 - in /incubator/tuscany/java/sca: modules/core/src/main/java/org/apache/tuscany/core/deployer/ modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/ modules/interface/src/main/java/o
Posted by Raymond Feng <en...@gmail.com>.
Hi,
I'm not sure if I changed the modules/pom.xml by mistake. But the test case
is not passing yet. I'll work on that after I finish the core runtime wiring
fix.
Thanks,
Raymond
----- Original Message -----
From: "ant elder" <an...@gmail.com>
To: <tu...@ws.apache.org>
Sent: Friday, April 13, 2007 11:19 AM
Subject: Re: svn commit: r528566 - in /incubator/tuscany/java/sca:
modules/core/src/main/java/org/apache/tuscany/core/deployer/
modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/
modules/interface/src/main/java/o
> I'm getting a build failure as IDLTransformerTestCase fails now. Is there
> something else needed to be checked in or that I should update?
>
> Running
> org.apache.tuscany.core.databinding.transformers.IDLTransformerTestCase
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.109 sec
> <<< FAILURE!
> testTransform(
> org.apache.tuscany.core.databinding.transformers.IDLTransformerTestCase)
> Time elapsed: 0.062 sec <<< ERROR!
> org.apache.tuscany.spi.databinding.TransformationException: No wrapper
> handler is provided for databinding: null
> at
> org.apache.tuscany.core.databinding.transformers.Input2InputTransformer.getWrapperHandler
> (Input2InputTransformer.java:194)
> at
> org.apache.tuscany.core.databinding.transformers.Input2InputTransformer.transform
> (Input2InputTransformer.java:105)
> at
> org.apache.tuscany.core.databinding.transformers.IDLTransformerTestCase.testTransform
> (IDLTransformerTestCase.java:200)
>
> ...ant
>
> On 4/13/07, Raymond Feng <en...@gmail.com> wrote:
>>
>> Hi,
>>
>> With this check-in, the echo binding reference sample is working again.
>> You
>> can start to try other samples.
>>
>> Thanks,
>> Raymond
>>
>> ----- Original Message -----
>> From: <rf...@apache.org>
>> To: <tu...@ws.apache.org>
>> Sent: Friday, April 13, 2007 10:49 AM
>> Subject: svn commit: r528566 - in /incubator/tuscany/java/sca:
>> modules/core/src/main/java/org/apache/tuscany/core/deployer/
>>
>> modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/
>> modules/interface/src/main/java/org/apa...
>>
>>
>> > Author: rfeng
>> > Date: Fri Apr 13 10:49:14 2007
>> > New Revision: 528566
>> >
>> > URL: http://svn.apache.org/viewvc?view=rev&rev=528566
>> > Log:
>> > Add the logic to deal with promoted component reference and bring up
>> > the
>> > echo-binding sample
>> >
>> > Modified:
>> >
>> >
>> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java
>> >
>> >
>> incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoAtomicComponent.java
>> >
>> >
>> incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoConfiguration.java
>> >
>> >
>> incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Operation.java
>> >
>> >
>> incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/OperationImpl.java
>> >
>> >
>> incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBuilder.java
>> >
>> >
>> incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoReference.java
>> >
>> >
>> incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/EchoBindingTestCase.java
>> >
>> >
>> incubator/tuscany/java/sca/samples/echo-binding/src/test/resources/EchoBinding.composite
>> >
>> > Modified:
>> >
>> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java
>> > URL:
>> >
>> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java?view=diff&rev=528566&r1=528565&r2=528566
>> >
>> ==============================================================================
>> > ---
>> >
>> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java
>> > (original)
>> > +++
>> >
>> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java
>> > Fri Apr 13 10:49:14 2007
>> > @@ -191,44 +191,74 @@
>> > for (ComponentReference ref : definition.getReferences()) {
>> > List<Wire> wires = new ArrayList<Wire>();
>> > String refName = ref.getName();
>> > - org.apache.tuscany.assembly.Reference refDefinition =
>> > getReference(definition.getImplementation(), refName);
>> > + org.apache.tuscany.assembly.Reference refDefinition =
>> > ref.getReference();
>> > assert refDefinition != null;
>> > - List<ComponentService> services = ref.getTargets();
>> > - for (ComponentService service : services) {
>> > - org.apache.tuscany.assembly.Component targetCompoent =
>> > service.getBinding(SCABinding.class)
>> > - .getComponent();
>> > - Component target = (Component)getSCAObject(models,
>> > targetCompoent);
>> > - URI targetUri = URI.create(target.getUri() + "#" +
>> > service.getName());
>> > - if (target == null && (refDefinition.getMultiplicity()
>> ==
>> > Multiplicity.ZERO_ONE || refDefinition
>> > - .getMultiplicity() == Multiplicity.ZERO_N)) {
>> > - // a non-required reference, just skip
>> > - continue;
>> > + List<CompositeReference> promoted = ref.promotedAs();
>> > + if (!promoted.isEmpty()) {
>> > + // TODO: Assume a component reference can only be
>> > promoted by at
>> > + // most one composite reference
>> > + CompositeReference compositeReference = promoted.get
>> (0);
>> > + Reference target = (Reference)getSCAObject(models,
>> > compositeReference);
>> > + // FIXME: Assume we only have one binding
>> > + ReferenceBinding binding =
>> > target.getReferenceBindings().get(0);
>> > + URI targetUri = binding.getTargetUri();
>> > + InterfaceContract contract =
>> > binding.getBindingInterfaceContract();
>> > + if (contract == null) {
>> > + contract = refDefinition.getInterfaceContract();
>> > }
>> > - if (target == null) {
>> > - throw new ComponentNotFoundException("Target not
>> > found", targetUri);
>> > - }
>> > - URI sourceURI = URI.create(source.getUri() + "#" +
>> > refName);
>> > + QName type = binding.getBindingType();
>> > + URI sourceUri = URI.create(source.getUri() + "#" +
>> > refName);
>> > Wire wire;
>> > try {
>> > - wire = createWire(sourceURI, targetUri,
>> > refDefinition.getInterfaceContract(), service.getService()
>> > - .getInterfaceContract(), Wire.LOCAL_BINDING);
>> > + wire = createWire(sourceUri, targetUri,
>> > refDefinition.getInterfaceContract(), contract, type);
>> > } catch (IncompatibleInterfaceContractException e1) {
>> > - throw new
>> IncompatibleInterfacesException(sourceURI,
>> > targetUri, e1);
>> > + throw new IllegalStateException(e1);
>> > }
>> > + binding.setWire(wire);
>> > try {
>> > - attachInvokers(refName, wire, source, target);
>> > + attachInvokers(targetUri.getFragment(), wire,
>> > binding, binding);
>> > } catch (TargetInvokerCreationException e) {
>> > - throw new WireCreationException("Error creating
>> > invoker", sourceURI, targetUri, e);
>> > + throw new WireCreationException("Error creating
>> > invoker", sourceUri, targetUri, e);
>> > }
>> > + wires.add(wire);
>> > + } else {
>> > + List<ComponentService> services = ref.getTargets();
>> > + for (ComponentService service : services) {
>> > +
>> > org.apache.tuscany.assembly.ComponenttargetCompoent
>> > = service.getBinding(SCABinding.class)
>> > + .getComponent();
>> > + Component target = (Component)getSCAObject(models,
>> > targetCompoent);
>> > + URI targetUri = URI.create(target.getUri() + "#" +
>> > service.getName());
>> > + if (target == null &&
>> > (refDefinition.getMultiplicity() == Multiplicity.ZERO_ONE ||
>> refDefinition
>> > + .getMultiplicity() ==
>> > Multiplicity.ZERO_N))
>> {
>> > + // a non-required reference, just skip
>> > + continue;
>> > + }
>> > + if (target == null) {
>> > + throw new ComponentNotFoundException("Target
>> not
>> > found", targetUri);
>> > + }
>> > + URI sourceURI = URI.create(source.getUri() + "#" +
>> > refName);
>> > + Wire wire;
>> > + try {
>> > + wire = createWire(sourceURI, targetUri,
>> > refDefinition.getInterfaceContract(), service
>> > + .getService().getInterfaceContract(),
>> > Wire.LOCAL_BINDING);
>> > + } catch (IncompatibleInterfaceContractException
>> > e1)
>> {
>> > + throw new
>> > IncompatibleInterfacesException(sourceURI, targetUri, e1);
>> > + }
>> > + try {
>> > + attachInvokers(refName, wire, source, target);
>> > + } catch (TargetInvokerCreationException e) {
>> > + throw new WireCreationException("Error
>> > creating
>> > invoker", sourceURI, targetUri, e);
>> > + }
>> >
>> > - if (postProcessorRegistry != null) {
>> > - postProcessorRegistry.process(wire);
>> > - }
>> > + if (postProcessorRegistry != null) {
>> > + postProcessorRegistry.process(wire);
>> > + }
>> >
>> > - optimize(source, target, wire);
>> > - wires.add(wire);
>> > - if (!wire.getCallbackInvocationChains().isEmpty()) {
>> > - target.attachCallbackWire(wire);
>> > + optimize(source, target, wire);
>> > + wires.add(wire);
>> > + if (!wire.getCallbackInvocationChains().isEmpty())
>> {
>> > + target.attachCallbackWire(wire);
>> > + }
>> > }
>> > }
>> > if (wires.size() > 1) {
>> >
>> > Modified:
>> >
>> incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoAtomicComponent.java
>> > URL:
>> >
>> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoAtomicComponent.java?view=diff&rev=528566&r1=528565&r2=528566
>> >
>> ==============================================================================
>> > ---
>> >
>> incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoAtomicComponent.java
>> > (original)
>> > +++
>> >
>> incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoAtomicComponent.java
>> > Fri Apr 13 10:49:14 2007
>> > @@ -198,14 +198,18 @@
>> > }
>> > JavaElement element = entry.getValue();
>> > ObjectFactory<?> factory = new
>> > CallbackWireObjectFactory(element.getType(), proxyService, wires);
>> > - configuration.getInjectionSites().add(element);
>> > + if (!(element.getAnchor() instanceof Constructor)) {
>> > + configuration.getInjectionSites().add(element);
>> > + }
>> > configuration.setObjectFactory(element, factory);
>> > }
>> > }
>> > for (Reference ref :
>> > configuration.getDefinition().getReferences()) {
>> > JavaElement element =
>> > configuration.getDefinition().getReferenceMembers().get(ref.getName());
>> > if (element != null) {
>> > - configuration.getInjectionSites().add(element);
>> > + if (!(element.getAnchor() instanceof Constructor)) {
>> > + configuration.getInjectionSites().add(element);
>> > + }
>> > List<Wire> wireList = wires.get(ref.getName());
>> > if (ref.getMultiplicity() == Multiplicity.ONE_N ||
>> > ref.getMultiplicity() == Multiplicity.ZERO_N) {
>> > List<ObjectFactory<?>> factories = new
>> > ArrayList<ObjectFactory<?>>();
>> > @@ -380,7 +384,6 @@
>> > return null;
>> > }
>> >
>> > -
>> > protected abstract <B> ObjectFactory<B> createWireFactory(Class<B>
>> > interfaze, Wire wire);
>> >
>> > /**
>> >
>> > Modified:
>> >
>> incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoConfiguration.java
>> > URL:
>> >
>> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoConfiguration.java?view=diff&rev=528566&r1=528565&r2=528566
>> >
>> ==============================================================================
>> > ---
>> >
>> incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoConfiguration.java
>> > (original)
>> > +++
>> >
>> incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/context/PojoConfiguration.java
>> > Fri Apr 13 10:49:14 2007
>> > @@ -21,6 +21,7 @@
>> > import java.lang.annotation.ElementType;
>> > import java.lang.reflect.Constructor;
>> > import java.lang.reflect.Field;
>> > +import java.lang.reflect.Member;
>> > import java.lang.reflect.Method;
>> > import java.net.URI;
>> > import java.util.ArrayList;
>> > @@ -161,10 +162,13 @@
>> > Object obj = factories.get(element);
>> > if (obj instanceof ObjectFactory) {
>> > ObjectFactory<?> factory = (ObjectFactory<?>)obj;
>> > + Member member = (Member)element.getAnchor();
>> > if (element.getElementType() == ElementType.FIELD) {
>> > - injectors[i++] = new
>> > FieldInjector<T>((Field)element.getAnchor(), factory);
>> > - } else if (element.getElementType() ==
>> > ElementType.PARAMETER && element.getAnchor() instanceof Method) {
>> > - injectors[i++] = new
>> > MethodInjector<T>((Method)element.getAnchor(), factory);
>> > + injectors[i++] = new
>> FieldInjector<T>((Field)member,
>> > factory);
>> > + } else if (element.getElementType() ==
>> > ElementType.PARAMETER && member instanceof Method) {
>> > + injectors[i++] = new
>> > MethodInjector<T>((Method)member, factory);
>> > + } else if (member instanceof Constructor) {
>> > + // Ignore
>> > } else {
>> > throw new AssertionError(String.valueOf(element));
>> > }
>> >
>> > Modified:
>> >
>> incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Operation.java
>> > URL:
>> >
>> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Operation.java?view=diff&rev=528566&r1=528565&r2=528566
>> >
>> ==============================================================================
>> > ---
>> >
>> incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Operation.java
>> > (original)
>> > +++
>> >
>> incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Operation.java
>> > Fri Apr 13 10:49:14 2007
>> > @@ -149,4 +149,16 @@
>> > * @param wrapperStyle the wrapperStyle to set
>> > */
>> > void setWrapperStyle(boolean wrapperStyle);
>> > +
>> > + /**
>> > + * Get the databinding for the operation
>> > + * @return
>> > + */
>> > + String getDataBinding();
>> > +
>> > + /**
>> > + * Set the databinding for the operation
>> > + * @param dataBinding
>> > + */
>> > + void setDataBinding(String dataBinding);
>> > }
>> >
>> > Modified:
>> >
>> incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/OperationImpl.java
>> > URL:
>> >
>> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/OperationImpl.java?view=diff&rev=528566&r1=528565&r2=528566
>> >
>> ==============================================================================
>> > ---
>> >
>> incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/OperationImpl.java
>> > (original)
>> > +++
>> >
>> incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/OperationImpl.java
>> > Fri Apr 13 10:49:14 2007
>> > @@ -43,6 +43,7 @@
>> > private boolean nonBlocking;
>> > private boolean wrapperStyle;
>> > private WrapperInfo wrapper;
>> > + private String dataBinding;
>> >
>> > /**
>> > * @param name
>> > @@ -270,6 +271,14 @@
>> > */
>> > public void setWrapperStyle(boolean wrapperStyle) {
>> > this.wrapperStyle = wrapperStyle;
>> > + }
>> > +
>> > + public String getDataBinding() {
>> > + return dataBinding;
>> > + }
>> > +
>> > + public void setDataBinding(String dataBinding) {
>> > + this.dataBinding = dataBinding;
>> > }
>> >
>> > }
>> >
>> > Modified:
>> >
>> incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBuilder.java
>> > URL:
>> >
>> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBuilder.java?view=diff&rev=528566&r1=528565&r2=528566
>> >
>> ==============================================================================
>> > ---
>> >
>> incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBuilder.java
>> > (original)
>> > +++
>> >
>> incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBuilder.java
>> > Fri Apr 13 10:49:14 2007
>> > @@ -36,15 +36,15 @@
>> > public ServiceBinding build(CompositeService serviceDefinition,
>> > EchoBinding bindingDefinition,
>> > DeploymentContext context) throws
>> > BuilderException {
>> > - return new EchoService(URI.create("#" +
>> > serviceDefinition.getName()));
>> > + return new EchoService(URI.create(context.getComponentId() +
>> "#"
>> > + serviceDefinition.getName()));
>> > }
>> >
>> > @Override
>> > public ReferenceBinding build(CompositeReference
>> referenceDefinition,
>> > EchoBinding bindingDefinition,
>> > DeploymentContext context) throws
>> > BuilderException {
>> > - URI targetURI = bindingDefinition.getURI() != null?
>> > URI.create(bindingDefinition.getURI()) : null;
>> > - return new EchoReference(URI.create("#" +
>> > referenceDefinition.getName()), targetURI);
>> > + URI targetURI = bindingDefinition.getURI() != null ?
>> > URI.create(bindingDefinition.getURI()) : null;
>> > + return new EchoReference(URI.create(context.getComponentId() +
>> > "#" + referenceDefinition.getName()), targetURI);
>> > }
>> >
>> > @Override
>> >
>> > Modified:
>> >
>> incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoReference.java
>> > URL:
>> >
>> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoReference.java?view=diff&rev=528566&r1=528565&r2=528566
>> >
>> ==============================================================================
>> > ---
>> >
>> incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoReference.java
>> > (original)
>> > +++
>> >
>> incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoReference.java
>> > Fri Apr 13 10:49:14 2007
>> > @@ -22,8 +22,6 @@
>> >
>> > import javax.xml.namespace.QName;
>> >
>> > -import
>> > org.apache.tuscany.core.binding.local.LocalCallbackTargetInvoker
>> ;
>> > -import org.apache.tuscany.core.binding.local.LocalTargetInvoker;
>> > import org.apache.tuscany.interfacedef.Operation;
>> > import org.apache.tuscany.spi.component.TargetInvokerCreationException;
>> > import org.apache.tuscany.spi.extension.ReferenceBindingExtension;
>> >
>> > Modified:
>> >
>> incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/EchoBindingTestCase.java
>> > URL:
>> >
>> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/EchoBindingTestCase.java?view=diff&rev=528566&r1=528565&r2=528566
>> >
>> ==============================================================================
>> > ---
>> >
>> incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/EchoBindingTestCase.java
>> > (original)
>> > +++
>> >
>> incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/EchoBindingTestCase.java
>> > Fri Apr 13 10:49:14 2007
>> > @@ -33,7 +33,7 @@
>> >
>> > protected void setUp() throws Exception {
>> > SCARuntime.start("EchoBinding.composite");
>> > - ComponentContext context =
>> > SCARuntime.getComponentContext("ClientComponent");
>> > + ComponentContext context =
>> > SCARuntime.getComponentContext("Client");
>> > ServiceReference<Client> service =
>> > context.createSelfReference(Client.class);
>> > client = service.getService();
>> > }
>> >
>> > Modified:
>> >
>> incubator/tuscany/java/sca/samples/echo-binding/src/test/resources/EchoBinding.composite
>> > URL:
>> >
>> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/test/resources/EchoBinding.composite?view=diff&rev=528566&r1=528565&r2=528566
>> >
>> ==============================================================================
>> > ---
>> >
>> incubator/tuscany/java/sca/samples/echo-binding/src/test/resources/EchoBinding.composite
>> > (original)
>> > +++
>> >
>> incubator/tuscany/java/sca/samples/echo-binding/src/test/resources/EchoBinding.composite
>> > Fri Apr 13 10:49:14 2007
>> > @@ -24,7 +24,7 @@
>> >
>> > <service name="ClientService" promote="Client">
>> > <interface.java
>> > interface="org.apache.tuscany.binding.echo.Client"/>
>> > - <binding.echo/>
>> > + <binding.echo uri="echo://tmp" />
>> > </service>
>> >
>> > <component name="Client">
>> > @@ -33,7 +33,7 @@
>> >
>> > <reference name="EchoReference" promote="Client/echoReference">
>> > <interface.java interface="org.apache.tuscany.binding.echo.Echo
>> "/>
>> > - <binding.echo/>
>> > + <binding.echo uri="echo://tmp" />
>> > </reference>
>> >
>> > </composite>
>> >
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
>> > For additional commands, e-mail: tuscany-commits-help@ws.apache.org
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org