[jboss-cvs] JBoss Messaging SVN: r6672 - in trunk: src/main/org/jboss/messaging/jms/server/management and 4 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue May 5 16:00:25 EDT 2009
Author: jmesnil
Date: 2009-05-05 16:00:25 -0400 (Tue, 05 May 2009)
New Revision: 6672
Modified:
trunk/src/main/org/jboss/messaging/core/management/impl/ManagementServiceImpl.java
trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControlMBean.java
trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSQueueControl.java
trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControl.java
trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareJMSServerControlWrapper.java
trunk/tests/joram-tests/src/org/jboss/test/jms/JBossMessagingAdmin.java
trunk/tests/joram-tests/src/org/jboss/test/jms/SpawnedJMSServer.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSQueueControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
Log:
management refactoring
* temporary hack in management code (String[]?\194?\160parameters are deserialized as
Object[]?\194?\160parameters, preventing the management operation to be invoked
properly)
* fixed management code for JORAM tests
Modified: trunk/src/main/org/jboss/messaging/core/management/impl/ManagementServiceImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/ManagementServiceImpl.java 2009-05-05 19:34:01 UTC (rev 6671)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/ManagementServiceImpl.java 2009-05-05 20:00:25 UTC (rev 6672)
@@ -703,7 +703,9 @@
for (int i = 0; i < paramTypes.length; i++)
{
- if (params[i] != null && params[i].getClass() != paramTypes[i])
+ if (params[i] != null
+ && !(params[i].getClass().isArray())
+ && params[i].getClass().isAssignableFrom(paramTypes[i].getClass()))
{
continue;
}
@@ -719,7 +721,6 @@
{
throw new IllegalArgumentException("no operation " + operation + "/" + params.length);
}
-
Object result = method.invoke(resource, params);
return result;
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControlMBean.java 2009-05-05 19:34:01 UTC (rev 6671)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControlMBean.java 2009-05-05 20:00:25 UTC (rev 6672)
@@ -150,11 +150,17 @@
boolean failoverOnServerShutdown,
String[] jndiBindings) throws Exception;
+ // FIXME String[]Êdoes not work, they are converted to Object[]
+ // void createConnectionFactory(String name,
+ // String liveTransportClassName,
+ // Map<String, Object> liveTransportParams,
+ // String[] jndiBindings) throws Exception;
+
void createConnectionFactory(String name,
String liveTransportClassName,
Map<String, Object> liveTransportParams,
- String[] jndiBindings) throws Exception;
-
+ Object[] jndiBindings) throws Exception;
+
void createConnectionFactory(String name,
String liveTransportClassName,
Map<String, Object> liveTransportParams,
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSQueueControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSQueueControl.java 2009-05-05 19:34:01 UTC (rev 6671)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSQueueControl.java 2009-05-05 20:00:25 UTC (rev 6672)
@@ -198,6 +198,7 @@
for (Map<String, Object> coreMessage : coreMessages)
{
Map<String, Object> jmsMessage = JBossMessage.coreMaptoJMSMap(coreMessage);
+ jmsMessages[i++] = jmsMessage;
}
return jmsMessages;
}
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControl.java 2009-05-05 19:34:01 UTC (rev 6671)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControl.java 2009-05-05 20:00:25 UTC (rev 6672)
@@ -294,20 +294,42 @@
sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
}
+ // FIXME
+// public void createConnectionFactory(final String name,
+// final String liveTransportClassName,
+// final Map<String, Object> liveTransportParams,
+// final String[] jndiBindings) throws Exception
+// {
+// TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
+//
+// List<String> jndiBindingsList = Arrays.asList(jndiBindings);
+//
+// server.createConnectionFactory(name, liveTC, jndiBindingsList);
+//
+// sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+// }
+
public void createConnectionFactory(final String name,
final String liveTransportClassName,
final Map<String, Object> liveTransportParams,
- final String[] jndiBindings) throws Exception
+ final Object[] jndiBindings) throws Exception
{
+ String[] bindings = new String[jndiBindings.length];
+ for (int i = 0; i < jndiBindings.length; i++)
+ {
+ bindings[i] = jndiBindings[i].toString();
+
+ }
+
TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
- List<String> jndiBindingsList = Arrays.asList(jndiBindings);
+ List<String> jndiBindingsList = Arrays.asList(bindings);
server.createConnectionFactory(name, liveTC, jndiBindingsList);
sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
}
-
+
public void createConnectionFactory(final String name,
final String liveTransportClassName,
final Map<String, Object> liveTransportParams,
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-05-05 19:34:01 UTC (rev 6671)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareJMSServerControlWrapper.java 2009-05-05 20:00:25 UTC (rev 6672)
@@ -196,6 +196,14 @@
}
public void createConnectionFactory(final String name,
+ final String liveTransportClassName,
+ final Map<String, Object> liveTransportParams,
+ final Object[] jndiBindings) throws Exception
+ {
+ replicationAwareInvoke("createConnectionFactory", liveTransportClassName, liveTransportParams, jndiBindings);
+ }
+
+ public void createConnectionFactory(final String name,
final String[] liveConnectorsTransportClassNames,
final Map<String, Object>[] liveConnectorTransportParams,
final String[] backupConnectorsTransportClassNames,
Modified: trunk/tests/joram-tests/src/org/jboss/test/jms/JBossMessagingAdmin.java
===================================================================
--- trunk/tests/joram-tests/src/org/jboss/test/jms/JBossMessagingAdmin.java 2009-05-05 19:34:01 UTC (rev 6671)
+++ trunk/tests/joram-tests/src/org/jboss/test/jms/JBossMessagingAdmin.java 2009-05-05 20:00:25 UTC (rev 6672)
@@ -25,6 +25,7 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
+import java.util.HashMap;
import java.util.Hashtable;
import javax.naming.Context;
@@ -106,10 +107,7 @@
"createConnectionFactory",
name,
NettyConnectorFactory.class.getName(),
- true,
- true,
- true,
- false,
+ new HashMap<String, Object>(),
new String[] {name});
}
catch (Exception e)
@@ -219,7 +217,7 @@
public void startServer() throws Exception
{
- serverProcess = SpawnedVMSupport.spawnVM(SpawnedJMSServer.class.getName(), true);
+ serverProcess = SpawnedVMSupport.spawnVM(SpawnedJMSServer.class.getName(), false);
InputStreamReader isr = new InputStreamReader(serverProcess.getInputStream());
final BufferedReader br = new BufferedReader(isr);
Modified: trunk/tests/joram-tests/src/org/jboss/test/jms/SpawnedJMSServer.java
===================================================================
--- trunk/tests/joram-tests/src/org/jboss/test/jms/SpawnedJMSServer.java 2009-05-05 19:34:01 UTC (rev 6671)
+++ trunk/tests/joram-tests/src/org/jboss/test/jms/SpawnedJMSServer.java 2009-05-05 20:00:25 UTC (rev 6672)
@@ -87,6 +87,8 @@
serverManager.setContext(new InitialContext(env));
serverManager.start();
+ System.out.println("Server started, ready to start client test");
+
// create the reader before printing OK so that if the test is quick
// we will still capture the STOP message sent by the client
InputStreamReader isr = new InputStreamReader(System.in);
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSQueueControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSQueueControlTest.java 2009-05-05 19:34:01 UTC (rev 6671)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSQueueControlTest.java 2009-05-05 20:00:25 UTC (rev 6672)
@@ -27,7 +27,9 @@
import static org.jboss.messaging.tests.util.RandomUtil.randomSimpleString;
import static org.jboss.messaging.tests.util.RandomUtil.randomString;
+import java.util.Iterator;
import java.util.Map;
+import java.util.Set;
import javax.jms.Connection;
import javax.jms.JMSException;
@@ -137,10 +139,18 @@
Map<String, Object>[] data = queueControl.listAllMessages();
assertEquals(2, data.length);
- // retrieve the first message info
- String messageID = (String)data[0].get("JMSMessageID");
+ System.out.println(data[0]);
+ // retrieve the first message info
+ Set<String> keySet = data[0].keySet();
+ Iterator<String> it = keySet.iterator();
+ while (it.hasNext())
+ {
+ System.out.println(it.next());
+ }
+ Map props = (Map)data[0].get("properties");
+ SimpleString messageID = (SimpleString)props.get("JMSMessageID");
- queueControl.removeMessage(messageID);
+ queueControl.removeMessage(messageID.toString());
assertEquals(1, queueControl.getMessageCount());
}
@@ -231,13 +241,14 @@
Map<String, Object>[] data = queueControl.listAllMessages();
// retrieve the first message info
- String messageID = (String)data[0].get("JMSMessageID");
- int currentPriority = (Integer)data[0].get("JMSPriority");
+ Map props = (Map)data[0].get("properties");
+ SimpleString messageID = (SimpleString)props.get("JMSMessageID");
+ int currentPriority = (Byte)data[0].get("JMSPriority");
int newPriority = 9;
assertTrue(newPriority != currentPriority);
- queueControl.changeMessagePriority(messageID, newPriority);
+ queueControl.changeMessagePriority(messageID.toString(), newPriority);
Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
connection.start();
@@ -675,10 +686,10 @@
server.start();
serverManager = new JMSServerManagerImpl(server);
+ context = new InVMContext();
+ serverManager.setContext(context);
serverManager.start();
serverManager.activated();
- context = new InVMContext();
- serverManager.setContext(context);
String queueName = randomString();
serverManager.createQueue(queueName, queueName);
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-05-05 19:34:01 UTC (rev 6671)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2009-05-05 20:00:25 UTC (rev 6672)
@@ -222,7 +222,7 @@
public void createConnectionFactory(String name,
String liveTransportClassName,
Map<String, Object> liveTransportParams,
- String[] jndiBindings) throws Exception
+ Object[] jndiBindings) throws Exception
{
proxy.invokeOperation("createConnectionFactory",
name,
More information about the jboss-cvs-commits
mailing list