[jboss-cvs] JBoss Messaging SVN: r7591 - in trunk: src/main/org/jboss/messaging/core/client/management/impl and 6 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Jul 20 05:28:18 EDT 2009
Author: jmesnil
Date: 2009-07-20 05:28:16 -0400 (Mon, 20 Jul 2009)
New Revision: 7591
Added:
trunk/src/main/org/jboss/messaging/jms/server/management/DestinationControl.java
Removed:
trunk/src/main/org/jboss/messaging/jms/server/management/DestinationControlMBean.java
Modified:
trunk/docs/user-manual/en/management.xml
trunk/src/main/org/jboss/messaging/core/client/management/impl/ManagementHelper.java
trunk/src/main/org/jboss/messaging/core/management/MessagingServerControl.java
trunk/src/main/org/jboss/messaging/core/management/Parameter.java
trunk/src/main/org/jboss/messaging/core/management/QueueControl.java
trunk/src/main/org/jboss/messaging/jms/server/management/JMSQueueControl.java
trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControl.java
trunk/src/main/org/jboss/messaging/jms/server/management/TopicControl.java
trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControlImpl.java
trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareJMSServerControlWrapper.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/ManagementHelperTest.java
Log:
JBMESSAGING-1605: management API needs a portable and complete serialization format
* added createConnectionFactory methods in JMSServerControl using comma-separated list of key=value instead of Map<String, Object> data structure for parameters
* updated documentation
* added @Operation annotation to all management operations usable from a GUI console
Modified: trunk/docs/user-manual/en/management.xml
===================================================================
--- trunk/docs/user-manual/en/management.xml 2009-07-20 09:08:08 UTC (rev 7590)
+++ trunk/docs/user-manual/en/management.xml 2009-07-20 09:28:16 UTC (rev 7591)
@@ -290,7 +290,15 @@
<para>JMS connection factories can be created or destroyed using the <literal
>createConnectionFactory()</literal> methods or <literal
>destroyConnectionFactory()</literal> methods. These connection factories
- are bound to JNDI so that JMS clients can look them up</para>
+ are bound to JNDI so that JMS clients can look them up.
+ If a graphical console is used to create the connection factories, the
+ transport parameters are specified in the text fied input as a comma-separated
+ list of key=value
+ (e.g. <literal>key1=10, key2="value", key3=false</literal>). If there are multiple
+ transports defined, you need to enclose the key/value pairs between curly braces.
+ For example <literal>{key=10}, {key=20}</literal>. In that case, the first
+ <literal>key</literal> will be associated to the first transport configuration and the
+ second <literal>key</literal> will be associated to the second transport configuration.</para>
</listitem>
<listitem>
<para>Creating/destroying queues</para>
Modified: trunk/src/main/org/jboss/messaging/core/client/management/impl/ManagementHelper.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/management/impl/ManagementHelper.java 2009-07-20 09:08:08 UTC (rev 7590)
+++ trunk/src/main/org/jboss/messaging/core/client/management/impl/ManagementHelper.java 2009-07-20 09:28:16 UTC (rev 7591)
@@ -21,6 +21,7 @@
package org.jboss.messaging.core.client.management.impl;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@@ -363,6 +364,37 @@
return false;
}
+ public static Map<String, Object> fromCommaSeparatedKeyValues(final String str) throws Exception
+ {
+ if (str == null || str.trim().length() == 0)
+ {
+ return Collections.emptyMap();
+ }
+
+ // create a JSON array with 1 object:
+ JSONArray array = new JSONArray("[{" + str + "}]");
+ Map<String, Object> params = (Map<String, Object>)fromJSONArray(array)[0];
+ return params;
+ }
+
+ public static Object[] fromCommaSeparatedArrayOfCommaSeparatedKeyValues(final String str) throws Exception
+ {
+ if (str == null || str.trim().length() == 0)
+ {
+ return new Object[0];
+ }
+
+ String s = str;
+
+ // if there is a single item, we wrap it in {Ê}Êto make it a JSON object
+ if (!s.trim().startsWith("{"))
+ {
+ s = "{" + s + "}";
+ }
+ JSONArray array = new JSONArray("[" + s + "]");
+ return fromJSONArray(array);
+ }
+
// Constructors --------------------------------------------------
// Public --------------------------------------------------------
Modified: trunk/src/main/org/jboss/messaging/core/management/MessagingServerControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/MessagingServerControl.java 2009-07-20 09:08:08 UTC (rev 7590)
+++ trunk/src/main/org/jboss/messaging/core/management/MessagingServerControl.java 2009-07-20 09:28:16 UTC (rev 7591)
@@ -156,12 +156,16 @@
@Operation(desc = "Destroy a queue", impact = ACTION)
void destroyQueue(@Parameter(name = "name", desc = "Name of the queue to destroy") String name) throws Exception;
+ @Operation(desc = "Enable message counters", impact = ACTION)
void enableMessageCounters() throws Exception;
+ @Operation(desc = "Disable message counters", impact = ACTION)
void disableMessageCounters() throws Exception;
+ @Operation(desc = "Reset all message counters", impact = ACTION)
void resetAllMessageCounters() throws Exception;
+ @Operation(desc = "Reset all message counters history", impact = ACTION)
void resetAllMessageCounterHistories() throws Exception;
@Operation(desc = "List all the prepared transaction, sorted by date, oldest first")
Modified: trunk/src/main/org/jboss/messaging/core/management/Parameter.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/Parameter.java 2009-07-20 09:08:08 UTC (rev 7590)
+++ trunk/src/main/org/jboss/messaging/core/management/Parameter.java 2009-07-20 09:28:16 UTC (rev 7591)
@@ -39,5 +39,5 @@
@Target(ElementType.PARAMETER)
public @interface Parameter {
String name();
- String desc();
+ String desc() default "N/A";
}
Modified: trunk/src/main/org/jboss/messaging/core/management/QueueControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/QueueControl.java 2009-07-20 09:08:08 UTC (rev 7590)
+++ trunk/src/main/org/jboss/messaging/core/management/QueueControl.java 2009-07-20 09:28:16 UTC (rev 7591)
@@ -115,16 +115,22 @@
boolean changeMessagePriority(@Parameter(name = "messageID", desc = "A message ID") long messageID,
@Parameter(name = "newPriority", desc = "the new priority (between 0 and 9)") int newPriority) throws Exception;
- int changeMessagesPriority(String filter, int newPriority) throws Exception;
+ @Operation(desc = "Change the priority of the messages corresponding to the given filter", impact = ACTION)
+ int changeMessagesPriority(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter,
+ @Parameter(name = "newPriority", desc = "the new priority (between 0 and 9)") int newPriority) throws Exception;
+ @Operation(desc = "List the message counters", impact = INFO)
String listMessageCounter() throws Exception;
+ @Operation(desc = "Reset the message counters", impact = INFO)
void resetMessageCounter() throws Exception;
+ @Operation(desc = "List the message counters as HTML", impact = INFO)
String listMessageCounterAsHTML() throws Exception;
+ @Operation(desc = "List the message counters history", impact = INFO)
String listMessageCounterHistory() throws Exception;
+ @Operation(desc = "List the message counters history HTML", impact = INFO)
String listMessageCounterHistoryAsHTML() throws Exception;
-
}
Copied: trunk/src/main/org/jboss/messaging/jms/server/management/DestinationControl.java (from rev 7582, trunk/src/main/org/jboss/messaging/jms/server/management/DestinationControlMBean.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/DestinationControl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/DestinationControl.java 2009-07-20 09:28:16 UTC (rev 7591)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.messaging.jms.server.management;
+
+import static javax.management.MBeanOperationInfo.ACTION;
+
+import org.jboss.messaging.core.management.Operation;
+import org.jboss.messaging.core.management.Parameter;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public interface DestinationControl
+{
+ // Attributes ----------------------------------------------------
+
+ String getName();
+
+ String getJNDIBinding();
+
+ String getAddress();
+
+ boolean isTemporary();
+
+ int getMessageCount() throws Exception;
+
+ // Operations ----------------------------------------------------
+
+ @Operation(desc = "Remove messages matching the given filter from the destination", impact = ACTION)
+ int removeMessages(@Parameter(name = "filter", desc = "A JMS message filter (can be empty)") String filter) throws Exception;
+
+}
\ No newline at end of file
Deleted: trunk/src/main/org/jboss/messaging/jms/server/management/DestinationControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/DestinationControlMBean.java 2009-07-20 09:08:08 UTC (rev 7590)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/DestinationControlMBean.java 2009-07-20 09:28:16 UTC (rev 7591)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.messaging.jms.server.management;
-
-import static javax.management.MBeanOperationInfo.ACTION;
-
-import org.jboss.messaging.core.management.Operation;
-import org.jboss.messaging.core.management.Parameter;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public interface DestinationControlMBean
-{
- // Attributes ----------------------------------------------------
-
- String getName();
-
- String getJNDIBinding();
-
- String getAddress();
-
- boolean isTemporary();
-
- int getMessageCount() throws Exception;
-
- // Operations ----------------------------------------------------
-
- @Operation(desc = "Remove messages from the destination", impact = ACTION)
- int removeMessages(@Parameter(name = "filter", desc = "A JMS message filter (can be empty)") String filter) throws Exception;
-
-}
\ No newline at end of file
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/JMSQueueControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/JMSQueueControl.java 2009-07-20 09:08:08 UTC (rev 7590)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/JMSQueueControl.java 2009-07-20 09:28:16 UTC (rev 7591)
@@ -36,7 +36,7 @@
* @version <tt>$Revision$</tt>
*
*/
-public interface JMSQueueControl extends DestinationControlMBean
+public interface JMSQueueControl extends DestinationControl
{
// Attributes ----------------------------------------------------
@@ -102,12 +102,16 @@
int moveMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter,
@Parameter(name = "otherQueueName", desc = "The name of the queue to move the messages to") String otherQueueName) throws Exception;
+ @Operation(desc = "List the message counters", impact = INFO)
String listMessageCounter() throws Exception;
+ @Operation(desc = "List the message counters as HTML", impact = INFO)
String listMessageCounterAsHTML() throws Exception;
+ @Operation(desc = "List the message counters history", impact = INFO)
String listMessageCounterHistory() throws Exception;
+ @Operation(desc = "List the message counters history as HTML", impact = INFO)
String listMessageCounterHistoryAsHTML() throws Exception;
}
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControl.java 2009-07-20 09:08:08 UTC (rev 7590)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControl.java 2009-07-20 09:28:16 UTC (rev 7591)
@@ -68,6 +68,14 @@
Object[] backupConnectorTransportParams,
Object[] bindings) throws Exception;
+ @Operation(desc = "Create a JMS ConnectionFactory", impact = ACTION)
+ void createConnectionFactory(@Parameter(name = "name") String name,
+ @Parameter(name = "liveTransportClassNames", desc = "comma-separated list of class names for transport to live servers") String liveTransportClassNames,
+ @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value parameters for the live transports (enclosed between { } for each transport)") String liveTransportParams,
+ @Parameter(name = "backupTransportClassNames", desc = "comma-separated list of class names for transport to backup servers") String backupTransportClassNames,
+ @Parameter(name = "backupTransportParams", desc = "comma-separated list of key=value parameters for the backup transports (enclosed between { } for each transport)") String backupTransportParams,
+ @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+
void createConnectionFactory(String name,
Object[] liveConnectorsTransportClassNames,
Object[] liveConnectorTransportParams,
@@ -76,6 +84,15 @@
String clientID,
Object[] jndiBindings) throws Exception;
+ @Operation(desc = "Create a JMS ConnectionFactory", impact = ACTION)
+ void createConnectionFactory(@Parameter(name = "name") String name,
+ @Parameter(name = "liveTransportClassNames", desc = "comma-separated list of class names for transport to live servers") String liveTransportClassNames,
+ @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value parameters for the live transports (enclosed between { } for each transport)") String liveTransportParams,
+ @Parameter(name = "backupTransportClassNames", desc = "comma-separated list of class names for transport to backup servers") String backupTransportClassNames,
+ @Parameter(name = "backupTransportParams", desc = "comma-separated list of key=value parameters for the backup transports (enclosed between { } for each transport)") String backupTransportParams,
+ @Parameter(name = "clientID") String clientID,
+ @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+
void createConnectionFactory(String name,
Object[] liveConnectorsTransportClassNames,
Object[] liveConnectorTransportParams,
@@ -108,12 +125,51 @@
boolean failoverOnServerShutdown,
Object[] jndiBindings) throws Exception;
+ void createConnectionFactory(@Parameter(name = "name") String name,
+ @Parameter(name = "liveTransportClassNames", desc = "comma-separated list of class names for transport to live servers") String liveTransportClassNames,
+ @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value parameters for the live transports (enclosed between { } for each transport)") String liveTransportParams,
+ @Parameter(name = "backupTransportClassNames", desc = "comma-separated list of class names for transport to backup servers") String backupTransportClassNames,
+ @Parameter(name = "backupTransportParams", desc = "comma-separated list of key=value parameters for the backup transports (enclosed between { } for each transport)") String backupTransportParams,
+ @Parameter(name = "clientID") String clientID,
+ @Parameter(name = "clientFailureCheckPeriod") long clientFailureCheckPeriod,
+ @Parameter(name = "connectionTTL") long connectionTTL,
+ @Parameter(name = "callTimeout") long callTimeout,
+ @Parameter(name = "maxConnections") int maxConnections,
+ @Parameter(name = "minLargeMessageSize") int minLargeMessageSize,
+ @Parameter(name = "consumerWindowSize") int consumerWindowSize,
+ @Parameter(name = "consumerMaxRate") int consumerMaxRate,
+ @Parameter(name = "producerWindowSize") int producerWindowSize,
+ @Parameter(name = "producerMaxRate") int producerMaxRate,
+ @Parameter(name = "blockOnAcknowledge") boolean blockOnAcknowledge,
+ @Parameter(name = "blockOnPersistentSend") boolean blockOnPersistentSend,
+ @Parameter(name = "blockOnNonPersistentSend") boolean blockOnNonPersistentSend,
+ @Parameter(name = "autoGroup") boolean autoGroup,
+ @Parameter(name = "preAcknowledge") boolean preAcknowledge,
+ @Parameter(name = "loadBalancingPolicyClassName") String loadBalancingPolicyClassName,
+ @Parameter(name = "transactionBatchSize") int transactionBatchSize,
+ @Parameter(name = "dupsOKBatchSize") int dupsOKBatchSize,
+ @Parameter(name = "useGlobalPools") boolean useGlobalPools,
+ @Parameter(name = "scheduledThreadPoolMaxSize") int scheduledThreadPoolMaxSize,
+ @Parameter(name = "threadPoolMaxSize") int threadPoolMaxSize,
+ @Parameter(name = "retryInterval") long retryInterval,
+ @Parameter(name = "retryIntervalMultiplier") double retryIntervalMultiplier,
+ @Parameter(name = "reconnectAttempts") int reconnectAttempts,
+ @Parameter(name = "failoverOnServerShutdown") boolean failoverOnServerShutdown,
+ @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+
void createConnectionFactory(String name,
String discoveryAddress,
int discoveryPort,
String clientID,
Object[] bindings) throws Exception;
+ @Operation(desc = "Create a JMS ConnectionFactory", impact = ACTION)
+ void createConnectionFactory(@Parameter(name = "name") String name,
+ @Parameter(name = "discoveryAddress") String discoveryAddress,
+ @Parameter(name = "discoveryPort") int discoveryPort,
+ @Parameter(name = "clientID") String clientID,
+ @Parameter(name = "jndiBindings") String jndiBindings) throws Exception;
+
void createConnectionFactory(String name,
String discoveryAddress,
int discoveryPort,
@@ -146,17 +202,63 @@
boolean failoverOnServerShutdown,
Object[] jndiBindings) throws Exception;
+ @Operation(desc = "Create a JMS ConnectionFactory", impact = ACTION)
+ void createConnectionFactory(@Parameter(name = "name") String name,
+ @Parameter(name = "discoveryAddress") String discoveryAddress,
+ @Parameter(name = "discoveryPort") int discoveryPort,
+ @Parameter(name = "clientID") String clientID,
+ @Parameter(name = "discoveryRefreshTimeout") long discoveryRefreshTimeout,
+ @Parameter(name = "clientFailureCheckPeriod") long clientFailureCheckPeriod,
+ @Parameter(name = "connectionTTL") long connectionTTL,
+ @Parameter(name = "callTimeout") long callTimeout,
+ @Parameter(name = "maxConnections") int maxConnections,
+ @Parameter(name = "minLargeMessageSize") int minLargeMessageSize,
+ @Parameter(name = "consumerWindowSize") int consumerWindowSize,
+ @Parameter(name = "consumerMaxRate") int consumerMaxRate,
+ @Parameter(name = "producerWindowSize") int producerWindowSize,
+ @Parameter(name = "producerMaxRate") int producerMaxRate,
+ @Parameter(name = "blockOnAcknowledge") boolean blockOnAcknowledge,
+ @Parameter(name = "blockOnPersistentSend") boolean blockOnPersistentSend,
+ @Parameter(name = "blockOnNonPersistentSend") boolean blockOnNonPersistentSend,
+ @Parameter(name = "autoGroup") boolean autoGroup,
+ @Parameter(name = "preAcknowledge") boolean preAcknowledge,
+ @Parameter(name = "loadBalancingPolicyClassName") String loadBalancingPolicyClassName,
+ @Parameter(name = "transactionBatchSize") int transactionBatchSize,
+ @Parameter(name = "dupsOKBatchSize") int dupsOKBatchSize,
+ @Parameter(name = "initialWaitTimeout") long initialWaitTimeout,
+ @Parameter(name = "useGlobalPools") boolean useGlobalPools,
+ @Parameter(name = "scheduledThreadPoolMaxSize") int scheduledThreadPoolMaxSize,
+ @Parameter(name = "threadPoolMaxSize") int threadPoolMaxSize,
+ @Parameter(name = "retryInterval") long retryInterval,
+ @Parameter(name = "retryIntervalMultiplier") double retryIntervalMultiplier,
+ @Parameter(name = "reconnectAttempts") int reconnectAttempts,
+ @Parameter(name = "failoverOnServerShutdown") boolean failoverOnServerShutdown,
+ @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+
void createConnectionFactory(String name,
String liveTransportClassName,
Map<String, Object> liveTransportParams,
Object[] jndiBindings) throws Exception;
+ @Operation(desc = "Create a JMS ConnectionFactory", impact = ACTION)
+ void createConnectionFactory(@Parameter(name = "name") String name,
+ @Parameter(name = "liveTransportClassName") String liveTransportClassName,
+ @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value for the transport parameters") String liveTransportParams,
+ @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+
void createConnectionFactory(String name,
String liveTransportClassName,
Map<String, Object> liveTransportParams,
String clientID,
Object[] jndiBindings) throws Exception;
+ @Operation(desc = "Create a JMS ConnectionFactory", impact = ACTION)
+ void createConnectionFactory(@Parameter(name = "name") String name,
+ @Parameter(name = "liveTransportClassName") String liveTransportClassName,
+ @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value for the transport parameters") String liveTransportParams,
+ @Parameter(name = "clientID") String clientID,
+ @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+
void createConnectionFactory(String name,
String liveTransportClassName,
Map<String, Object> liveTransportParams,
@@ -172,8 +274,8 @@
String clientID,
Object[] jndiBindings) throws Exception;
- @Operation(desc = "Create a JMS ConnectionFactory", impact = ACTION)
- void destroyConnectionFactory(@Parameter(name = "name", desc = "Name of the ConnectionFactory to create") String name) throws Exception;
+ @Operation(desc = "Destroy a JMS ConnectionFactory", impact = ACTION)
+ void destroyConnectionFactory(@Parameter(name = "name", desc = "Name of the ConnectionFactory to destroy") String name) throws Exception;
@Operation(desc = "List the client addresses", impact = INFO)
String[] listRemoteAddresses() throws Exception;
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/TopicControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/TopicControl.java 2009-07-20 09:08:08 UTC (rev 7590)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/TopicControl.java 2009-07-20 09:28:16 UTC (rev 7591)
@@ -35,7 +35,7 @@
* @version <tt>$Revision$</tt>
*
*/
-public interface TopicControl extends DestinationControlMBean
+public interface TopicControl extends DestinationControl
{
// Attributes ----------------------------------------------------
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControlImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControlImpl.java 2009-07-20 09:08:08 UTC (rev 7590)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControlImpl.java 2009-07-20 09:28:16 UTC (rev 7591)
@@ -35,6 +35,7 @@
import javax.management.NotificationFilter;
import javax.management.NotificationListener;
+import org.jboss.messaging.core.client.management.impl.ManagementHelper;
import org.jboss.messaging.core.config.TransportConfiguration;
import org.jboss.messaging.jms.server.JMSServerManager;
import org.jboss.messaging.jms.server.management.JMSServerControl;
@@ -62,16 +63,69 @@
// Static --------------------------------------------------------
- private static List<String> convert(Object[] jndiBindings)
+ private static List<String> convert(final Object[] jndiBindings)
{
List<String> bindings = new ArrayList<String>();
for (Object object : jndiBindings)
{
- bindings.add(object.toString());
+ bindings.add(object.toString().trim());
}
return bindings;
}
+ private static String[] toArray(String commaSeparatedString)
+ {
+ if (commaSeparatedString == null || commaSeparatedString.trim().length() == 0)
+ {
+ return new String[0];
+ }
+ String[] values = commaSeparatedString.split(",");
+ String[] trimmed = new String[values.length];
+ for (int i = 0; i < values.length; i++)
+ {
+ trimmed[i] = values[i].trim();
+ }
+ return trimmed;
+ }
+
+ private static List<Pair<TransportConfiguration, TransportConfiguration>> convertToConnectorPairs(final Object[] liveConnectorsTransportClassNames,
+ final Object[] liveConnectorTransportParams,
+ final Object[] backupConnectorsTransportClassNames,
+ final Object[] backupConnectorTransportParams)
+ {
+ List<Pair<TransportConfiguration, TransportConfiguration>> pairs = new ArrayList<Pair<TransportConfiguration, TransportConfiguration>>();
+
+ for (int i = 0; i < liveConnectorsTransportClassNames.length; i++)
+ {
+ Map<String, Object> liveParams = null;
+ if (liveConnectorTransportParams.length > i)
+ {
+ liveParams = (Map<String, Object>)liveConnectorTransportParams[i];
+ }
+
+ TransportConfiguration tcLive = new TransportConfiguration(liveConnectorsTransportClassNames[i].toString(),
+ liveParams);
+
+ Map<String, Object> backupParams = null;
+ if (backupConnectorTransportParams.length > i)
+ {
+ backupParams = (Map<String, Object>)backupConnectorTransportParams[i];
+ }
+
+ TransportConfiguration tcBackup = null;
+ if (backupConnectorsTransportClassNames.length > i)
+ {
+ new TransportConfiguration(backupConnectorsTransportClassNames[i].toString(), backupParams);
+ }
+ Pair<TransportConfiguration, TransportConfiguration> pair = new Pair<TransportConfiguration, TransportConfiguration>(tcLive,
+ tcBackup);
+
+ pairs.add(pair);
+ }
+
+ return pairs;
+ }
+
// Constructors --------------------------------------------------
public JMSServerControlImpl(final JMSServerManager server)
@@ -95,47 +149,26 @@
liveConnectorTransportParams,
backupConnectorsTransportClassNames,
backupConnectorTransportParams);
+ List<String> jndiBindingsList = convert(jndiBindings);
- List<String> jndiBindingsList = convert(jndiBindings);
-
server.createConnectionFactory(name, pairs, jndiBindingsList);
sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
}
- private List<Pair<TransportConfiguration, TransportConfiguration>> convertToConnectorPairs(final Object[] liveConnectorsTransportClassNames,
- final Object[] liveConnectorTransportParams,
- final Object[] backupConnectorsTransportClassNames,
- final Object[] backupConnectorTransportParams)
+ public void createConnectionFactory(final String name,
+ final String liveTransportClassNames,
+ final String liveTransportParams,
+ final String backupTransportClassNames,
+ final String backupTransportParams,
+ final String jndiBindings) throws Exception
{
- List<Pair<TransportConfiguration, TransportConfiguration>> pairs = new ArrayList<Pair<TransportConfiguration, TransportConfiguration>>();
-
- for (int i = 0; i < liveConnectorsTransportClassNames.length; i++)
- {
- Map<String, Object>[] liveParams = new Map[liveConnectorTransportParams.length];
- for (int j = 0; j < liveConnectorTransportParams.length; j++)
- {
- liveParams[i] = (Map<String, Object>)liveConnectorTransportParams[j];
- }
-
- TransportConfiguration tcLive = new TransportConfiguration(liveConnectorsTransportClassNames[i].toString(),
- liveParams[i]);
-
- Map<String, Object>[] backupParams = new Map[backupConnectorTransportParams.length];
- for (int j = 0; j < backupConnectorTransportParams.length; j++)
- {
- backupParams[i] = (Map<String, Object>)backupConnectorTransportParams[j];
- }
-
- TransportConfiguration tcBackup = new TransportConfiguration(backupConnectorsTransportClassNames[i].toString(),
- backupParams[i]);
- Pair<TransportConfiguration, TransportConfiguration> pair = new Pair<TransportConfiguration, TransportConfiguration>(tcLive,
- tcBackup);
-
- pairs.add(pair);
- }
-
- return pairs;
+ Object[] liveClassNames = toArray(liveTransportClassNames);
+ Object[] liveParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(liveTransportParams);
+ Object[] backupClassNames = toArray(backupTransportClassNames);
+ Object[] backupParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(backupTransportParams);;
+ Object[] bindings = toArray(jndiBindings);
+ createConnectionFactory(name, liveClassNames, liveParams, backupClassNames, backupParams, bindings);
}
public void createConnectionFactory(final String name,
@@ -152,12 +185,29 @@
backupConnectorTransportParams);
List<String> jndiBindingsList = convert(jndiBindings);
-
+
server.createConnectionFactory(name, pairs, clientID, jndiBindingsList);
sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
}
+ public void createConnectionFactory(String name,
+ String liveTransportClassNames,
+ String liveTransportParams,
+ String backupTransportClassNames,
+ String backupTransportParams,
+ String clientID,
+ String jndiBindings) throws Exception
+ {
+ Object[] liveClassNames = toArray(liveTransportClassNames);
+ Object[] liveParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(liveTransportParams);
+ Object[] backupClassNames = toArray(backupTransportClassNames);
+ Object[] backupParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(backupTransportParams);;
+ Object[] bindings = toArray(jndiBindings);
+
+ createConnectionFactory(name, liveClassNames, liveParams, backupClassNames, backupParams, clientID, bindings);
+ }
+
public void createConnectionFactory(final String name,
final Object[] liveConnectorsTransportClassNames,
final Object[] liveConnectorTransportParams,
@@ -196,7 +246,7 @@
backupConnectorTransportParams);
List<String> jndiBindingsList = convert(jndiBindings);
-
+
server.createConnectionFactory(name,
pairs,
clientID,
@@ -230,18 +280,100 @@
}
public void createConnectionFactory(final String name,
+ final String liveTransportClassNames,
+ final String liveTransportParams,
+ final String backupTransportClassNames,
+ final String backupTransportParams,
+ final String clientID,
+ final long clientFailureCheckPeriod,
+ final long connectionTTL,
+ final long callTimeout,
+ final int maxConnections,
+ final int minLargeMessageSize,
+ final int consumerWindowSize,
+ final int consumerMaxRate,
+ final int producerWindowSize,
+ final int producerMaxRate,
+ final boolean blockOnAcknowledge,
+ final boolean blockOnPersistentSend,
+ final boolean blockOnNonPersistentSend,
+ final boolean autoGroup,
+ final boolean preAcknowledge,
+ final String loadBalancingPolicyClassName,
+ final int transactionBatchSize,
+ final int dupsOKBatchSize,
+ final boolean useGlobalPools,
+ final int scheduledThreadPoolMaxSize,
+ final int threadPoolMaxSize,
+ final long retryInterval,
+ final double retryIntervalMultiplier,
+ final int reconnectAttempts,
+ final boolean failoverOnServerShutdown,
+ final String jndiBindings) throws Exception
+ {
+ Object[] liveClassNames = toArray(liveTransportClassNames);
+ Object[] liveParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(liveTransportParams);
+ Object[] backupClassNames = toArray(backupTransportClassNames);
+ Object[] backupParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(backupTransportParams);
+ Object[] bindings = toArray(jndiBindings);
+
+ createConnectionFactory(name,
+ liveClassNames,
+ liveParams,
+ backupClassNames,
+ backupParams,
+ clientID,
+ clientFailureCheckPeriod,
+ connectionTTL,
+ callTimeout,
+ maxConnections,
+ minLargeMessageSize,
+ consumerWindowSize,
+ consumerMaxRate,
+ producerWindowSize,
+ producerMaxRate,
+ blockOnAcknowledge,
+ blockOnPersistentSend,
+ blockOnNonPersistentSend,
+ autoGroup,
+ preAcknowledge,
+ loadBalancingPolicyClassName,
+ transactionBatchSize,
+ dupsOKBatchSize,
+ useGlobalPools,
+ scheduledThreadPoolMaxSize,
+ threadPoolMaxSize,
+ retryInterval,
+ retryIntervalMultiplier,
+ reconnectAttempts,
+ failoverOnServerShutdown,
+ bindings);
+ }
+
+ public void createConnectionFactory(final String name,
final String discoveryAddress,
final int discoveryPort,
final String clientID,
final Object[] jndiBindings) throws Exception
{
List<String> jndiBindingsList = convert(jndiBindings);
-
+
server.createConnectionFactory(name, discoveryAddress, discoveryPort, clientID, jndiBindingsList);
sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
}
+ public void createConnectionFactory(String name,
+ String discoveryAddress,
+ int discoveryPort,
+ String clientID,
+ String jndiBindings) throws Exception
+ {
+ Object[] bindings = toArray(jndiBindings);
+
+ createConnectionFactory(name, discoveryAddress, discoveryPort, clientID, bindings);
+ }
+
public void createConnectionFactory(final String name,
final String discoveryAddress,
final int discoveryPort,
@@ -275,7 +407,7 @@
final Object[] jndiBindings) throws Exception
{
List<String> jndiBindingsList = convert(jndiBindings);
-
+
server.createConnectionFactory(name,
discoveryAddress,
discoveryPort,
@@ -312,20 +444,96 @@
}
public void createConnectionFactory(final String name,
- final String liveTransportClassName,
- final Map<String, Object> liveTransportParams,
- final Object[] jndiBindings) throws Exception
+ final String discoveryAddress,
+ final int discoveryPort,
+ final String clientID,
+ final long discoveryRefreshTimeout,
+ final long clientFailureCheckPeriod,
+ final long connectionTTL,
+ final long callTimeout,
+ final int maxConnections,
+ final int minLargeMessageSize,
+ final int consumerWindowSize,
+ final int consumerMaxRate,
+ final int producerWindowSize,
+ final int producerMaxRate,
+ final boolean blockOnAcknowledge,
+ final boolean blockOnPersistentSend,
+ final boolean blockOnNonPersistentSend,
+ final boolean autoGroup,
+ final boolean preAcknowledge,
+ final String loadBalancingPolicyClassName,
+ final int transactionBatchSize,
+ final int dupsOKBatchSize,
+ final long initialWaitTimeout,
+ final boolean useGlobalPools,
+ final int scheduledThreadPoolMaxSize,
+ final int threadPoolMaxSize,
+ final long retryInterval,
+ final double retryIntervalMultiplier,
+ final int reconnectAttempts,
+ final boolean failoverOnServerShutdown,
+ final String jndiBindings) throws Exception
{
-
+ Object[] bindings = toArray(jndiBindings);
+
+ createConnectionFactory(name,
+ discoveryAddress,
+ discoveryPort,
+ clientID,
+ discoveryRefreshTimeout,
+ clientFailureCheckPeriod,
+ connectionTTL,
+ callTimeout,
+ maxConnections,
+ minLargeMessageSize,
+ consumerWindowSize,
+ consumerMaxRate,
+ producerWindowSize,
+ producerMaxRate,
+ blockOnAcknowledge,
+ blockOnPersistentSend,
+ blockOnNonPersistentSend,
+ autoGroup,
+ preAcknowledge,
+ loadBalancingPolicyClassName,
+ transactionBatchSize,
+ dupsOKBatchSize,
+ initialWaitTimeout,
+ useGlobalPools,
+ scheduledThreadPoolMaxSize,
+ threadPoolMaxSize,
+ retryInterval,
+ retryIntervalMultiplier,
+ reconnectAttempts,
+ failoverOnServerShutdown,
+ bindings);
+ }
+
+ public void createConnectionFactory(String name,
+ String liveTransportClassName,
+ Map<String, Object> liveTransportParams,
+ Object[] jndiBindings) throws Exception
+ {
+ List<String> jndiBindingsList = convert(jndiBindings);
TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
- List<String> jndiBindingsList = convert(jndiBindings);
-
server.createConnectionFactory(name, liveTC, jndiBindingsList);
sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
}
-
+
+ public void createConnectionFactory(String name,
+ String liveTransportClassName,
+ String liveTransportParams,
+ String jndiBindings) throws Exception
+ {
+ Map<String, Object> params = ManagementHelper.fromCommaSeparatedKeyValues(liveTransportParams);
+ String[] bindings = toArray(jndiBindings);
+
+ createConnectionFactory(name, liveTransportClassName, params, bindings);
+ }
+
public void createConnectionFactory(final String name,
final String liveTransportClassName,
final Map<String, Object> liveTransportParams,
@@ -333,7 +541,7 @@
final Object[] jndiBindings) throws Exception
{
List<String> jndiBindingsList = convert(jndiBindings);
-
+
TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
server.createConnectionFactory(name, liveTC, clientID, jndiBindingsList);
@@ -341,6 +549,18 @@
sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
}
+ public void createConnectionFactory(String name,
+ String liveTransportClassName,
+ String liveTransportParams,
+ String clientID,
+ String jndiBindings) throws Exception
+ {
+ Map<String, Object> params = ManagementHelper.fromCommaSeparatedKeyValues(liveTransportParams);
+ String[] bindings = toArray(jndiBindings);
+
+ createConnectionFactory(name, liveTransportClassName, params, clientID, bindings);
+ }
+
public void createConnectionFactory(final String name,
final String liveTransportClassName,
final Map<String, Object> liveTransportParams,
@@ -353,7 +573,7 @@
TransportConfiguration backupTC = new TransportConfiguration(backupTransportClassName, backupTransportParams);
List<String> jndiBindingsList = convert(jndiBindings);
-
+
server.createConnectionFactory(name, liveTC, backupTC, jndiBindingsList);
sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
@@ -372,7 +592,7 @@
TransportConfiguration backupTC = new TransportConfiguration(backupTransportClassName, backupTransportParams);
List<String> jndiBindingsList = convert(jndiBindings);
-
+
server.createConnectionFactory(name, liveTC, backupTC, clientID, jndiBindingsList);
sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareJMSServerControlWrapper.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareJMSServerControlWrapper.java 2009-07-20 09:08:08 UTC (rev 7590)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareJMSServerControlWrapper.java 2009-07-20 09:28:16 UTC (rev 7591)
@@ -130,7 +130,71 @@
reconnectAttempts,
failoverOnServerShutdown,
jndiBindings);
+ }
+ public void createConnectionFactory(final String name,
+ final String discoveryAddress,
+ final int discoveryPort,
+ final String clientID,
+ final long discoveryRefreshTimeout,
+ final long clientFailureCheckPeriod,
+ final long connectionTTL,
+ final long callTimeout,
+ final int maxConnections,
+ final int minLargeMessageSize,
+ final int consumerWindowSize,
+ final int consumerMaxRate,
+ final int producerWindowSize,
+ final int producerMaxRate,
+ final boolean blockOnAcknowledge,
+ final boolean blockOnPersistentSend,
+ final boolean blockOnNonPersistentSend,
+ final boolean autoGroup,
+ final boolean preAcknowledge,
+ final String loadBalancingPolicyClassName,
+ final int transactionBatchSize,
+ final int dupsOKBatchSize,
+ final long initialWaitTimeout,
+ final boolean useGlobalPools,
+ final int scheduledThreadPoolMaxSize,
+ final int threadPoolMaxSize,
+ final long retryInterval,
+ final double retryIntervalMultiplier,
+ final int reconnectAttempts,
+ final boolean failoverOnServerShutdown,
+ final String jndiBindings) throws Exception
+ {
+ replicationAwareInvoke("createConnectionFactory",
+ name,
+ discoveryAddress,
+ discoveryPort,
+ clientID,
+ clientFailureCheckPeriod,
+ connectionTTL,
+ callTimeout,
+ maxConnections,
+ minLargeMessageSize,
+ consumerWindowSize,
+ consumerMaxRate,
+ producerWindowSize,
+ producerMaxRate,
+ blockOnAcknowledge,
+ blockOnPersistentSend,
+ blockOnNonPersistentSend,
+ autoGroup,
+ preAcknowledge,
+ loadBalancingPolicyClassName,
+ transactionBatchSize,
+ dupsOKBatchSize,
+ initialWaitTimeout,
+ useGlobalPools,
+ scheduledThreadPoolMaxSize,
+ threadPoolMaxSize,
+ retryInterval,
+ retryIntervalMultiplier,
+ reconnectAttempts,
+ failoverOnServerShutdown,
+ jndiBindings);
}
public void createConnectionFactory(final String name,
@@ -140,7 +204,16 @@
final Object[] jndiBindings) throws Exception
{
replicationAwareInvoke("createConnectionFactory", name, discoveryAddress, discoveryPort, clientID, jndiBindings);
+ }
+ public void createConnectionFactory(final String name,
+ final String discoveryAddress,
+ final int discoveryPort,
+ final String clientID,
+ final String jndiBindings) throws Exception
+ {
+ replicationAwareInvoke("createConnectionFactory", name, discoveryAddress, discoveryPort, clientID, jndiBindings);
+
}
public void createConnectionFactory(final String name,
@@ -162,6 +235,24 @@
}
public void createConnectionFactory(final String name,
+ final String liveTransportClassNames,
+ final String liveTransportParams,
+ final String backupTransportClassNames,
+ final String backupTransportParams,
+ final String clientID,
+ final String jndiBindings) throws Exception
+ {
+ replicationAwareInvoke("createConnectionFactory",
+ name,
+ liveTransportClassNames,
+ liveTransportParams,
+ backupTransportClassNames,
+ backupTransportParams,
+ clientID,
+ jndiBindings);
+ }
+
+ public void createConnectionFactory(final String name,
final String liveTransportClassName,
final Map<String, Object> liveTransportParams,
final String backupTransportClassName,
@@ -178,13 +269,29 @@
}
public void createConnectionFactory(final String name,
+ final String liveTransportClassNames,
+ final String liveTransportParams,
+ final String backupTransportClassNames,
+ final String backupTransportParams,
+ final String jndiBindings) throws Exception
+ {
+ replicationAwareInvoke("createConnectionFactory",
+ name,
+ liveTransportClassNames,
+ liveTransportParams,
+ backupTransportClassNames,
+ backupTransportParams,
+ jndiBindings);
+ }
+
+ public void createConnectionFactory(final String name,
final String liveTransportClassName,
final Map<String, Object> liveTransportParams,
final String clientID,
final Object[] jndiBindings) throws Exception
{
replicationAwareInvoke("createConnectionFactory",
- name,
+ name,
liveTransportClassName,
liveTransportParams,
clientID,
@@ -193,12 +300,34 @@
public void createConnectionFactory(final String name,
final String liveTransportClassName,
+ final String liveTransportParams,
+ final String clientID,
+ final String jndiBindings) throws Exception
+ {
+ replicationAwareInvoke("createConnectionFactory",
+ name,
+ liveTransportClassName,
+ liveTransportParams,
+ clientID,
+ jndiBindings);
+ }
+
+ public void createConnectionFactory(String name,
+ String liveTransportClassName,
+ String liveTransportParams,
+ String jndiBindings) throws Exception
+ {
+ replicationAwareInvoke("createConnectionFactory", name, liveTransportClassName, liveTransportParams, jndiBindings);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String liveTransportClassName,
final Map<String, Object> liveTransportParams,
final Object[] jndiBindings) throws Exception
{
replicationAwareInvoke("createConnectionFactory", name, liveTransportClassName, liveTransportParams, jndiBindings);
}
-
+
public void createConnectionFactory(final String name,
final Object[] liveConnectorsTransportClassNames,
final Object[] liveConnectorTransportParams,
@@ -266,6 +395,72 @@
}
public void createConnectionFactory(final String name,
+ final String liveConnectorsTransportClassNames,
+ final String liveConnectorTransportParams,
+ final String backupConnectorsTransportClassNames,
+ final String backupConnectorTransportParams,
+ final String clientID,
+ final long clientFailureCheckPeriod,
+ final long connectionTTL,
+ final long callTimeout,
+ final int maxConnections,
+ final int minLargeMessageSize,
+ final int consumerWindowSize,
+ final int consumerMaxRate,
+ final int producerWindowSize,
+ final int producerMaxRate,
+ final boolean blockOnAcknowledge,
+ final boolean blockOnPersistentSend,
+ final boolean blockOnNonPersistentSend,
+ final boolean autoGroup,
+ final boolean preAcknowledge,
+ final String loadBalancingPolicyClassName,
+ final int transactionBatchSize,
+ final int dupsOKBatchSize,
+ final boolean useGlobalPools,
+ final int scheduledThreadPoolMaxSize,
+ final int threadPoolMaxSize,
+ final long retryInterval,
+ final double retryIntervalMultiplier,
+ final int reconnectAttempts,
+ final boolean failoverOnServerShutdown,
+ final String jndiBindings) throws Exception
+ {
+ replicationAwareInvoke("createConnectionFactory",
+ name,
+ liveConnectorsTransportClassNames,
+ liveConnectorTransportParams,
+ backupConnectorsTransportClassNames,
+ backupConnectorTransportParams,
+ clientID,
+ clientFailureCheckPeriod,
+ connectionTTL,
+ callTimeout,
+ maxConnections,
+ minLargeMessageSize,
+ consumerWindowSize,
+ consumerMaxRate,
+ producerWindowSize,
+ producerMaxRate,
+ blockOnAcknowledge,
+ blockOnPersistentSend,
+ blockOnNonPersistentSend,
+ autoGroup,
+ preAcknowledge,
+ loadBalancingPolicyClassName,
+ transactionBatchSize,
+ dupsOKBatchSize,
+ useGlobalPools,
+ scheduledThreadPoolMaxSize,
+ threadPoolMaxSize,
+ retryInterval,
+ retryIntervalMultiplier,
+ reconnectAttempts,
+ failoverOnServerShutdown,
+ jndiBindings);
+ }
+
+ public void createConnectionFactory(final String name,
final Object[] liveConnectorsTransportClassNames,
final Object[] liveConnectorTransportParams,
final Object[] backupConnectorsTransportClassNames,
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlTest.java 2009-07-20 09:08:08 UTC (rev 7590)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlTest.java 2009-07-20 09:28:16 UTC (rev 7591)
@@ -24,6 +24,7 @@
import static org.jboss.messaging.tests.util.RandomUtil.randomString;
+import java.util.Arrays;
import java.util.Map;
import javax.jms.Connection;
@@ -40,8 +41,11 @@
import org.jboss.messaging.core.management.ObjectNames;
import org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
+import org.jboss.messaging.core.remoting.impl.invm.TransportConstants;
import org.jboss.messaging.core.server.Messaging;
import org.jboss.messaging.core.server.MessagingServer;
+import org.jboss.messaging.integration.transports.netty.NettyAcceptorFactory;
+import org.jboss.messaging.integration.transports.netty.NettyConnectorFactory;
import org.jboss.messaging.jms.server.JMSServerManager;
import org.jboss.messaging.jms.server.impl.JMSServerManagerImpl;
import org.jboss.messaging.jms.server.management.JMSServerControl;
@@ -72,6 +76,20 @@
// Static --------------------------------------------------------
+ private static String toCSV(Object[] objects)
+ {
+ String str = "";
+ for (int i = 0; i < objects.length; i++)
+ {
+ if (i > 0)
+ {
+ str += ", ";
+ }
+ str += objects[i];
+ }
+ return str;
+ }
+
// Constructors --------------------------------------------------
// Public --------------------------------------------------------
@@ -164,9 +182,8 @@
{
doCreateConnectionFactory(new ConnectionFactoryCreator()
{
- public void createConnectionFactory(JMSServerControl control, Object[] bindings) throws Exception
+ public void createConnectionFactory(JMSServerControl control, String cfName, Object[] bindings) throws Exception
{
- String cfName = randomString();
TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
control.createConnectionFactory(cfName, tcLive.getFactoryClassName(), tcLive.getParams(), bindings);
@@ -174,13 +191,26 @@
});
}
+ public void testCreateConnectionFactory_1b() throws Exception
+ {
+ doCreateConnectionFactory(new ConnectionFactoryCreator()
+ {
+ public void createConnectionFactory(JMSServerControl control, String cfName, Object[] bindings) throws Exception
+ {
+ String jndiBindings = toCSV(bindings);
+ String params = "\"key1\"=1, \"key2\"=false, \"key3\"=\"value3\"";
+
+ control.createConnectionFactory(cfName, InVMConnectorFactory.class.getName(), params, jndiBindings);
+ }
+ });
+ }
+
public void testCreateConnectionFactory_2() throws Exception
{
doCreateConnectionFactory(new ConnectionFactoryCreator()
{
- public void createConnectionFactory(JMSServerControl control, Object[] bindings) throws Exception
+ public void createConnectionFactory(JMSServerControl control, String cfName, Object[] bindings) throws Exception
{
- String cfName = randomString();
String clientID = randomString();
TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
@@ -193,13 +223,31 @@
});
}
+ public void testCreateConnectionFactory_2b() throws Exception
+ {
+ doCreateConnectionFactory(new ConnectionFactoryCreator()
+ {
+ public void createConnectionFactory(JMSServerControl control, String cfName, Object[] bindings) throws Exception
+ {
+ String clientID = randomString();
+ String jndiBindings = toCSV(bindings);
+ String params = "\"key1\"=1, \"key2\"=false, \"key3\"=\"value3\"";
+
+ control.createConnectionFactory(cfName,
+ InVMConnectorFactory.class.getName(),
+ params,
+ clientID,
+ jndiBindings);
+ }
+ });
+ }
+
public void testCreateConnectionFactory_3() throws Exception
{
doCreateConnectionFactory(new ConnectionFactoryCreator()
{
- public void createConnectionFactory(JMSServerControl control, Object[] bindings) throws Exception
+ public void createConnectionFactory(JMSServerControl control, String cfName, Object[] bindings) throws Exception
{
- String cfName = randomString();
TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
TransportConfiguration tcBackup = new TransportConfiguration(InVMConnectorFactory.class.getName());
@@ -213,13 +261,55 @@
});
}
+ public void testCreateConnectionFactory_3b() throws Exception
+ {
+ doCreateConnectionFactory(new ConnectionFactoryCreator()
+ {
+ public void createConnectionFactory(JMSServerControl control, String cfName, Object[] bindings) throws Exception
+ {
+ String jndiBindings = toCSV(bindings);
+ String params = "\"key1\"=1, \"key2\"=false, \"key3\"=\"value3\"";
+
+ control.createConnectionFactory(cfName,
+ InVMConnectorFactory.class.getName(),
+ params,
+ InVMConnectorFactory.class.getName(),
+ params,
+ jndiBindings);
+ }
+ });
+ }
+
+ // with 2 live servers & no backups
+ public void testCreateConnectionFactory_3c() throws Exception
+ {
+ doCreateConnectionFactory(new ConnectionFactoryCreator()
+ {
+ public void createConnectionFactory(JMSServerControl control, String cfName, Object[] bindings) throws Exception
+ {
+ String jndiBindings = toCSV(bindings);
+ String params = String.format("{%s=%s}, {%s=%s}",
+ TransportConstants.SERVER_ID_PROP_NAME,
+ 0,
+ TransportConstants.SERVER_ID_PROP_NAME,
+ 1);
+
+ control.createConnectionFactory(cfName,
+ InVMConnectorFactory.class.getName() + ", " + InVMConnectorFactory.class.getName(),
+ params,
+ "",
+ "",
+ jndiBindings);
+ }
+ });
+ }
+
public void testCreateConnectionFactory_4() throws Exception
{
doCreateConnectionFactory(new ConnectionFactoryCreator()
{
- public void createConnectionFactory(JMSServerControl control, Object[] bindings) throws Exception
+ public void createConnectionFactory(JMSServerControl control, String cfName, Object[] bindings) throws Exception
{
- String cfName = randomString();
String clientID = randomString();
TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
TransportConfiguration tcBackup = new TransportConfiguration(InVMConnectorFactory.class.getName());
@@ -235,13 +325,33 @@
});
}
+ // with 1 live and 1 backup
+ public void testCreateConnectionFactory_4b() throws Exception
+ {
+ doCreateConnectionFactory(new ConnectionFactoryCreator()
+ {
+ public void createConnectionFactory(JMSServerControl control, String cfName, Object[] bindings) throws Exception
+ {
+ String clientID = randomString();
+ String jndiBindings = toCSV(bindings);
+
+ control.createConnectionFactory(cfName,
+ InVMConnectorFactory.class.getName(),
+ TransportConstants.SERVER_ID_PROP_NAME + "=0",
+ InVMConnectorFactory.class.getName(),
+ TransportConstants.SERVER_ID_PROP_NAME + "=1",
+ clientID,
+ jndiBindings);
+ }
+ });
+ }
+
public void testCreateConnectionFactory_5() throws Exception
{
doCreateConnectionFactory(new ConnectionFactoryCreator()
{
- public void createConnectionFactory(JMSServerControl control, Object[] bindings) throws Exception
+ public void createConnectionFactory(JMSServerControl control, String cfName, Object[] bindings) throws Exception
{
- String cfName = randomString();
TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
TransportConfiguration tcBackup = new TransportConfiguration(InVMConnectorFactory.class.getName());
@@ -259,9 +369,8 @@
{
doCreateConnectionFactory(new ConnectionFactoryCreator()
{
- public void createConnectionFactory(JMSServerControl control, Object[] bindings) throws Exception
+ public void createConnectionFactory(JMSServerControl control, String cfName, Object[] bindings) throws Exception
{
- String cfName = randomString();
String clientID = randomString();
TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
TransportConfiguration tcBackup = new TransportConfiguration(InVMConnectorFactory.class.getName());
@@ -281,9 +390,8 @@
{
doCreateConnectionFactory(new ConnectionFactoryCreator()
{
- public void createConnectionFactory(JMSServerControl control, Object[] bindings) throws Exception
+ public void createConnectionFactory(JMSServerControl control, String cfName, Object[] bindings) throws Exception
{
- String cfName = randomString();
String clientID = randomString();
TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
TransportConfiguration tcBackup = new TransportConfiguration(InVMConnectorFactory.class.getName());
@@ -322,7 +430,51 @@
}
});
}
+
+ public void testCreateConnectionFactory_7b() throws Exception
+ {
+ doCreateConnectionFactory(new ConnectionFactoryCreator()
+ {
+ public void createConnectionFactory(JMSServerControl control, String cfName, Object[] bindings) throws Exception
+ {
+ String clientID = randomString();
+ String jndiBindings = toCSV(bindings);
+ control.createConnectionFactory(cfName,
+ InVMConnectorFactory.class.getName(),
+ "",
+ InVMConnectorFactory.class.getName(),
+ TransportConstants.SERVER_ID_PROP_NAME + "=1",
+ clientID,
+ ClientSessionFactoryImpl.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
+ ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL,
+ ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT,
+ ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS,
+ ClientSessionFactoryImpl.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
+ ClientSessionFactoryImpl.DEFAULT_CONSUMER_WINDOW_SIZE,
+ ClientSessionFactoryImpl.DEFAULT_CONSUMER_MAX_RATE,
+ ClientSessionFactoryImpl.DEFAULT_PRODUCER_WINDOW_SIZE,
+ ClientSessionFactoryImpl.DEFAULT_PRODUCER_MAX_RATE,
+ ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_ACKNOWLEDGE,
+ ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_PERSISTENT_SEND,
+ ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_NON_PERSISTENT_SEND,
+ ClientSessionFactoryImpl.DEFAULT_AUTO_GROUP,
+ ClientSessionFactoryImpl.DEFAULT_PRE_ACKNOWLEDGE,
+ ClientSessionFactoryImpl.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME,
+ ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE,
+ ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE,
+ ClientSessionFactoryImpl.DEFAULT_USE_GLOBAL_POOLS,
+ ClientSessionFactoryImpl.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE,
+ ClientSessionFactoryImpl.DEFAULT_THREAD_POOL_MAX_SIZE,
+ ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL,
+ ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL_MULTIPLIER,
+ ClientSessionFactoryImpl.DEFAULT_RECONNECT_ATTEMPTS,
+ ClientSessionFactoryImpl.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN,
+ jndiBindings);
+ }
+ });
+ }
+
public void _testCreateConnectionFactoryWithDiscoveryGroup() throws Exception
{
String[] cfJNDIBindings = new String[] { randomString(), randomString(), randomString() };
@@ -436,12 +588,8 @@
checkNoResource(ObjectNames.getConnectionFactoryObjectName(cfName));
JMSServerControl control = createManagementControl();
- creator.createConnectionFactory(control, cfJNDIBindings);
+ creator.createConnectionFactory(control, cfName, cfJNDIBindings);
- TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
-
- control.createConnectionFactory(cfName, tcLive.getFactoryClassName(), tcLive.getParams(), cfJNDIBindings);
-
for (Object cfJNDIBinding : cfJNDIBindings)
{
Object o = checkBinding(context, cfJNDIBinding.toString());
@@ -479,7 +627,7 @@
interface ConnectionFactoryCreator
{
- void createConnectionFactory(JMSServerControl control, Object[] bindings) throws Exception;
+ void createConnectionFactory(JMSServerControl control, String cfName, Object[] bindings) throws Exception;
}
}
\ No newline at end of file
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2009-07-20 09:08:08 UTC (rev 7590)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2009-07-20 09:28:16 UTC (rev 7591)
@@ -156,6 +156,71 @@
String discoveryAddress,
int discoveryPort,
String clientID,
+ long discoveryRefreshTimeout,
+ long clientFailureCheckPeriod,
+ long connectionTTL,
+ long callTimeout,
+ int maxConnections,
+ int minLargeMessageSize,
+ int consumerWindowSize,
+ int consumerMaxRate,
+ int producerWindowSize,
+ int producerMaxRate,
+ boolean blockOnAcknowledge,
+ boolean blockOnPersistentSend,
+ boolean blockOnNonPersistentSend,
+ boolean autoGroup,
+ boolean preAcknowledge,
+ String loadBalancingPolicyClassName,
+ int transactionBatchSize,
+ int dupsOKBatchSize,
+ long initialWaitTimeout,
+ boolean useGlobalPools,
+ int scheduledThreadPoolMaxSize,
+ int threadPoolMaxSize,
+ long retryInterval,
+ double retryIntervalMultiplier,
+ int reconnectAttempts,
+ boolean failoverOnServerShutdown,
+ String jndiBindings) throws Exception
+ {
+ proxy.invokeOperation("createConnectionFactory",
+ name,
+ discoveryAddress,
+ discoveryPort,
+ clientID,
+ clientFailureCheckPeriod,
+ connectionTTL,
+ callTimeout,
+ maxConnections,
+ minLargeMessageSize,
+ consumerWindowSize,
+ consumerMaxRate,
+ producerWindowSize,
+ producerMaxRate,
+ blockOnAcknowledge,
+ blockOnPersistentSend,
+ blockOnNonPersistentSend,
+ autoGroup,
+ preAcknowledge,
+ loadBalancingPolicyClassName,
+ transactionBatchSize,
+ dupsOKBatchSize,
+ initialWaitTimeout,
+ useGlobalPools,
+ scheduledThreadPoolMaxSize,
+ threadPoolMaxSize,
+ retryInterval,
+ retryIntervalMultiplier,
+ reconnectAttempts,
+ failoverOnServerShutdown,
+ jndiBindings);
+ }
+
+ public void createConnectionFactory(String name,
+ String discoveryAddress,
+ int discoveryPort,
+ String clientID,
Object[] jndiBindings) throws Exception
{
proxy.invokeOperation("createConnectionFactory",
@@ -167,6 +232,20 @@
}
public void createConnectionFactory(String name,
+ String discoveryAddress,
+ int discoveryPort,
+ String clientID,
+ String jndiBindings) throws Exception
+ {
+ proxy.invokeOperation("createConnectionFactory",
+ name,
+ discoveryAddress,
+ discoveryPort,
+ clientID,
+ jndiBindings);
+ }
+
+ public void createConnectionFactory(String name,
String liveTransportClassName,
Map<String, Object> liveTransportParams,
String backupTransportClassName,
@@ -185,6 +264,24 @@
}
public void createConnectionFactory(String name,
+ String liveTransportClassNames,
+ String liveTransportParams,
+ String backupTransportClassNames,
+ String backupTransportParams,
+ String clientID,
+ String jndiBindings) throws Exception
+ {
+ proxy.invokeOperation("createConnectionFactory",
+ name,
+ liveTransportClassNames,
+ liveTransportParams,
+ backupTransportClassNames,
+ backupTransportParams,
+ clientID,
+ jndiBindings);
+ }
+
+ public void createConnectionFactory(String name,
String liveTransportClassName,
Map<String, Object> liveTransportParams,
String backupTransportClassName,
@@ -201,6 +298,22 @@
}
public void createConnectionFactory(String name,
+ String liveTransportClassNames,
+ String liveTransportParams,
+ String backupTransportClassNames,
+ String backupTransportParams,
+ String jndiBindings) throws Exception
+ {
+ proxy.invokeOperation("createConnectionFactory",
+ name,
+ liveTransportClassNames,
+ liveTransportParams,
+ backupTransportClassNames,
+ backupTransportParams,
+ jndiBindings);
+ }
+
+ public void createConnectionFactory(String name,
String liveTransportClassName,
Map<String, Object> liveTransportParams,
String clientID,
@@ -216,6 +329,20 @@
public void createConnectionFactory(String name,
String liveTransportClassName,
+ String liveTransportParams,
+ String clientID,
+ String jndiBindings) throws Exception
+ {
+ proxy.invokeOperation("createConnectionFactory",
+ name,
+ liveTransportClassName,
+ liveTransportParams,
+ clientID,
+ jndiBindings);
+ }
+
+ public void createConnectionFactory(String name,
+ String liveTransportClassName,
Map<String, Object> liveTransportParams,
Object[] jndiBindings) throws Exception
{
@@ -227,6 +354,18 @@
}
public void createConnectionFactory(String name,
+ String liveTransportClassName,
+ String liveTransportParams,
+ String jndiBindings) throws Exception
+ {
+ proxy.invokeOperation("createConnectionFactory",
+ name,
+ liveTransportClassName,
+ liveTransportParams,
+ jndiBindings);
+ }
+
+ public void createConnectionFactory(String name,
Object[] liveConnectorsTransportClassNames,
Object[] liveConnectorTransportParams,
Object[] backupConnectorsTransportClassNames,
@@ -294,6 +433,73 @@
}
public void createConnectionFactory(String name,
+ String liveConnectorsTransportClassNames,
+ String liveConnectorTransportParams,
+ String backupConnectorsTransportClassNames,
+ String backupConnectorTransportParams,
+ String clientID,
+ long clientFailureCheckPeriod,
+ long connectionTTL,
+ long callTimeout,
+ int maxConnections,
+ int minLargeMessageSize,
+ int consumerWindowSize,
+ int consumerMaxRate,
+ int producerWindowSize,
+ int producerMaxRate,
+ boolean blockOnAcknowledge,
+ boolean blockOnPersistentSend,
+ boolean blockOnNonPersistentSend,
+ boolean autoGroup,
+ boolean preAcknowledge,
+ String loadBalancingPolicyClassName,
+ int transactionBatchSize,
+ int dupsOKBatchSize,
+ boolean useGlobalPools,
+ int scheduledThreadPoolMaxSize,
+ int threadPoolMaxSize,
+ long retryInterval,
+ double retryIntervalMultiplier,
+ int reconnectAttempts,
+ boolean failoverOnServerShutdown,
+ String jndiBindings) throws Exception
+ {
+ proxy.invokeOperation("createConnectionFactory",
+ name,
+ liveConnectorsTransportClassNames,
+ liveConnectorTransportParams,
+ backupConnectorsTransportClassNames,
+ backupConnectorTransportParams,
+ clientID,
+ clientFailureCheckPeriod,
+ connectionTTL,
+ callTimeout,
+ maxConnections,
+ minLargeMessageSize,
+ consumerWindowSize,
+ consumerMaxRate,
+ producerWindowSize,
+ producerMaxRate,
+ blockOnAcknowledge,
+ blockOnPersistentSend,
+ blockOnNonPersistentSend,
+ autoGroup,
+ preAcknowledge,
+ loadBalancingPolicyClassName,
+ transactionBatchSize,
+ dupsOKBatchSize,
+ useGlobalPools,
+ scheduledThreadPoolMaxSize,
+ threadPoolMaxSize,
+ retryInterval,
+ retryIntervalMultiplier,
+ reconnectAttempts,
+ failoverOnServerShutdown,
+ jndiBindings);
+
+ }
+
+ public void createConnectionFactory(String name,
Object[] liveConnectorsTransportClassNames,
Object[] liveConnectorTransportParams,
Object[] backupConnectorsTransportClassNames,
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/ManagementHelperTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/ManagementHelperTest.java 2009-07-20 09:08:08 UTC (rev 7590)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/ManagementHelperTest.java 2009-07-20 09:28:16 UTC (rev 7591)
@@ -248,6 +248,87 @@
}
+ public void testFromCommaSeparatedKeyValues() throws Exception
+ {
+ String str = "key1=1, key2=false, key3=2.0, key4=whatever";
+
+ Map<String, Object> map = ManagementHelper.fromCommaSeparatedKeyValues(str);
+ assertEquals(4, map.size());
+ assertTrue(map.containsKey("key1"));
+ assertEquals(1L, map.get("key1"));
+
+ assertTrue(map.containsKey("key2"));
+ assertEquals(false, map.get("key2"));
+
+ assertTrue(map.containsKey("key3"));
+ assertEquals(2.0, map.get("key3"));
+
+ assertTrue(map.containsKey("key4"));
+ assertEquals("whatever", map.get("key4"));
+ }
+
+ public void testFromCommaSeparatedArrayOfCommaSeparatedKeyValuesForSingleItem() throws Exception
+ {
+ // if there is a single item, no need to enclose it in { }
+ String str = "k11=1, k12=false, k13=2.0, k14=whatever ";
+
+ Object[] objects = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(str);
+ assertEquals(1, objects.length);
+
+ assertTrue(objects[0] instanceof Map<?, ?>);
+ Map<String, Object> map = (Map<String, Object>)objects[0];
+ assertEquals(4, map.size());
+ assertTrue(map.containsKey("k11"));
+ assertEquals(1L, map.get("k11"));
+
+ assertTrue(map.containsKey("k12"));
+ assertEquals(false, map.get("k12"));
+
+ assertTrue(map.containsKey("k13"));
+ assertEquals(2.0, map.get("k13"));
+
+ assertTrue(map.containsKey("k14"));
+ assertEquals("whatever", map.get("k14"));
+ }
+
+ public void testFromCommaSeparatedArrayOfCommaSeparatedKeyValues() throws Exception
+ {
+ String str = "{ k11=1, k12=false, k13=2.0, k14=whatever },{ k21=2, k22=true, k23=23.0, k24=foo }";
+
+ Object[] objects = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(str);
+ assertEquals(2, objects.length);
+
+ assertTrue(objects[0] instanceof Map<?, ?>);
+ Map<String, Object> map = (Map<String, Object>)objects[0];
+ assertEquals(4, map.size());
+ assertTrue(map.containsKey("k11"));
+ assertEquals(1L, map.get("k11"));
+
+ assertTrue(map.containsKey("k12"));
+ assertEquals(false, map.get("k12"));
+
+ assertTrue(map.containsKey("k13"));
+ assertEquals(2.0, map.get("k13"));
+
+ assertTrue(map.containsKey("k14"));
+ assertEquals("whatever", map.get("k14"));
+
+ assertTrue(objects[1] instanceof Map<?, ?>);
+ map = (Map<String, Object>)objects[1];
+ assertEquals(4, map.size());
+ assertTrue(map.containsKey("k21"));
+ assertEquals(2L, map.get("k21"));
+
+ assertTrue(map.containsKey("k22"));
+ assertEquals(true, map.get("k22"));
+
+ assertTrue(map.containsKey("k23"));
+ assertEquals(23.0, map.get("k23"));
+
+ assertTrue(map.containsKey("k24"));
+ assertEquals("foo", map.get("k24"));
+}
+
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
More information about the jboss-cvs-commits
mailing list