diff options
author | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2009-09-03 08:55:41 +0000 |
---|---|---|
committer | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2009-09-03 08:55:41 +0000 |
commit | f41a3e2b6c167f848b880e395e3acb9e281a8978 (patch) | |
tree | 10cae9fc0717905e3fba87ba1f6972441eaa9c80 /branches/sca-java-1.5.1/modules/assembly | |
parent | 31ded537ca628e18b6c86e09568a0c2caec1671f (diff) |
Fix TUSCANY-3254: null returned by RequestContext.getCallbackReference()
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@810830 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.5.1/modules/assembly')
3 files changed, 25 insertions, 0 deletions
diff --git a/branches/sca-java-1.5.1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java b/branches/sca-java-1.5.1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java index 1158356012..5e984c3126 100644 --- a/branches/sca-java-1.5.1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java +++ b/branches/sca-java-1.5.1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java @@ -792,6 +792,19 @@ public abstract class BaseConfigurationBuilderImpl { * @param service */ private ComponentReference createCallbackReference(Component component, ComponentService service) { + return createCallbackReference(component, service, assemblyFactory); + } + + /** + * Create a callback reference for a component service + * + * @param component + * @param service + * @param assemblyFactory + */ + protected static ComponentReference createCallbackReference(Component component, + ComponentService service, + AssemblyFactory assemblyFactory) { ComponentReference componentReference = assemblyFactory.createComponentReference(); componentReference.setIsCallback(true); componentReference.setName(service.getName()); diff --git a/branches/sca-java-1.5.1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServicePromotionBuilderImpl.java b/branches/sca-java-1.5.1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServicePromotionBuilderImpl.java index d73286f7ab..ce3f817acf 100644 --- a/branches/sca-java-1.5.1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServicePromotionBuilderImpl.java +++ b/branches/sca-java-1.5.1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServicePromotionBuilderImpl.java @@ -21,6 +21,7 @@ package org.apache.tuscany.sca.assembly.builder.impl; import org.apache.tuscany.sca.assembly.AssemblyFactory; import org.apache.tuscany.sca.assembly.Component; +import org.apache.tuscany.sca.assembly.ComponentReference; import org.apache.tuscany.sca.assembly.ComponentService; import org.apache.tuscany.sca.assembly.Composite; import org.apache.tuscany.sca.assembly.CompositeService; @@ -83,6 +84,11 @@ public class ComponentServicePromotionBuilderImpl implements CompositeBuilder { newComponentService.setCallback(assemblyFactory.createCallback()); newComponentService.getCallback().getBindings() .addAll(componentService.getCallback().getBindings()); + ComponentReference callbackReference = + BaseConfigurationBuilderImpl.createCallbackReference(promotedComponent, newComponentService, + assemblyFactory); + callbackReference.getBindings().addAll(componentService.getCallback().getBindings()); + newComponentService.setCallbackReference(callbackReference); } // Change the composite service to now promote the diff --git a/branches/sca-java-1.5.1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServicePromotionBuilderImpl.java b/branches/sca-java-1.5.1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServicePromotionBuilderImpl.java index ea0e88ac24..38cbaf7744 100644 --- a/branches/sca-java-1.5.1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServicePromotionBuilderImpl.java +++ b/branches/sca-java-1.5.1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServicePromotionBuilderImpl.java @@ -21,6 +21,7 @@ package org.apache.tuscany.sca.assembly.builder.impl; import org.apache.tuscany.sca.assembly.AssemblyFactory; import org.apache.tuscany.sca.assembly.Component; +import org.apache.tuscany.sca.assembly.ComponentReference; import org.apache.tuscany.sca.assembly.ComponentService; import org.apache.tuscany.sca.assembly.Composite; import org.apache.tuscany.sca.assembly.CompositeService; @@ -64,6 +65,11 @@ public class CompositeServicePromotionBuilderImpl implements CompositeBuilder { newComponentService.setCallback(assemblyFactory.createCallback()); newComponentService.getCallback().getBindings() .addAll(compositeService.getCallback().getBindings()); + ComponentReference callbackReference = + BaseConfigurationBuilderImpl.createCallbackReference(promotedComponent, newComponentService, + assemblyFactory); + callbackReference.getBindings().addAll(compositeService.getCallback().getBindings()); + newComponentService.setCallbackReference(callbackReference); } // Change the composite service to now promote the newly |