[347654] MessageDriven bean EJB 3 wizard generates non-portable code
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.j2ee.ejb/META-INF/MANIFEST.MF
index 1604bdc..472be4f 100644
--- a/plugins/org.eclipse.jst.j2ee.ejb/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jst.j2ee.ejb/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name.0
 Bundle-SymbolicName: org.eclipse.jst.j2ee.ejb; singleton:=true
-Bundle-Version: 1.1.600.qualifier
+Bundle-Version: 1.1.700.qualifier
 Bundle-Activator: org.eclipse.jst.j2ee.ejb.internal.plugin.EjbPlugin
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateMessageDrivenBeanTemplateModel.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateMessageDrivenBeanTemplateModel.java
index 63aeda3..4dce21f 100644
--- a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateMessageDrivenBeanTemplateModel.java
+++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateMessageDrivenBeanTemplateModel.java
@@ -17,7 +17,7 @@
 import static org.eclipse.jst.j2ee.ejb.internal.operations.INewMessageDrivenBeanClassDataModelProperties.MESSAGE_LISTENER_INTERFACE;
 
 import java.util.Collection;
-import java.util.Hashtable;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -38,6 +38,8 @@
 	public static final String ATT_MESSAGE_LISTENER_INTERFACE = "messageListenerInterface"; //$NON-NLS-1$
 	public static final String ON_MESSAGE = "onMessage"; //$NON-NLS-1$
 	public static final String ON_MESSAGE_SIGNATURE = "(Ljavax/jms/Message;)V"; //$NON-NLS-1$
+	public static final String PROP_DESTINATION_TYPE = "destinationType"; //$NON-NLS-1$
+	public static final String PROP_DESTINATION = "destination"; //$NON-NLS-1$
 
 	private static final String CLASS_SUFFIX = ".class"; //$NON-NLS-1$
 	
@@ -65,14 +67,17 @@
 		return collection;
 	}
 
