Author: antelder
Date: Tue Dec 20 14:22:19 2011
New Revision: 1221271

URL: http://svn.apache.org/viewvc?rev=1221271&view=rev
Log:
MOve the initilization of a default destination name to a seperate method so it 
can be overriden by subclasses

Modified:
    
tuscany/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java

Modified: 
tuscany/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java?rev=1221271&r1=1221270&r2=1221271&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java
 Tue Dec 20 14:22:19 2011
@@ -98,16 +98,7 @@ public class JMSBindingServiceBindingPro
             throw new JMSBindingException("[BJM30023] response/activationSpec 
element MUST NOT be present when the binding is being used for an SCA service");
         }
         
-        // Set the default destination when using a connection factory.
-        // If an activation spec is being used, do not set the destination
-        // because the activation spec provides the destination.
-        if (jmsBinding.getDestinationName() == null &&
-            (jmsBinding.getActivationSpecName() == null || 
jmsBinding.getActivationSpecName().equals(""))) {
-//          if (!service.isCallback()) { // TODO: 2.x migration, is this check 
needed?
-                // use the SCA service name as the default destination name
-                jmsBinding.setDestinationName(service.getName());
-//            }
-        }
+        initBindingName();
         
         // Get Message factory
         modelFactories = 
extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
@@ -146,6 +137,19 @@ public class JMSBindingServiceBindingPro
         }
     }
 
+    protected void initBindingName() {
+        // Set the default destination when using a connection factory.
+        // If an activation spec is being used, do not set the destination
+        // because the activation spec provides the destination.
+        if (jmsBinding.getDestinationName() == null &&
+            (jmsBinding.getActivationSpecName() == null || 
jmsBinding.getActivationSpecName().equals(""))) {
+//          if (!service.isCallback()) { // TODO: 2.x migration, is this check 
needed?
+                // use the SCA service name as the default destination name
+                jmsBinding.setDestinationName(service.getName());
+//            }
+        }
+    }
+
     public InterfaceContract getBindingInterfaceContract() {
         return interfaceContract;
     }


Reply via email to