diff options
Diffstat (limited to 'sca-java-2.x/trunk')
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; |