tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r801581 - in /tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly: Composite.java impl/CompositeImpl.java
Date Thu, 06 Aug 2009 09:47:27 GMT
Author: slaws
Date: Thu Aug  6 09:47:26 2009
New Revision: 801581

URL: http://svn.apache.org/viewvc?rev=801581&view=rev
Log:
Add helper method to return component by name. 

Modified:
    tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Composite.java
    tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java

Modified: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Composite.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Composite.java?rev=801581&r1=801580&r2=801581&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Composite.java
(original)
+++ tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Composite.java
Thu Aug  6 09:47:26 2009
@@ -73,7 +73,12 @@
      * @return a list of components contained in this composite
      */
     List<Component> getComponents();
-
+    
+    /**
+     * Returns a component by name
+     */
+    Component getComponent(String name);
+    
     /**
      * Returns a list of wires contained in this composite.
      *

Modified: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java?rev=801581&r1=801580&r2=801581&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java
(original)
+++ tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java
Thu Aug  6 09:47:26 2009
@@ -99,6 +99,18 @@
     public List<Component> getComponents() {
         return components;
     }
+    
+    public Component getComponent(String name) {
+        Component component = null;
+        
+        for (Component tmp : getComponents()){
+            if (tmp.getName().equals(name)){
+                component = tmp;
+                break;
+            }
+        }
+        return component;
+    }
 
     public List<Composite> getIncludes() {
         return includes;



Mime
View raw message