[jboss-cvs] JBossAS SVN: r102868 - in trunk/hornetq-int/src: resources and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Mar 24 06:06:39 EDT 2010
Author: ataylor
Date: 2010-03-24 06:06:38 -0400 (Wed, 24 Mar 2010)
New Revision: 102868
Added:
trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/QueueManageMO.java
Removed:
trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/QueueManageImplMO.java
Modified:
trunk/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml
Log:
rename QueueManageImpl
Deleted: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/QueueManageImplMO.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/QueueManageImplMO.java 2010-03-24 10:04:32 UTC (rev 102867)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/QueueManageImplMO.java 2010-03-24 10:06:38 UTC (rev 102868)
@@ -1,235 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, Red Hat Inc., and individual contributors as indicated
-* 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.as.integration.hornetq.management.jms;
-
-import org.hornetq.api.core.management.ResourceNames;
-import org.hornetq.api.jms.management.JMSQueueControl;
-import org.hornetq.api.jms.management.JMSServerControl;
-import org.hornetq.core.security.Role;
-import org.hornetq.core.server.HornetQServer;
-import org.hornetq.core.server.management.ManagementService;
-import org.hornetq.jms.server.config.JMSQueueConfiguration;
-import org.hornetq.jms.server.config.impl.JMSQueueConfigurationImpl;
-import org.jboss.managed.api.annotation.*;
-import org.jboss.metatype.api.annotations.MetaMapping;
-
-import java.io.Serializable;
-import java.lang.reflect.Method;
-import java.util.*;
-
-/**
- * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
- * Created 10-Mar-2010
- */
- at ManagementObject(componentType = @ManagementComponent(type = "JMSDestinationManage", subtype = "QueueManage"),
- properties = ManagementProperties.EXPLICIT, isRuntime = true)
-public class QueueManageImplMO extends JMSDestinationManageMO
-{
- private JMSServerControl jmsServerControl;
- private ManagementService managementService;
- private HornetQServer server;
-
- public QueueManageImplMO(HornetQServer server)
- {
- super(server);
- this.server = server;
- }
-
- public void start()
- {
- managementService = server.getManagementService();
- jmsServerControl = (JMSServerControl) managementService.getResource(ResourceNames.JMS_SERVER);
- }
-
- @ManagementOperation(name = "createQueue", description = "Creates a new Queue",
- params = {
- @ManagementParameter(name = "name", description = "the queue name"),
- @ManagementParameter(name = "jndiName", description = "The JNDI Name of the queue"),
- @ManagementParameter(name = "dla", description = "Dead Letter Address"),
- @ManagementParameter(name = "expiryAddress", description = "Expiry Address"),
- @ManagementParameter(name = "maxSizeBytes", description = "Max Size of Address"),
- @ManagementParameter(name = "pageSizeBytes", description = "Page Size"),
- @ManagementParameter(name = "deliveryAttempts", description = "Max Delivery Attempts"),
- @ManagementParameter(name = "redeliveryDelay", description = "Redelivery Delay"),
- @ManagementParameter(name = "lastValueQueue", description = "Last Value Queue"),
- @ManagementParameter(name = "redistributionDelay", description = "Redistribution Delay"),
- @ManagementParameter(name = "sendToDLAOnNoRoute", description = "Send To DLA on no route"),
- @ManagementParameter(name = "addressFullMessagePolicy", description = "Address Full Message Policy"),
- @ManagementParameter(name = "sendRoles", description = "Send roles for a queue"),
- @ManagementParameter(name = "consumeRoles", description = "consume roles for a queue")
- })
- public void createQueue(String name,
- String jndiName,
- String DLA,
- String expiryAddress,
- long maxSizeBytes,
- int pageSizeBytes,
- int deliveryAttempts,
- long redeliveryDelay,
- boolean lastValueQueue,
- long redistributionDelay,
- boolean sendToDLAOnNoRoute,
- String addressFullMessagePolicy,
- String sendRoles,
- String consumeRoles) throws Exception
- {
-
- //update the address settings
- jmsServerControl.addAddressSettings("jms.queue." + name,
- DLA,
- expiryAddress,
- lastValueQueue,
- deliveryAttempts,
- maxSizeBytes,
- pageSizeBytes,
- redeliveryDelay,
- redistributionDelay,
- sendToDLAOnNoRoute,
- addressFullMessagePolicy);
- //create the queue
- jmsServerControl.createQueue(name, jndiName);
- //update security
- jmsServerControl.addSecuritySettings("jms.queue." + name, sendRoles, consumeRoles, "", "", "", "", "");
- }
-
- @ManagementOperation(name = "deleteQueue", description = "delete the queue",
- params = {@ManagementParameter(name = "name", description = "the queue name")})
- public void deleteQueue(String name) throws Exception
- {
- jmsServerControl.destroyQueue(name.replace("jms.queue.", ""));
- jmsServerControl.removeSecuritySettings(name);
- }
-
- @ManagementOperation(name = "getQueueConfiguration", description = "Returns a queues configuration",
- params = {@ManagementParameter(name = "name", description = "the queue name")})
- @MetaMapping(value = AddressSettingsMapper.class)
- public Object[] getQueueConfiguration(String name) throws Exception
- {
- Object[] config = new Object[3];
- JMSQueueControl control = (JMSQueueControl) managementService.getResource(name);
- JMSQueueConfiguration queueConfiguration = new JMSQueueConfigurationImpl(control.getName(), control.getSelector(), !control.isTemporary(), control.getJNDIBinding());
- config[0] = queueConfiguration;
- config[1] = jmsServerControl.getAddressSettings(name);
- Set<Role> roles = jmsServerControl.getSecuritySettings(name);
- config[2] = roles;
- return config;
- }
-
- @ManagementOperation(name = "updateQueueConfiguration", description = "updates a queues configuration",
- params = {
- @ManagementParameter(name = "name", description = "the queue name"),
- @ManagementParameter(name = "jndiName", description = "The JNDI Name of the queue"),
- @ManagementParameter(name = "dla", description = "Dead Letter Address"),
- @ManagementParameter(name = "expiryAddress", description = "Expiry Address"),
- @ManagementParameter(name = "maxSizeBytes", description = "Max Size of Address"),
- @ManagementParameter(name = "pageSizeBytes", description = "Page Size"),
- @ManagementParameter(name = "deliveryAttempts", description = "Max Delivery Attempts"),
- @ManagementParameter(name = "redeliveryDelay", description = "Redelivery Delay"),
- @ManagementParameter(name = "lastValueQueue", description = "Last Value Queue"),
- @ManagementParameter(name = "redistributionDelay", description = "Redistribution Delay"),
- @ManagementParameter(name = "sendToDLAOnNoRoute", description = "Send To DLA on no route"),
- @ManagementParameter(name = "addressFullMessagePolicy", description = "Address Full Message Policy"),
- @ManagementParameter(name = "sendRoles", description = "Send roles for a queue"),
- @ManagementParameter(name = "consumeRoles", description = "consume roles for a queue")
- })
- public void updateQueueConfiguration(String name,
- String jndiName,
- String dla,
- String expiryAddress,
- long maxSizeBytes,
- int pageSizeBytes,
- int deliveryAttempts,
- long redeliveryDelay,
- boolean lastValueQueue,
- long redistributionDelay,
- boolean sendToDLAOnNoRoute,
- String addressFullMessagePolicy,
- String sendRoles,
- String consumeRoles) throws Exception
- {
- //update the address settings
- jmsServerControl.addAddressSettings(name,
- dla,
- expiryAddress,
- lastValueQueue,
- deliveryAttempts,
- maxSizeBytes,
- pageSizeBytes,
- redeliveryDelay,
- redistributionDelay,
- sendToDLAOnNoRoute,
- addressFullMessagePolicy);
- //update security
- jmsServerControl.addSecuritySettings(name, sendRoles, consumeRoles, "", "", "", "", "");
- }
-
- @ManagementOperation(name = "getQueueMeasurements", description = "updates a queues configuration",
- params = {
- @ManagementParameter(name = "name", description = "the queue name"),
- @ManagementParameter(name = "names", description = "the measurement names")})
- public String[] getQueueMeasurements(String name, String[] names) throws Exception
- {
- JMSQueueControl control = (JMSQueueControl) managementService.getResource(name);
- String[] val = new String[names.length];
- for (int i = 0, valLength = val.length; i < valLength; i++)
- {
- val[i] = control.getClass().getMethod(names[i]).invoke(control).toString();
- }
- return val;
- }
-
- @ManagementOperation(name = "invokeQueueOperation", description = "invokes a queues method",
- params = {
- @ManagementParameter(name = "name", description = "the queue name"),
- @ManagementParameter(name = "method", description = "the method"),
- @ManagementParameter(name = "params", description = "the method params")})
- public Object invokeQueueOperation(String name, String method, String[] params, String[] type) throws Exception
- {
- JMSQueueControl control = (JMSQueueControl) managementService.getResource(name);
- Class[] classes = getClassTypes(type);
- Method m = control.getClass().getMethod(method, classes);
- return m.invoke(control, getParams(params, classes));
- }
-
- @ManagementOperation(name = "invokeQueueOperationMessageType", description = "invokes a queues method",
- params = {
- @ManagementParameter(name = "name", description = "the queue name"),
- @ManagementParameter(name = "method", description = "the method"),
- @ManagementParameter(name = "params", description = "the method params")})
- @MetaMapping(value = MessageListMapper.class)
- public List invokeQueueOperationMessageType(String name, String method, String[] params, String[] type) throws Exception
- {
- JMSQueueControl control = (JMSQueueControl) managementService.getResource(name);
- Class[] classes = getClassTypes(type);
- Method m = control.getClass().getMethod(method, classes);
- Map<String, Serializable>[] maps = (Map<String, Serializable>[]) m.invoke(control, getParams(params, classes));
- List list = new ArrayList();
- list.addAll(Arrays.asList(maps));
- return list;
- }
-
- @ManagementOperation(name = "getJMSQueues", description = "returns the JMS Queues")
- public String[] getJMSQueues()
- {
- return jmsServerControl.getQueueNames();
- }
-}
Copied: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/QueueManageMO.java (from rev 102862, trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/QueueManageImplMO.java)
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/QueueManageMO.java (rev 0)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/QueueManageMO.java 2010-03-24 10:06:38 UTC (rev 102868)
@@ -0,0 +1,235 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Inc., and individual contributors as indicated
+* 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.as.integration.hornetq.management.jms;
+
+import org.hornetq.api.core.management.ResourceNames;
+import org.hornetq.api.jms.management.JMSQueueControl;
+import org.hornetq.api.jms.management.JMSServerControl;
+import org.hornetq.core.security.Role;
+import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.server.management.ManagementService;
+import org.hornetq.jms.server.config.JMSQueueConfiguration;
+import org.hornetq.jms.server.config.impl.JMSQueueConfigurationImpl;
+import org.jboss.managed.api.annotation.*;
+import org.jboss.metatype.api.annotations.MetaMapping;
+
+import java.io.Serializable;
+import java.lang.reflect.Method;
+import java.util.*;
+
+/**
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
+ * Created 10-Mar-2010
+ */
+ at ManagementObject(componentType = @ManagementComponent(type = "JMSDestinationManage", subtype = "QueueManage"),
+ properties = ManagementProperties.EXPLICIT, isRuntime = true)
+public class QueueManageMO extends JMSDestinationManageMO
+{
+ private JMSServerControl jmsServerControl;
+ private ManagementService managementService;
+ private HornetQServer server;
+
+ public QueueManageMO(HornetQServer server)
+ {
+ super(server);
+ this.server = server;
+ }
+
+ public void start()
+ {
+ managementService = server.getManagementService();
+ jmsServerControl = (JMSServerControl) managementService.getResource(ResourceNames.JMS_SERVER);
+ }
+
+ @ManagementOperation(name = "createQueue", description = "Creates a new Queue",
+ params = {
+ @ManagementParameter(name = "name", description = "the queue name"),
+ @ManagementParameter(name = "jndiName", description = "The JNDI Name of the queue"),
+ @ManagementParameter(name = "dla", description = "Dead Letter Address"),
+ @ManagementParameter(name = "expiryAddress", description = "Expiry Address"),
+ @ManagementParameter(name = "maxSizeBytes", description = "Max Size of Address"),
+ @ManagementParameter(name = "pageSizeBytes", description = "Page Size"),
+ @ManagementParameter(name = "deliveryAttempts", description = "Max Delivery Attempts"),
+ @ManagementParameter(name = "redeliveryDelay", description = "Redelivery Delay"),
+ @ManagementParameter(name = "lastValueQueue", description = "Last Value Queue"),
+ @ManagementParameter(name = "redistributionDelay", description = "Redistribution Delay"),
+ @ManagementParameter(name = "sendToDLAOnNoRoute", description = "Send To DLA on no route"),
+ @ManagementParameter(name = "addressFullMessagePolicy", description = "Address Full Message Policy"),
+ @ManagementParameter(name = "sendRoles", description = "Send roles for a queue"),
+ @ManagementParameter(name = "consumeRoles", description = "consume roles for a queue")
+ })
+ public void createQueue(String name,
+ String jndiName,
+ String DLA,
+ String expiryAddress,
+ long maxSizeBytes,
+ int pageSizeBytes,
+ int deliveryAttempts,
+ long redeliveryDelay,
+ boolean lastValueQueue,
+ long redistributionDelay,
+ boolean sendToDLAOnNoRoute,
+ String addressFullMessagePolicy,
+ String sendRoles,
+ String consumeRoles) throws Exception
+ {
+
+ //update the address settings
+ jmsServerControl.addAddressSettings("jms.queue." + name,
+ DLA,
+ expiryAddress,
+ lastValueQueue,
+ deliveryAttempts,
+ maxSizeBytes,
+ pageSizeBytes,
+ redeliveryDelay,
+ redistributionDelay,
+ sendToDLAOnNoRoute,
+ addressFullMessagePolicy);
+ //create the queue
+ jmsServerControl.createQueue(name, jndiName);
+ //update security
+ jmsServerControl.addSecuritySettings("jms.queue." + name, sendRoles, consumeRoles, "", "", "", "", "");
+ }
+
+ @ManagementOperation(name = "deleteQueue", description = "delete the queue",
+ params = {@ManagementParameter(name = "name", description = "the queue name")})
+ public void deleteQueue(String name) throws Exception
+ {
+ jmsServerControl.destroyQueue(name.replace("jms.queue.", ""));
+ jmsServerControl.removeSecuritySettings(name);
+ }
+
+ @ManagementOperation(name = "getQueueConfiguration", description = "Returns a queues configuration",
+ params = {@ManagementParameter(name = "name", description = "the queue name")})
+ @MetaMapping(value = AddressSettingsMapper.class)
+ public Object[] getQueueConfiguration(String name) throws Exception
+ {
+ Object[] config = new Object[3];
+ JMSQueueControl control = (JMSQueueControl) managementService.getResource(name);
+ JMSQueueConfiguration queueConfiguration = new JMSQueueConfigurationImpl(control.getName(), control.getSelector(), !control.isTemporary(), control.getJNDIBinding());
+ config[0] = queueConfiguration;
+ config[1] = jmsServerControl.getAddressSettings(name);
+ Set<Role> roles = jmsServerControl.getSecuritySettings(name);
+ config[2] = roles;
+ return config;
+ }
+
+ @ManagementOperation(name = "updateQueueConfiguration", description = "updates a queues configuration",
+ params = {
+ @ManagementParameter(name = "name", description = "the queue name"),
+ @ManagementParameter(name = "jndiName", description = "The JNDI Name of the queue"),
+ @ManagementParameter(name = "dla", description = "Dead Letter Address"),
+ @ManagementParameter(name = "expiryAddress", description = "Expiry Address"),
+ @ManagementParameter(name = "maxSizeBytes", description = "Max Size of Address"),
+ @ManagementParameter(name = "pageSizeBytes", description = "Page Size"),
+ @ManagementParameter(name = "deliveryAttempts", description = "Max Delivery Attempts"),
+ @ManagementParameter(name = "redeliveryDelay", description = "Redelivery Delay"),
+ @ManagementParameter(name = "lastValueQueue", description = "Last Value Queue"),
+ @ManagementParameter(name = "redistributionDelay", description = "Redistribution Delay"),
+ @ManagementParameter(name = "sendToDLAOnNoRoute", description = "Send To DLA on no route"),
+ @ManagementParameter(name = "addressFullMessagePolicy", description = "Address Full Message Policy"),
+ @ManagementParameter(name = "sendRoles", description = "Send roles for a queue"),
+ @ManagementParameter(name = "consumeRoles", description = "consume roles for a queue")
+ })
+ public void updateQueueConfiguration(String name,
+ String jndiName,
+ String dla,
+ String expiryAddress,
+ long maxSizeBytes,
+ int pageSizeBytes,
+ int deliveryAttempts,
+ long redeliveryDelay,
+ boolean lastValueQueue,
+ long redistributionDelay,
+ boolean sendToDLAOnNoRoute,
+ String addressFullMessagePolicy,
+ String sendRoles,
+ String consumeRoles) throws Exception
+ {
+ //update the address settings
+ jmsServerControl.addAddressSettings(name,
+ dla,
+ expiryAddress,
+ lastValueQueue,
+ deliveryAttempts,
+ maxSizeBytes,
+ pageSizeBytes,
+ redeliveryDelay,
+ redistributionDelay,
+ sendToDLAOnNoRoute,
+ addressFullMessagePolicy);
+ //update security
+ jmsServerControl.addSecuritySettings(name, sendRoles, consumeRoles, "", "", "", "", "");
+ }
+
+ @ManagementOperation(name = "getQueueMeasurements", description = "updates a queues configuration",
+ params = {
+ @ManagementParameter(name = "name", description = "the queue name"),
+ @ManagementParameter(name = "names", description = "the measurement names")})
+ public String[] getQueueMeasurements(String name, String[] names) throws Exception
+ {
+ JMSQueueControl control = (JMSQueueControl) managementService.getResource(name);
+ String[] val = new String[names.length];
+ for (int i = 0, valLength = val.length; i < valLength; i++)
+ {
+ val[i] = control.getClass().getMethod(names[i]).invoke(control).toString();
+ }
+ return val;
+ }
+
+ @ManagementOperation(name = "invokeQueueOperation", description = "invokes a queues method",
+ params = {
+ @ManagementParameter(name = "name", description = "the queue name"),
+ @ManagementParameter(name = "method", description = "the method"),
+ @ManagementParameter(name = "params", description = "the method params")})
+ public Object invokeQueueOperation(String name, String method, String[] params, String[] type) throws Exception
+ {
+ JMSQueueControl control = (JMSQueueControl) managementService.getResource(name);
+ Class[] classes = getClassTypes(type);
+ Method m = control.getClass().getMethod(method, classes);
+ return m.invoke(control, getParams(params, classes));
+ }
+
+ @ManagementOperation(name = "invokeQueueOperationMessageType", description = "invokes a queues method",
+ params = {
+ @ManagementParameter(name = "name", description = "the queue name"),
+ @ManagementParameter(name = "method", description = "the method"),
+ @ManagementParameter(name = "params", description = "the method params")})
+ @MetaMapping(value = MessageListMapper.class)
+ public List invokeQueueOperationMessageType(String name, String method, String[] params, String[] type) throws Exception
+ {
+ JMSQueueControl control = (JMSQueueControl) managementService.getResource(name);
+ Class[] classes = getClassTypes(type);
+ Method m = control.getClass().getMethod(method, classes);
+ Map<String, Serializable>[] maps = (Map<String, Serializable>[]) m.invoke(control, getParams(params, classes));
+ List list = new ArrayList();
+ list.addAll(Arrays.asList(maps));
+ return list;
+ }
+
+ @ManagementOperation(name = "getJMSQueues", description = "returns the JMS Queues")
+ public String[] getJMSQueues()
+ {
+ return jmsServerControl.getQueueNames();
+ }
+}
Modified: trunk/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml
===================================================================
--- trunk/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml 2010-03-24 10:04:32 UTC (rev 102867)
+++ trunk/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml 2010-03-24 10:06:38 UTC (rev 102868)
@@ -41,7 +41,7 @@
</property>
</bean>
- <bean name="JMSQueueManageMO" class="org.jboss.as.integration.hornetq.management.jms.QueueManageImplMO">
+ <bean name="JMSQueueManageMO" class="org.jboss.as.integration.hornetq.management.jms.QueueManageMO">
<constructor><parameter><inject bean="HornetQServer" /></parameter></constructor>
<demand>JMSServerManager</demand>
</bean>
More information about the jboss-cvs-commits
mailing list