-	public Map<String, String> getClassAnnotationParams() {
-		Map<String, String> result = new Hashtable<String, String>();
+	public Map<String, Object> getClassAnnotationParams() {
+		Map<String, Object> result = new HashMap<String, Object>();
+		Map<String, String> activationConfigProperties = new HashMap<String, String>();
+		result.put(ATT_ACTIVATION_CONFIG, activationConfigProperties);
+		
 		if (isJMS()){
 			String destinationType = dataModel.getStringProperty(DESTINATION_TYPE);
 			if (destinationType.equals(DestinationType.QUEUE.toString())) 
-				result.put(ATT_ACTIVATION_CONFIG, "javax.jms.Queue"); //$NON-NLS-1$
+				activationConfigProperties.put(PROP_DESTINATION_TYPE, "javax.jms.Queue"); //$NON-NLS-1$
 			else if (destinationType.equals(DestinationType.TOPIC.toString())) 
-				result.put(ATT_ACTIVATION_CONFIG, "javax.jms.Topic"); //$NON-NLS-1$
+				activationConfigProperties.put(PROP_DESTINATION_TYPE, "javax.jms.Topic"); //$NON-NLS-1$
 			else 
 				throw new IllegalStateException("illegal destination type: " + destinationType); //$NON-NLS-1$
 		}
@@ -82,6 +87,9 @@
 		String mappedName = getProperty(MAPPED_NAME).trim();
 		if (mappedName != null && mappedName.length() > 0) {
 			result.put(ATT_MAPPED_NAME, QUOTATION_STRING + mappedName + QUOTATION_STRING);
+			if (isJMS()) {
+				activationConfigProperties.put(PROP_DESTINATION, mappedName);
+			}
 		}
 		String messageListenerInterface = getProperty(MESSAGE_LISTENER_INTERFACE);
 		
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/MessageDrivenBeanTemplate.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/MessageDrivenBeanTemplate.java
index e248287..54cf1a5 100644
--- a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/MessageDrivenBeanTemplate.java
+++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/MessageDrivenBeanTemplate.java
@@ -32,45 +32,49 @@
   protected final String TEXT_6 = NL;
   protected final String TEXT_7 = NL;
   protected final String TEXT_8 = "/**" + NL + " * Message-Driven Bean implementation class for: "; //$NON-NLS-1$ //$NON-NLS-2$
-  protected final String TEXT_9 = NL + " *" + NL + " */" + NL + "@MessageDriven"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+  protected final String TEXT_9 = NL + " */" + NL + "@MessageDriven"; //$NON-NLS-1$ //$NON-NLS-2$
   protected final String TEXT_10 = "("; //$NON-NLS-1$
-  protected final String TEXT_11 = ", "; //$NON-NLS-1$
-  protected final String TEXT_12 = NL + "\t\t"; //$NON-NLS-1$
-  protected final String TEXT_13 = NL + "\t\tactivationConfig = { @ActivationConfigProperty(" + NL + "\t\t\t\tpropertyName = \"destinationType\", propertyValue = \""; //$NON-NLS-1$ //$NON-NLS-2$
-  protected final String TEXT_14 = "\"" + NL + "\t\t) }"; //$NON-NLS-1$ //$NON-NLS-2$
-  protected final String TEXT_15 = " = "; //$NON-NLS-1$
-  protected final String TEXT_16 = ")"; //$NON-NLS-1$
-  protected final String TEXT_17 = NL + "@TransactionManagement(TransactionManagementType.BEAN)"; //$NON-NLS-1$
-  protected final String TEXT_18 = NL + "public "; //$NON-NLS-1$
-  protected final String TEXT_19 = "abstract "; //$NON-NLS-1$
-  protected final String TEXT_20 = "final "; //$NON-NLS-1$
-  protected final String TEXT_21 = "class "; //$NON-NLS-1$
-  protected final String TEXT_22 = " extends "; //$NON-NLS-1$
-  protected final String TEXT_23 = " implements "; //$NON-NLS-1$
-  protected final String TEXT_24 = ", "; //$NON-NLS-1$
-  protected final String TEXT_25 = " {"; //$NON-NLS-1$
-  protected final String TEXT_26 = NL + NL + "    /**" + NL + "     * Default constructor. " + NL + "     */" + NL + "    public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-  protected final String TEXT_27 = "() {" + NL + "        // TODO Auto-generated constructor stub" + NL + "    }"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-  protected final String TEXT_28 = NL + "       " + NL + "    /**" + NL + "     * @see "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-  protected final String TEXT_29 = "#"; //$NON-NLS-1$
-  protected final String TEXT_30 = "("; //$NON-NLS-1$
-  protected final String TEXT_31 = ")" + NL + "     */" + NL + "    public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-  protected final String TEXT_32 = "("; //$NON-NLS-1$
-  protected final String TEXT_33 = ") {" + NL + "        super("; //$NON-NLS-1$ //$NON-NLS-2$
-  protected final String TEXT_34 = ");" + NL + "        // TODO Auto-generated constructor stub" + NL + "    }"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-  protected final String TEXT_35 = NL + NL + "\t/**" + NL + "     * @see "; //$NON-NLS-1$ //$NON-NLS-2$
-  protected final String TEXT_36 = "#"; //$NON-NLS-1$
-  protected final String TEXT_37 = "("; //$NON-NLS-1$
-  protected final String TEXT_38 = ")" + NL + "     */" + NL + "    public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-  protected final String TEXT_39 = " "; //$NON-NLS-1$
-  protected final String TEXT_40 = "("; //$NON-NLS-1$
-  protected final String TEXT_41 = ") {" + NL + "        // TODO Auto-generated method stub"; //$NON-NLS-1$ //$NON-NLS-2$
-  protected final String TEXT_42 = NL + "\t\t\treturn "; //$NON-NLS-1$
-  protected final String TEXT_43 = ";"; //$NON-NLS-1$
-  protected final String TEXT_44 = NL + "    }"; //$NON-NLS-1$
-  protected final String TEXT_45 = NL + "\t" + NL + "\t/**" + NL + "     * @see MessageListener#onMessage(Message)" + NL + "     */" + NL + "    public void onMessage(Message message) {" + NL + "        // TODO Auto-generated method stub" + NL + "        " + NL + "    }"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
-  protected final String TEXT_46 = NL + NL + "}"; //$NON-NLS-1$
-  protected final String TEXT_47 = NL;
+  protected final String TEXT_11 = NL + "\t\tactivationConfig = { "; //$NON-NLS-1$
+  protected final String TEXT_12 = ", "; //$NON-NLS-1$
+  protected final String TEXT_13 = "@ActivationConfigProperty(" + NL + "\t\t\t\tpropertyName = \""; //$NON-NLS-1$ //$NON-NLS-2$
+  protected final String TEXT_14 = "\", propertyValue = \""; //$NON-NLS-1$
+  protected final String TEXT_15 = "\")"; //$NON-NLS-1$
+  protected final String TEXT_16 = NL + "\t\t}"; //$NON-NLS-1$
+  protected final String TEXT_17 = ", "; //$NON-NLS-1$
+  protected final String TEXT_18 = NL + "\t\t"; //$NON-NLS-1$
+  protected final String TEXT_19 = " = "; //$NON-NLS-1$
+  protected final String TEXT_20 = ")"; //$NON-NLS-1$
+  protected final String TEXT_21 = NL + "@TransactionManagement(TransactionManagementType.BEAN)"; //$NON-NLS-1$
+  protected final String TEXT_22 = NL + "public "; //$NON-NLS-1$
+  protected final String TEXT_23 = "abstract "; //$NON-NLS-1$
+  protected final String TEXT_24 = "final "; //$NON-NLS-1$
+  protected final String TEXT_25 = "class "; //$NON-NLS-1$
+  protected final String TEXT_26 = " extends "; //$NON-NLS-1$
+  protected final String TEXT_27 = " implements "; //$NON-NLS-1$
+  protected final String TEXT_28 = ", "; //$NON-NLS-1$
+  protected final String TEXT_29 = " {"; //$NON-NLS-1$
+  protected final String TEXT_30 = NL + NL + "    /**" + NL + "     * Default constructor. " + NL + "     */" + NL + "    public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+  protected final String TEXT_31 = "() {" + NL + "        // TODO Auto-generated constructor stub" + NL + "    }"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+  protected final String TEXT_32 = NL + "       " + NL + "    /**" + NL + "     * @see "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+  protected final String TEXT_33 = "#"; //$NON-NLS-1$
+  protected final String TEXT_34 = "("; //$NON-NLS-1$
+  protected final String TEXT_35 = ")" + NL + "     */" + NL + "    public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+  protected final String TEXT_36 = "("; //$NON-NLS-1$
+  protected final String TEXT_37 = ") {" + NL + "        super("; //$NON-NLS-1$ //$NON-NLS-2$
+  protected final String TEXT_38 = ");" + NL + "        // TODO Auto-generated constructor stub" + NL + "    }"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+  protected final String TEXT_39 = NL + NL + "\t/**" + NL + "     * @see "; //$NON-NLS-1$ //$NON-NLS-2$
+  protected final String TEXT_40 = "#"; //$NON-NLS-1$
+  protected final String TEXT_41 = "("; //$NON-NLS-1$
+  protected final String TEXT_42 = ")" + NL + "     */" + NL + "    public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+  protected final String TEXT_43 = " "; //$NON-NLS-1$
+  protected final String TEXT_44 = "("; //$NON-NLS-1$
+  protected final String TEXT_45 = ") {" + NL + "        // TODO Auto-generated method stub"; //$NON-NLS-1$ //$NON-NLS-2$
+  protected final String TEXT_46 = NL + "\t\t\treturn "; //$NON-NLS-1$
+  protected final String TEXT_47 = ";"; //$NON-NLS-1$
+  protected final String TEXT_48 = NL + "    }"; //$NON-NLS-1$
+  protected final String TEXT_49 = NL + "\t" + NL + "\t/**" + NL + "     * @see MessageListener#onMessage(Message)" + NL + "     */" + NL + "    public void onMessage(Message message) {" + NL + "        // TODO Auto-generated method stub" + NL + "        " + NL + "    }"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
+  protected final String TEXT_50 = NL + NL + "}"; //$NON-NLS-1$
+  protected final String TEXT_51 = NL;
 
   public String generate(Object argument)
   {
@@ -105,79 +109,102 @@
     stringBuffer.append(model.getClassName());
     stringBuffer.append(TEXT_9);
     
-	Map<String, String> params = model.getClassAnnotationParams();
+	Map<String, Object> params = model.getClassAnnotationParams();
 	if (!params.isEmpty()) { 
 
     stringBuffer.append(TEXT_10);
     
-		Set<String> keys = params.keySet();
-		boolean needNewLine = keys.contains(CreateMessageDrivenBeanTemplateModel.ATT_ACTIVATION_CONFIG);
 		boolean needComma = false;
-		for (String key : keys) {
-			if (needComma) { 
+		boolean needNewLine = false;
+		Map<String, String> activationConfigProperties = (Map<String, String>) params.get(CreateMessageDrivenBeanTemplateModel.ATT_ACTIVATION_CONFIG);
+		if (activationConfigProperties.size() > 0) {
 
     stringBuffer.append(TEXT_11);
     
-				if (needNewLine) {
+			Set<String> props = activationConfigProperties.keySet();
+			for (String prop : props) {
+				if (needComma) {
 
     stringBuffer.append(TEXT_12);
     
-				} 
-			}
-			
-			String value = params.get(key);
-			if (key.equals(CreateMessageDrivenBeanTemplateModel.ATT_ACTIVATION_CONFIG)) {
+				}
+				
+				String value = activationConfigProperties.get(prop);
 
     stringBuffer.append(TEXT_13);
-    stringBuffer.append( value );
+    stringBuffer.append( prop );
     stringBuffer.append(TEXT_14);
+    stringBuffer.append( value );
+    stringBuffer.append(TEXT_15);
+    				
+				needComma = true;
+			}
+
+    stringBuffer.append(TEXT_16);
     
-			} else {
+			needNewLine = true;
+		}
+		
+		Set<String> keys = params.keySet();
+		for (String key : keys) {
+			Object obj = params.get(key);
+			if (obj instanceof String) {
+				if (needComma) { 
+
+    stringBuffer.append(TEXT_17);
+    
+					if (needNewLine) {
+
+    stringBuffer.append(TEXT_18);
+    
+					}
+				}
+				String value = (String) obj;
 
     stringBuffer.append( key );
-    stringBuffer.append(TEXT_15);
+    stringBuffer.append(TEXT_19);
     stringBuffer.append( value );
     
 			}
 			needComma = true;
 		} 
 
-    stringBuffer.append(TEXT_16);
+    stringBuffer.append(TEXT_20);
     
 	}
 	
 	if (!model.isContainerType()) {
 
-    stringBuffer.append(TEXT_17);
+    stringBuffer.append(TEXT_21);
     
 	}
 
     
 	if (model.isPublic()) { 
 
-    stringBuffer.append(TEXT_18);
+    stringBuffer.append(TEXT_22);
      
 	} 
 
 	if (model.isAbstract()) { 
 
-    stringBuffer.append(TEXT_19);
+    stringBuffer.append(TEXT_23);
     
 	}
 
 	if (model.isFinal()) {
 
-    stringBuffer.append(TEXT_20);
+    stringBuffer.append(TEXT_24);
     
 	}
 
-    stringBuffer.append(TEXT_21);
+    stringBuffer.append(TEXT_25);
     stringBuffer.append( model.getClassName() );
     
 	String superClass = model.getSuperclassName();
  	if (superClass != null && superClass.length() > 0) {
 
-    stringBuffer.append(TEXT_22);
+    stringBuffer.append(TEXT_26);
     stringBuffer.append( superClass );
     
 	}
@@ -185,7 +212,7 @@
 	List<String> interfaces = model.getInterfaces(); 
  	if ( interfaces.size() > 0) { 
 
-    stringBuffer.append(TEXT_23);
+    stringBuffer.append(TEXT_27);
     
 	}
 	
@@ -193,7 +220,7 @@
    		String INTERFACE = interfaces.get(i);
    		if (i > 0) {
 
-    stringBuffer.append(TEXT_24);
+    stringBuffer.append(TEXT_28);
     
 		}
 
@@ -201,13 +228,13 @@
     
 	}
 
-    stringBuffer.append(TEXT_25);
+    stringBuffer.append(TEXT_29);
      
 	if (!model.hasEmptySuperclassConstructor()) { 
 
-    stringBuffer.append(TEXT_26);
+    stringBuffer.append(TEXT_30);
     stringBuffer.append( model.getClassName() );
-    stringBuffer.append(TEXT_27);
+    stringBuffer.append(TEXT_31);
      
 	} 
 
@@ -216,19 +243,19 @@
 		for (Constructor constructor : constructors) {
 			if (constructor.isPublic() || constructor.isProtected()) { 
 
-    stringBuffer.append(TEXT_28);
-    stringBuffer.append( model.getSuperclassName() );
-    stringBuffer.append(TEXT_29);
-    stringBuffer.append( model.getSuperclassName() );
-    stringBuffer.append(TEXT_30);
-    stringBuffer.append( constructor.getParamsForJavadoc() );
-    stringBuffer.append(TEXT_31);
-    stringBuffer.append( model.getClassName() );
     stringBuffer.append(TEXT_32);
-    stringBuffer.append( constructor.getParamsForDeclaration() );
+    stringBuffer.append( model.getSuperclassName() );
     stringBuffer.append(TEXT_33);
-    stringBuffer.append( constructor.getParamsForCall() );
+    stringBuffer.append( model.getSuperclassName() );
     stringBuffer.append(TEXT_34);
+    stringBuffer.append( constructor.getParamsForJavadoc() );
+    stringBuffer.append(TEXT_35);
+    stringBuffer.append( model.getClassName() );
+    stringBuffer.append(TEXT_36);
+    stringBuffer.append( constructor.getParamsForDeclaration() );
+    stringBuffer.append(TEXT_37);
+    stringBuffer.append( constructor.getParamsForCall() );
+    stringBuffer.append(TEXT_38);
     
 			} 
 		} 
@@ -238,30 +265,30 @@
 	if (model.shouldImplementAbstractMethods()) {
 		for (Method method : model.getUnimplementedMethods()) { 
 
-    stringBuffer.append(TEXT_35);
-    stringBuffer.append( method.getContainingJavaClass() );
-    stringBuffer.append(TEXT_36);
-    stringBuffer.append( method.getName() );
-    stringBuffer.append(TEXT_37);
-    stringBuffer.append( method.getParamsForJavadoc() );
-    stringBuffer.append(TEXT_38);
-    stringBuffer.append( method.getReturnType() );
     stringBuffer.append(TEXT_39);
-    stringBuffer.append( method.getName() );
+    stringBuffer.append( method.getContainingJavaClass() );
     stringBuffer.append(TEXT_40);
-    stringBuffer.append( method.getParamsForDeclaration() );
+    stringBuffer.append( method.getName() );
     stringBuffer.append(TEXT_41);
+    stringBuffer.append( method.getParamsForJavadoc() );
+    stringBuffer.append(TEXT_42);
+    stringBuffer.append( method.getReturnType() );
+    stringBuffer.append(TEXT_43);
+    stringBuffer.append( method.getName() );
+    stringBuffer.append(TEXT_44);
+    stringBuffer.append( method.getParamsForDeclaration() );
+    stringBuffer.append(TEXT_45);
      
 			String defaultReturnValue = method.getDefaultReturnValue();
 			if (defaultReturnValue != null) { 
 
-    stringBuffer.append(TEXT_42);
+    stringBuffer.append(TEXT_46);
     stringBuffer.append( defaultReturnValue );
-    stringBuffer.append(TEXT_43);
+    stringBuffer.append(TEXT_47);
     
 			} 
 
-    stringBuffer.append(TEXT_44);
+    stringBuffer.append(TEXT_48);
      
 		}
 	} 
@@ -269,12 +296,14 @@
     
 	if (model.shouldImplementAbstractMethods()) {
 		if (model.isJMS()) { 
-			stringBuffer.append(TEXT_45);
+
+    stringBuffer.append(TEXT_49);
+    
 		}
 	}
 
-    stringBuffer.append(TEXT_46);
-    stringBuffer.append(TEXT_47);
+    stringBuffer.append(TEXT_50);
+    stringBuffer.append(TEXT_51);
     return stringBuffer.toString();
   }
 }
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/templates/_class.template b/plugins/org.eclipse.jst.j2ee.ejb/templates/_class.template
index 4248810..17fc58a 100644
--- a/plugins/org.eclipse.jst.j2ee.ejb/templates/_class.template
+++ b/plugins/org.eclipse.jst.j2ee.ejb/templates/_class.template
@@ -29,7 +29,7 @@
 	}
 	
  	for (int i = 0; i < interfaces.size(); i++) {
-   		String INTERFACE = (String) interfaces.get(i);
+   		String INTERFACE = interfaces.get(i);
    		if (i > 0) {
 %>, 
 <%
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/templates/messageDrivenBean_classHeader.template b/plugins/org.eclipse.jst.j2ee.ejb/templates/messageDrivenBean_classHeader.template
index cb3c33b..ef7117d 100644
--- a/plugins/org.eclipse.jst.j2ee.ejb/templates/messageDrivenBean_classHeader.template
+++ b/plugins/org.eclipse.jst.j2ee.ejb/templates/messageDrivenBean_classHeader.template
@@ -3,32 +3,50 @@
  */
 @MessageDriven
 <%
-	Map<String, String> params = model.getClassAnnotationParams();
+	Map<String, Object> params = model.getClassAnnotationParams();
 	if (!params.isEmpty()) { 
 %>(
 <%
-		Set<String> keys = params.keySet();
-		boolean needNewLine = keys.contains(CreateMessageDrivenBeanTemplateModel.ATT_ACTIVATION_CONFIG);
 		boolean needComma = false;
-		for (String key : keys) {
-			if (needComma) { 
+		boolean needNewLine = false;
+		Map<String, String> activationConfigProperties = (Map<String, String>) params.get(CreateMessageDrivenBeanTemplateModel.ATT_ACTIVATION_CONFIG);
+		if (activationConfigProperties.size() > 0) {
+%>
+		activationConfig = { 
+<%
+			Set<String> props = activationConfigProperties.keySet();
+			for (String prop : props) {
+				if (needComma) {
 %>, 
 <%
-				if (needNewLine) {
+				}
+				
+				String value = activationConfigProperties.get(prop);
+%>@ActivationConfigProperty(
+				propertyName = "<%= prop %>", propertyValue = "<%= value %>")
+<%				
+				needComma = true;
+			}
+%>
+		}
+<%
+			needNewLine = true;
+		}
+		
+		Set<String> keys = params.keySet();
+		for (String key : keys) {
+			Object obj = params.get(key);
+			if (obj instanceof String) {
+				if (needComma) { 
+%>, 
+<%
+					if (needNewLine) {
 %>
 		
 <%
-				} 
-			}
-			
-			String value = params.get(key);
-			if (key.equals(CreateMessageDrivenBeanTemplateModel.ATT_ACTIVATION_CONFIG)) {
-%>
-		activationConfig = { @ActivationConfigProperty(
-				propertyName = "destinationType", propertyValue = "<%= value %>"
-		) }
-<%
-			} else {
+					}
+				}
+				String value = (String) obj;
 %><%= key %> = <%= value %>
 <%
 			}