[hornetq-commits] JBoss hornetq SVN: r8979 - in trunk: src/main/org/hornetq/jms/management/impl and 1 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Sat Mar 27 06:52:12 EDT 2010
Author: ataylor
Date: 2010-03-27 06:52:12 -0400 (Sat, 27 Mar 2010)
New Revision: 8979
Modified:
trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java
trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
Log:
added methods to jmsservercontrol
Modified: trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java
===================================================================
--- trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java 2010-03-27 10:16:27 UTC (rev 8978)
+++ trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java 2010-03-27 10:52:12 UTC (rev 8979)
@@ -59,6 +59,13 @@
String[] getConnectionFactoryNames();
// Operations ----------------------------------------------------
+ /**
+ * Creates a JMS Queue.
+ *
+ * @return {@code true} if the queue was created, {@code false} else
+ */
+ @Operation(desc = "Create a JMS Queue", impact = MBeanOperationInfo.ACTION)
+ boolean createQueue(@Parameter(name = "name", desc = "Name of the queue to create") String name) throws Exception;
/**
* Creates a JMS Queue with the specified name and JNDI binding.
@@ -67,9 +74,20 @@
*/
@Operation(desc = "Create a JMS Queue", impact = MBeanOperationInfo.ACTION)
boolean createQueue(@Parameter(name = "name", desc = "Name of the queue to create") String name,
- @Parameter(name = "jndiBinding", desc = "the name of the binding for JNDI") String jndiBinding) throws Exception;
+ @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings (use ',' if u need to use commas in your jndi name)") String jndiBindings) throws Exception;
/**
+ * Creates a JMS Queue with the specified name and JNDI binding.
+ *
+ * @return {@code true} if the queue was created, {@code false} else
+ */
+ @Operation(desc = "Create a JMS Queue", impact = MBeanOperationInfo.ACTION)
+ boolean createQueue(@Parameter(name = "name", desc = "Name of the queue to create") String name,
+ @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings (use ',' if u need to use commas in your jndi name)") String jndiBindings,
+ @Parameter(name = "selector", desc = "the jms selector") String selector) throws Exception;
+
+
+ /**
* Destroys a JMS Queue with the specified name.
*
* @return {@code true} if the queue was destroyed, {@code false} else
@@ -78,13 +96,21 @@
boolean destroyQueue(@Parameter(name = "name", desc = "Name of the queue to destroy") String name) throws Exception;
/**
+ * Creates a JMS Topic.
+ *
+ * @return {@code true} if the topic was created, {@code false} else
+ */
+ @Operation(desc = "Create a JMS Topic", impact = MBeanOperationInfo.ACTION)
+ boolean createTopic(@Parameter(name = "name", desc = "Name of the topic to create") String name) throws Exception;
+
+ /**
* Creates a JMS Topic with the specified name and JNDI binding.
*
* @return {@code true} if the topic was created, {@code false} else
*/
@Operation(desc = "Create a JMS Topic", impact = MBeanOperationInfo.ACTION)
boolean createTopic(@Parameter(name = "name", desc = "Name of the topic to create") String name,
- @Parameter(name = "jndiBinding", desc = "the name of the binding for JNDI") String jndiBinding) throws Exception;
+ @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings (use ',' if u need to use commas in your jndi name)") String jndiBindings) throws Exception;
/**
* Destroys a JMS Topic with the specified name.
@@ -134,7 +160,7 @@
@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;
+ @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings (use ',' if u need to use commas in your jndi name)") String jndiBindings) throws Exception;
/**
* Create a JMS ConnectionFactory with the specified name using a discovery group to discover HornetQ servers.
Modified: trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2010-03-27 10:16:27 UTC (rev 8978)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2010-03-27 10:52:12 UTC (rev 8979)
@@ -31,6 +31,7 @@
import org.hornetq.api.core.Pair;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.management.ManagementHelper;
+import org.hornetq.api.core.management.Parameter;
import org.hornetq.api.jms.management.ConnectionFactoryControl;
import org.hornetq.api.jms.management.JMSQueueControl;
import org.hornetq.api.jms.management.JMSServerControl;
@@ -81,6 +82,7 @@
for (int i = 0; i < values.length; i++)
{
trimmed[i] = values[i].trim();
+ trimmed[i] = trimmed[i].replace(",", ",");
}
return trimmed;
}
@@ -270,15 +272,27 @@
}
- public boolean createQueue(final String name, final String jndiBinding) throws Exception
+ public boolean createQueue(@Parameter(name = "name", desc = "Name of the queue to create") String name) throws Exception
{
+ return createQueue(name, null, null);
+ }
+
+
+
+ public boolean createQueue(final String name, final String jndiBindings) throws Exception
+ {
+ return createQueue(name, jndiBindings, null);
+ }
+
+ public boolean createQueue(@Parameter(name = "name", desc = "Name of the queue to create") String name, @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings (use ',' if u need to use commas in your jndi name)") String jndiBindings, @Parameter(name = "selector", desc = "the jms selector") String selector) throws Exception
+ {
checkStarted();
clearIO();
try
{
- boolean created = server.createQueue(name, null, true, jndiBinding);
+ boolean created = server.createQueue(name, selector, true, JMSServerControlImpl.toArray(jndiBindings));
if (created)
{
sendNotification(NotificationType.QUEUE_CREATED, name);
@@ -312,15 +326,20 @@
}
}
- public boolean createTopic(final String topicName, final String jndiBinding) throws Exception
+ public boolean createTopic(@Parameter(name = "name", desc = "Name of the topic to create") String name) throws Exception
{
+ return createTopic(name, null);
+ }
+
+ public boolean createTopic(final String topicName, final String jndiBindings) throws Exception
+ {
checkStarted();
clearIO();
try
{
- boolean created = server.createTopic(topicName, jndiBinding);
+ boolean created = server.createTopic(topicName, JMSServerControlImpl.toArray(jndiBindings));
if (created)
{
sendNotification(NotificationType.TOPIC_CREATED, topicName);
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2010-03-27 10:16:27 UTC (rev 8978)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2010-03-27 10:52:12 UTC (rev 8979)
@@ -21,6 +21,7 @@
import javax.jms.Session;
import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.api.core.management.Parameter;
import org.hornetq.api.core.management.ResourceNames;
import org.hornetq.api.jms.HornetQJMSClient;
import org.hornetq.api.jms.management.JMSServerControl;
@@ -172,6 +173,11 @@
return (Boolean)proxy.invokeOperation("createQueue", name);
}
+ public boolean createQueue(String name, String jndiBindings, String selector) throws Exception
+ {
+ return (Boolean)proxy.invokeOperation("createQueue", name, jndiBindings, selector);
+ }
+
public boolean createTopic(final String name) throws Exception
{
return (Boolean)proxy.invokeOperation("createTopic", name);
More information about the hornetq-commits
mailing list