tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r557438 - in /incubator/tuscany/java/sca/modules: assembly/src/main/java/org/apache/tuscany/sca/assembly/ assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ core...
Date Thu, 19 Jul 2007 00:46:52 GMT
Author: rfeng
Date: Wed Jul 18 17:46:51 2007
New Revision: 557438

URL: http://svn.apache.org/viewvc?view=rev&rev=557438
Log:
Consolidate the WireableBinding into SCABinding 

Removed:
    incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/WireableBinding.java
Modified:
    incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABinding.java
    incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
    incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ReferenceUtil.java
    incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingImpl.java
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/CompositeActivatorImpl.java

Modified: incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABinding.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABinding.java?view=diff&rev=557438&r1=557437&r2=557438
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABinding.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABinding.java
Wed Jul 18 17:46:51 2007
@@ -23,7 +23,7 @@
  * 
  * @version $Rev$ $Date$
  */
-public interface SCABinding extends WireableBinding {
+public interface SCABinding extends Binding, Cloneable {
     /**
      * This is a hack to navigate to the containing component
      * @return
@@ -36,4 +36,36 @@
      */
     @Deprecated
     void setComponent(Component component);
+    
+    /**
+     * Clone the binding endpoit
+     * @return
+     */
+    Object clone() throws CloneNotSupportedException;
+
+    /**
+     * @param component
+     */
+    void setTargetComponent(Component component);
+    /**
+     * @param service
+     */
+    void setTargetComponentService(ComponentService service);
+    /**
+     * @param binding
+     */
+    void setTargetBinding(Binding binding);
+    
+    /**
+     * @return
+     */
+    Binding getTargetBinding();
+    /**
+     * @return
+     */
+    Component getTargetComponent();
+    /**
+     * @return
+     */
+    ComponentService getTargetComponentService();    
 }

Modified: incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java?view=diff&rev=557438&r1=557437&r2=557438
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
Wed Jul 18 17:46:51 2007
@@ -27,7 +27,6 @@
 
 import org.apache.tuscany.sca.assembly.AssemblyFactory;
 import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.WireableBinding;
 import org.apache.tuscany.sca.assembly.Component;
 import org.apache.tuscany.sca.assembly.ComponentProperty;
 import org.apache.tuscany.sca.assembly.ComponentReference;
@@ -1392,7 +1391,7 @@
         bindings.addAll(reference.getBindings());
         promotedReference.getBindings().clear();
         for (Binding binding : bindings) {
-            if ((!(binding instanceof WireableBinding)) || binding.getURI() != null) {
+            if ((!(binding instanceof SCABinding)) || binding.getURI() != null) {
                 promotedReference.getBindings().add(binding);
             }
         }
@@ -1411,7 +1410,7 @@
         }
         promotedReference.setCallback(assemblyFactory.createCallback());
         for (Binding binding : callbackBindings) {
-            if ((!(binding instanceof WireableBinding)) || binding.getURI() != null) {
+            if ((!(binding instanceof SCABinding)) || binding.getURI() != null) {
                 promotedReference.getCallback().getBindings().add(binding);
             }
         }
@@ -1594,8 +1593,8 @@
                     Binding cloned = binding;
                     // TODO: We need to clone the reference binding
                     try {
-                        cloned = (Binding)((WireableBinding)binding).clone();
-                        WireableBinding endpoint = ((WireableBinding)cloned);
+                        cloned = (Binding)((SCABinding)binding).clone();
+                        SCABinding endpoint = ((SCABinding)cloned);
                         // FIXME: This is a hack to get the target component
                         SCABinding scaBinding = service.getBinding(SCABinding.class);
                         if (scaBinding != null) {

Modified: incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ReferenceUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ReferenceUtil.java?view=diff&rev=557438&r1=557437&r2=557438
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ReferenceUtil.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ReferenceUtil.java
Wed Jul 18 17:46:51 2007
@@ -22,7 +22,7 @@
 
 import org.apache.tuscany.sca.assembly.Binding;
 import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.assembly.WireableBinding;
+import org.apache.tuscany.sca.assembly.SCABinding;
 
 /**
  * This class encapsulates utility methods to deal with reference definitions
@@ -68,7 +68,7 @@
                 if (count != 1) {
                     if (count == 0) {
                         for (Binding binding: bindings) {
-                            if (!(binding instanceof WireableBinding) || binding.getURI()!=null)
{
+                            if (!(binding instanceof SCABinding) || binding.getURI()!=null)
{
                                 return true;
                             }
                         }
@@ -80,7 +80,7 @@
                 if (count < 1) {
                     if (count == 0) {
                         for (Binding binding: bindings) {
-                            if (!(binding instanceof WireableBinding) || binding.getURI()!=null)
{
+                            if (!(binding instanceof SCABinding) || binding.getURI()!=null)
{
                                 return true;
                             }
                         }

Modified: incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingImpl.java?view=diff&rev=557438&r1=557437&r2=557438
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingImpl.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingImpl.java
Wed Jul 18 17:46:51 2007
@@ -22,7 +22,6 @@
 import java.util.List;
 
 import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.WireableBinding;
 import org.apache.tuscany.sca.assembly.Component;
 import org.apache.tuscany.sca.assembly.ComponentService;
 import org.apache.tuscany.sca.assembly.SCABinding;
@@ -34,7 +33,7 @@
  * 
  * @version $Rev$ $Date$
  */
-public class SCABindingImpl implements SCABinding, WireableBinding {
+public class SCABindingImpl implements SCABinding {
     private String name;
     private String uri;
     private List<PolicySet> policySets = new ArrayList<PolicySet>();

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/CompositeActivatorImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/CompositeActivatorImpl.java?view=diff&rev=557438&r1=557437&r2=557438
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/CompositeActivatorImpl.java
(original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/CompositeActivatorImpl.java
Wed Jul 18 17:46:51 2007
@@ -23,13 +23,13 @@
 
 import org.apache.tuscany.sca.assembly.AssemblyFactory;
 import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.WireableBinding;
 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.Implementation;
 import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.assembly.SCABinding;
 import org.apache.tuscany.sca.assembly.SCABindingFactory;
 import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
 import org.apache.tuscany.sca.assembly.builder.CompositeBuilderMonitor;
@@ -377,8 +377,8 @@
                     }
                     if (service.getCallback() != null) {
                         for (Binding binding : service.getCallback().getBindings()) {
-                            if (binding instanceof WireableBinding) {
-                                if (((WireableBinding)binding).getTargetComponent() != null)
{
+                            if (binding instanceof SCABinding) {
+                                if (((SCABinding)binding).getTargetComponent() != null) {
                                     continue;
                                 }
                             }
@@ -421,13 +421,13 @@
         if (!(reference instanceof RuntimeComponentReference)) {
             return;
         }
-        if ((!(binding instanceof WireableBinding)) || binding.getURI() != null || isCallback)
{
+        if ((!(binding instanceof SCABinding)) || binding.getURI() != null || isCallback)
{
             // create wire if binding has an endpoint
             Component targetComponent = null;
             ComponentService targetComponentService = null;
             Binding targetBinding = null;
-            if (binding instanceof WireableBinding) {
-                WireableBinding endpoint = (WireableBinding)binding;
+            if (binding instanceof SCABinding) {
+                SCABinding endpoint = (SCABinding)binding;
                 targetComponent = endpoint.getTargetComponent();
                 targetComponentService = endpoint.getTargetComponentService();
                 targetBinding = endpoint.getTargetBinding();



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message