From 9140002a094c467bde17281ade514183d138b1b8 Mon Sep 17 00:00:00 2001 From: beckerdo Date: Fri, 6 Feb 2009 19:47:41 +0000 Subject: TUSCANY-2821 Added JMS Binding APIs public Set getOperationNames() and public Object getOperationProperty(String opName, String propName ). git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@741694 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/binding/jms/impl/JMSBinding.java | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'branches/sca-java-1.x/modules/binding-jms/src/main/java/org') diff --git a/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBinding.java b/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBinding.java index a3d383b4c5..6c9ba36162 100644 --- a/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBinding.java +++ b/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBinding.java @@ -23,6 +23,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.TreeSet; import org.apache.tuscany.sca.assembly.BindingRRB; import org.apache.tuscany.sca.assembly.OperationSelector; @@ -492,6 +493,17 @@ public class JMSBinding implements BindingRRB, PolicySetAttachPoint { properties.put(name, value); } + /** + * Provides key set of operation names in this binding. + * @return a Set of operation names + */ + public Set getOperationNames() { + // Make a defensive copy since key changes affect map, map changes affect keys. + Set opNames = operationProperties.keySet(); + Set opNamesCopy = new TreeSet( opNames ); + return opNamesCopy; + } + public Map getOperationProperties(String opName) { return operationProperties.get(opName); } @@ -505,6 +517,21 @@ public class JMSBinding implements BindingRRB, PolicySetAttachPoint { props.put(propName, value); } + /** + * Provides the value of a property for a given operation + * @param opName is the name of the operation in this binding. + * @param propName is the key name for the property + * @return Object representing the property value for this property name. Returns + * null for non existant operation name or property name. + */ + public Object getOperationProperty(String opName, String propName ) { + Map props = operationProperties.get(opName); + if (props == null) { + return null; + } + return props.get(propName); + } + public boolean hasNativeOperationName(String opName) { return nativeOperationNames.containsKey(opName); } -- cgit v1.2.3