tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r1185128 - in /tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions: Definitions.java impl/DefinitionsImpl.java
Date Mon, 17 Oct 2011 12:37:55 GMT
Author: slaws
Date: Mon Oct 17 12:37:54 2011
New Revision: 1185128

URL: http://svn.apache.org/viewvc?rev=1185128&view=rev
Log:
Get binding and implementation types given a QName

Modified:
    tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java
    tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java

Modified: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java?rev=1185128&r1=1185127&r2=1185128&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java
Mon Oct 17 12:37:54 2011
@@ -20,6 +20,8 @@ package org.apache.tuscany.sca.definitio
 
 import java.util.List;
 
+import javax.xml.namespace.QName;
+
 import org.apache.tuscany.sca.assembly.Binding;
 import org.apache.tuscany.sca.policy.BindingType;
 import org.apache.tuscany.sca.policy.ImplementationType;
@@ -69,6 +71,15 @@ public interface Definitions {
      */
     List<BindingType> getBindingTypes();
     
+    /**
+     * Returns the requested Binding Type or null
+     * if the requested Binding Type is not defined
+     * in the domain
+     * 
+     * @param  bindingTypeName the name of the Binding Type to return
+     * @return Binding Type or null if the Binding Type is not present
+     */
+    BindingType getBindingType(QName bindingTypeName);
     
     /**
      * Returns a list of domain wide Implementation Types
@@ -78,6 +89,16 @@ public interface Definitions {
     List<ImplementationType> getImplementationTypes();
 
     /**
+     * Returns the requested Implementation Type or null
+     * if the requested Implementation Type is not defined
+     * in the domain
+     * 
+     * @param implementationTypeName the name of the implementation type to return
+     * @return Implementation Type or null if the Implementation Type is not present
+     */
+    ImplementationType getImplementationType(QName implementationTypeName);
+    
+    /**
      * Returns a list of domain wide binding definition objects
      * 
      * @return a list of domain wide binding definition objects 

Modified: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java?rev=1185128&r1=1185127&r2=1185128&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java
Mon Oct 17 12:37:54 2011
@@ -22,6 +22,8 @@ package org.apache.tuscany.sca.definitio
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 
+import javax.xml.namespace.QName;
+
 import org.apache.tuscany.sca.assembly.Binding;
 import org.apache.tuscany.sca.definitions.Definitions;
 import org.apache.tuscany.sca.policy.BindingType;
@@ -48,10 +50,32 @@ public class DefinitionsImpl implements 
     public List<BindingType> getBindingTypes() {
         return bindingTypes;
     }
+    
+    public BindingType getBindingType(QName bindingTypeName) {
+        
+        for(BindingType bindingType : bindingTypes){
+            if (bindingType.getType().equals(bindingTypeName)){
+                return bindingType;
+            }
+        }
+        
+        return null;
+    }    
 
     public List<ImplementationType> getImplementationTypes() {
         return implementationTypes;
     }
+    
+    public ImplementationType getImplementationType(QName implementationTypeName) {
+        
+        for(ImplementationType implementationType : implementationTypes){
+            if (implementationType.getType().equals(implementationTypeName)){
+                return implementationType;
+            }
+        }
+        
+        return null;
+    }     
 
     public List<Intent> getIntents() {
         return intents;



Mime
View raw message