diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-10-17 12:37:54 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-10-17 12:37:54 +0000 |
commit | 5d5faccceb78ab2bc806551ba5910de3c5db8f10 (patch) | |
tree | 26f197346e1ed20f59d2912299e33a9c52995962 /sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca | |
parent | c7fdc82a82af045b591d02bfa9d39f26d28ad4e5 (diff) |
Get binding and implementation types given a QName
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1185128 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca')
2 files changed, 45 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java index 9ae5e6f26f..611eadee8d 100644 --- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java +++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java @@ -20,6 +20,8 @@ package org.apache.tuscany.sca.definitions; 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 diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java index e58261cda2..2e34346ef0 100644 --- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java +++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java @@ -22,6 +22,8 @@ package org.apache.tuscany.sca.definitions.impl; 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 Definitions { 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; |