[jboss-cvs] JBossAS SVN: r102488 - in branches/Branch_Hornet_Temporary_2/hornetq-int/src: main/java/org/jboss/as/integration/hornetq/jopr/util and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Mar 16 17:57:27 EDT 2010


Author: ataylor
Date: 2010-03-16 17:57:26 -0400 (Tue, 16 Mar 2010)
New Revision: 102488

Added:
   branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/QueueManagerComponent.java
   branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/QueueManagerDiscoveryComponent.java
   branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/util/ManagementSupport.java
   branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/AddressSettingsMapper.java
Modified:
   branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueComponent2.java
   branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueDiscoveryComponent2.java
   branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/MessageListMapper.java
   branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/QueueManageImplMO.java
   branches/Branch_Hornet_Temporary_2/hornetq-int/src/resources/META-INF/rhq-plugin.xml
   branches/Branch_Hornet_Temporary_2/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml
Log:
more admin console stuff


Modified: branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueComponent2.java
===================================================================
--- branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueComponent2.java	2010-03-16 21:17:22 UTC (rev 102487)
+++ branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueComponent2.java	2010-03-16 21:57:26 UTC (rev 102488)
@@ -1,19 +1,29 @@
 package org.jboss.as.integration.hornetq.jopr;
 
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.measurement.AvailabilityType;
-import org.rhq.core.domain.measurement.MeasurementReport;
-import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.jboss.as.integration.hornetq.jopr.util.*;
+import org.jboss.as.integration.hornetq.management.jms.AddressSettingsMapper;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedOperation;
+import org.jboss.metatype.api.types.ArrayMetaType;
+import org.jboss.metatype.api.types.ImmutableCompositeMetaType;
+import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.*;
+import org.rhq.core.domain.configuration.*;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinition;
+import org.rhq.core.domain.measurement.*;
 import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
 import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
-import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
-import org.rhq.core.pluginapi.inventory.ResourceComponent;
-import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.core.pluginapi.content.ContentFacet;
+import org.rhq.core.pluginapi.inventory.*;
 import org.rhq.core.pluginapi.measurement.MeasurementFacet;
 import org.rhq.core.pluginapi.operation.OperationFacet;
 import org.rhq.core.pluginapi.operation.OperationResult;
 
-import java.util.Set;
+import java.util.*;
 
 /**
  * Created by IntelliJ IDEA.
@@ -24,38 +34,314 @@
  */
 public class JMSQueueComponent2 implements ResourceComponent, MeasurementFacet, OperationFacet, ConfigurationFacet
 {
-   public void getValues(MeasurementReport measurementReport, Set<MeasurementScheduleRequest> measurementScheduleRequests) throws Exception
+   private ResourceContext resourceContext;
+
+   private ComponentType queueComponentType = new ComponentType("JMSDestinationManage", "QueueManage");
+
+   String queueComponentName = "JMSQueueManageMO";
+
+   public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> measurementScheduleRequests) throws Exception
    {
-      //To change body of implemented methods use File | Settings | File Templates.
+      ArrayValueSupport support = new ArrayValueSupport(new ArrayMetaType(SimpleMetaType.STRING, false));
+      SimpleValueSupport[] valueSupports = new SimpleValueSupport[measurementScheduleRequests.size()];
+      Iterator<MeasurementScheduleRequest> it = measurementScheduleRequests.iterator();
+      for (int i = 0, valueSupportsLength = valueSupports.length; i < valueSupportsLength; i++)
+      {
+         valueSupports[i] = new SimpleValueSupport(SimpleMetaType.STRING, it.next().getName());
+      }
+      support.setValue(valueSupports);
+      ManagementView view = ManagementSupport.connect();
+
+      ManagedOperation operation = ManagementSupport.getOperation(view, queueComponentName, "getQueueMeasurements", queueComponentType);
+      ArrayValueSupport vals = (ArrayValueSupport) operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, resourceContext.getResourceKey()), support);
+      it = measurementScheduleRequests.iterator();
+      for (int i = 0, valueSupportsLength = valueSupports.length; i < valueSupportsLength; i++)
+      {
+         MeasurementScheduleRequest request = it.next();
+         SimpleValueSupport simpleValueSupport = (SimpleValueSupport) vals.getValue(i);
+         simpleValueSupport.getValue();
+         if (request.getDataType().equals(DataType.MEASUREMENT))
+         {
+            report.addData(new MeasurementDataNumeric(request, Double.valueOf(simpleValueSupport.getValue().toString())));
+         }
+         else if (request.getDataType().equals(DataType.TRAIT))
+         {
+            report.addData(new MeasurementDataTrait(request, simpleValueSupport.getValue().toString()));
+         }
+      }
    }
 
    public OperationResult invokeOperation(String s, Configuration configuration) throws InterruptedException, Exception
    {
-      return null;  //To change body of implemented methods use File | Settings | File Templates.
+      Operation oper = Operation.getOperation(s);
+      Collection<PropertySimple> props = configuration.getSimpleProperties().values();
+      SimpleValueSupport[] params = new SimpleValueSupport[props.size()];
+      SimpleValueSupport[] signature = new SimpleValueSupport[props.size()];
+      populateParams(props, params, signature);
+      ArrayValueSupport param = new ArrayValueSupport(new ArrayMetaType(SimpleMetaType.STRING, false));
+      param.setValue(params);
+      ArrayValueSupport sig = new ArrayValueSupport(new ArrayMetaType(SimpleMetaType.STRING, false));
+      sig.setValue(signature);
+      SimpleValueSupport queueName = new SimpleValueSupport(SimpleMetaType.STRING, resourceContext.getResourceKey());
+      SimpleValueSupport methodName = new SimpleValueSupport(SimpleMetaType.STRING, oper.getOperationName());
+      ManagementView view = ManagementSupport.connect();
+      String methodOperation = "invokeQueueOperation";
+      if("JMSMessage".equalsIgnoreCase(oper.getResultsType()))
+      {
+         methodOperation = "invokeQueueOperationMessageType";
+      }
+      ManagedOperation operation = ManagementSupport.getOperation(view, queueComponentName, methodOperation, queueComponentType);
+      Object result = operation.invoke(queueName, methodName, param, sig);
+      if (result == null)
+      {
+         return null;
+      }
+      return formatResults(result, oper.getResultsType());
    }
 
+
    public AvailabilityType getAvailability()
    {
-      return null;  //To change body of implemented methods use File | Settings | File Templates.
+      return AvailabilityType.UP;
    }
 
    public Configuration loadResourceConfiguration() throws Exception
    {
-      return null;  //To change body of implemented methods use File | Settings | File Templates.
+      Configuration config = new Configuration();
+      ManagementView view = ManagementSupport.connect();
+
+      ManagedOperation operation = ManagementSupport.getOperation(view, queueComponentName, "getQueueConfiguration", queueComponentType);
+
+      CompositeValueSupport val = (CompositeValueSupport) operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, resourceContext.getResourceKey()));
+
+      ConfigurationDefinition configDef = resourceContext.getResourceType().getResourceConfigurationDefinition();
+      List<PropertyDefinition> propertyDefinitionList = configDef.getPropertiesInGroup("HornetQCustomProperties");
+      for (PropertyDefinition definition : propertyDefinitionList)
+      {
+         String name = definition.getName();
+         if (val.containsKey(name))
+         {
+            SimpleValueSupport attr = (SimpleValueSupport) val.get(name);
+            PropertySimple simple = new PropertySimple(name, attr.getValue());
+            config.put(simple);
+         }
+      }
+      return config;
    }
 
    public void updateResourceConfiguration(ConfigurationUpdateReport configurationUpdateReport)
    {
-      //To change body of implemented methods use File | Settings | File Templates.
+      configurationUpdateReport.setStatus(ConfigurationUpdateStatus.INPROGRESS);
+
+      ManagementView view = ManagementSupport.connect();
+      Map<String, PropertySimple> simpleProps = configurationUpdateReport.getConfiguration().getSimpleProperties();
+      String name = simpleProps.get("name").getStringValue();
+      String jndiName = simpleProps.get("jndiBindings").getStringValue();
+      String DLA = simpleProps.get("dla").getStringValue();
+      String expiryAddress = simpleProps.get("expiryAddress").getStringValue();
+      int maxSize = simpleProps.get("maxSize").getIntegerValue();
+      int pageSize = simpleProps.get("pageSize").getIntegerValue();
+      int maxDeliveryAttempts = simpleProps.get("maxDeliveryAttempts").getIntegerValue();
+      long redeliveryDelay = simpleProps.get("redeliveryDelay").getLongValue();
+      boolean lastValueQueue = simpleProps.get("lastValueQueue").getBooleanValue();
+      long redistributionDelay = simpleProps.get("redistributionDelay").getLongValue();
+      boolean sendToDLAOnNoRoute = simpleProps.get("sendToDLAOnNoRoute").getBooleanValue();
+      String addressFullMessagePolicy = simpleProps.get("addressFullMessagePolicy").getStringValue();
+
+
+      StringBuffer sendRoles = new StringBuffer();
+      StringBuffer consumeRoles = new StringBuffer();
+      name = createRoles(configurationUpdateReport, name, sendRoles, consumeRoles);
+      try
+      {
+         ManagedOperation operation = ManagementSupport.getOperation(view, queueComponentName, "updateQueueConfiguration", queueComponentType);
+         operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, name),
+             new SimpleValueSupport(SimpleMetaType.STRING, jndiName),
+             new SimpleValueSupport(SimpleMetaType.STRING, DLA),
+             new SimpleValueSupport(SimpleMetaType.STRING, expiryAddress),
+             new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, maxSize),
+             new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, pageSize),
+             new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, maxDeliveryAttempts),
+             new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, redeliveryDelay),
+             new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, lastValueQueue),
+             new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, redistributionDelay),
+             new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, sendToDLAOnNoRoute),
+             new SimpleValueSupport(SimpleMetaType.STRING, addressFullMessagePolicy),
+             new SimpleValueSupport(SimpleMetaType.STRING, sendRoles.toString()),
+             new SimpleValueSupport(SimpleMetaType.STRING, consumeRoles.toString()));
+      }
+      catch (Exception e)
+      {
+         configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE);
+         configurationUpdateReport.setErrorMessage(e.getMessage());
+         e.printStackTrace();
+         return;
+      }
+      configurationUpdateReport.setStatus(ConfigurationUpdateStatus.SUCCESS);
    }
 
+   private String createRoles(ConfigurationUpdateReport configurationUpdateReport, String name, StringBuffer sendRoles, StringBuffer consumeRoles)
+   {
+      PropertyList propertyList = (PropertyList) configurationUpdateReport.getConfiguration().get("securityConfig");
+      List<Property> roles = propertyList.getList();
+      for (Property role : roles)
+      {
+         PropertyMap actRole = (PropertyMap) role;
+         String roleName;
+         boolean send;
+         boolean consume;
+         PropertySimple simple = (PropertySimple) actRole.get("name");
+         name = simple.getStringValue();
+         simple = (PropertySimple) actRole.get("send");
+         send = simple.getBooleanValue();
+         simple = (PropertySimple) actRole.get("consume");
+         consume = simple.getBooleanValue();
+         if(send)
+         {
+            if(sendRoles.length() > 0)
+            {
+               sendRoles.append(",");
+            }
+            sendRoles.append(name);
+         }
+         if(consume)
+         {
+            if(consumeRoles.length() > 0)
+            {
+               consumeRoles.append(",");
+            }
+            consumeRoles.append(name);
+         }
+      }
+      return name;
+   }
+
    public void start(ResourceContext resourceContext) throws InvalidPluginConfigurationException, Exception
    {
-      //To change body of implemented methods use File | Settings | File Templates.
+      this.resourceContext = resourceContext;
    }
 
    public void stop()
    {
-      //To change body of implemented methods use File | Settings | File Templates.
+      this.resourceContext = null;
    }
-}
+
+   private void populateParams(final Collection<PropertySimple> props, final SimpleValueSupport[] params, final SimpleValueSupport[] signature)
+   {
+      int pos = 0;
+      for (PropertySimple prop : props)
+      {
+         String[] val = prop.getName().split(":");
+         if (val.length == 1)
+         {
+            params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getStringValue()));
+            signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "java.lang.String");
+         }
+         else
+         {
+            if (val[0].equals("Boolean"))
+            {
+               params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getBooleanValue()));
+               signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "java.lang.Boolean");
+            }
+            else if (val[0].equals("boolean"))
+            {
+               params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getBooleanValue()));
+               signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "boolean");
+            }
+            else if (val[0].equals("String"))
+            {
+               params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getStringValue()));
+               signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "java.lang.String");
+            }
+            else if (val[0].equals("Long"))
+            {
+               params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getLongValue()));
+               signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "java.lang.Long");
+            }
+            else if (val[0].equals("long"))
+            {
+               params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getLongValue()));
+               signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "long");
+            }
+            else if (val[0].equals("Integer"))
+            {
+               params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getIntegerValue()));
+               signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "java.lang.Integer");
+            }
+            else if (val[0].equals("int"))
+            {
+               params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getIntegerValue()));
+               signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "int");
+            }
+            else if (val[0].equals("Double"))
+            {
+               params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getDoubleValue()));
+               signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "java.lang.Double");
+            }
+            else if (val[0].equals("double"))
+            {
+               params[pos] = new SimpleValueSupport(SimpleMetaType.STRING, getStringValue(prop.getDoubleValue()));
+               signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING, "double");
+            }
+         }
+         pos++;
+      }
+   }
+
+   private String getStringValue(Object o)
+   {
+      return o == null ? "null" : o.toString();
+   }
+
+
+   private OperationResult formatResults(Object val, String type) throws Exception
+   {
+      if (type == null)
+      {
+         SimpleValueSupport valueSupport = (SimpleValueSupport) val;
+         return new OperationResult(valueSupport.getValue().toString());
+      }
+      else if(type.equalsIgnoreCase("String"))
+      {
+         SimpleValueSupport valueSupport = (SimpleValueSupport) val;
+         return new OperationResult(valueSupport.getValue().toString());
+      }
+      else if(type.equalsIgnoreCase("JMSMessage"))
+      {
+         OperationResult operationResult = new OperationResult();
+         Configuration c = operationResult.getComplexResults();
+         PropertyList property = new PropertyList("result");
+         CollectionValueSupport valueSupport = (CollectionValueSupport) val;
+         MetaValue[] msgs =  valueSupport.getElements();
+         for (MetaValue mv : msgs)
+         {
+            CompositeValueSupport msg = (CompositeValueSupport) mv;
+            org.rhq.core.domain.configuration.PropertyMap p1 = new org.rhq.core.domain.configuration.PropertyMap("element");
+            property.add(p1);
+            ImmutableCompositeMetaType metaType = (ImmutableCompositeMetaType) msg.getMetaType();
+            Set<String> keys = metaType.keySet();
+            for (String key : keys)
+            {
+               SimpleValueSupport sattr = (SimpleValueSupport) msg.get(key);
+               p1.put(new PropertySimple(key,sattr.getValue()));
+            }
+         }
+         c.put(property);
+         return operationResult;
+      }
+      else if (val instanceof CompositeValueSupport)
+      {
+         CompositeValueSupport valueSupport = (CompositeValueSupport) val;
+         if (valueSupport.containsKey("cause"))
+         {
+            CompositeValueSupport cause = (CompositeValueSupport) valueSupport.get("cause");
+            SimpleValueSupport message = (SimpleValueSupport) cause.get("message");
+            Exception exception = new Exception(message.toString());
+            throw exception;
+         }
+         return new OperationResult("not yet");
+      }
+      return new OperationResult("not yet");
+   }
+}
\ No newline at end of file

Modified: branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueDiscoveryComponent2.java
===================================================================
--- branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueDiscoveryComponent2.java	2010-03-16 21:17:22 UTC (rev 102487)
+++ branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueDiscoveryComponent2.java	2010-03-16 21:57:26 UTC (rev 102488)
@@ -7,13 +7,12 @@
 import org.jboss.managed.api.ComponentType;
 import org.jboss.managed.api.ManagedComponent;
 import org.jboss.managed.api.ManagedOperation;
+import org.jboss.metatype.api.values.ArrayValueSupport;
 import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.SimpleValueSupport;
 import org.rhq.core.domain.configuration.Configuration;
 import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
-import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.core.pluginapi.inventory.*;
 
 import java.util.HashSet;
 import java.util.Set;
@@ -29,28 +28,41 @@
 {
    public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext resourceDiscoveryContext) throws InvalidPluginConfigurationException, Exception
    {
+      Set<DiscoveredResourceDetails> set = new HashSet<DiscoveredResourceDetails>();
       ProfileServiceConnectionProvider connectionProvider = new LocalProfileServiceConnectionProvider();
       ProfileServiceConnection connection = connectionProvider.connect();
       ManagementView managementView = connection.getManagementView();
-      ManagedComponent component = managementView.getComponent("QueueManageMO", new ComponentType("JMSDestinationManage", "QueueManage"));
+      ManagedComponent component = managementView.getComponent("JMSQueueManageMO", new ComponentType("JMSDestinationManage", "QueueManage"));
       Set<ManagedOperation> operations = component.getOperations();
       for (ManagedOperation operation : operations)
       {
          if (operation.getName().equals("getJMSQueues"))
          {
-            MetaValue value = operation.invoke();
+            ArrayValueSupport value = (ArrayValueSupport) operation.invoke();
+
+            for(int i = 0; i < value.getLength(); i++)
+            {
+               Configuration configuration = new Configuration();
+               SimpleValueSupport queue = (SimpleValueSupport) value.getValue(i);
+               ResourceType resourceType = resourceDiscoveryContext.getResourceType();
+               String queueName = "jms.queue." + queue.getValue();
+               set.add(new DiscoveredResourceDetails(resourceType,
+                   queueName,
+                   queueName,
+                   "a JMS Queue",
+                   "",
+                   configuration,
+                   null));
+            }
             break;
          }
       }
-      ResourceType resourceType = resourceDiscoveryContext.getResourceType();
-      Set<DiscoveredResourceDetails> set = new HashSet<DiscoveredResourceDetails>();
-      set.add(new DiscoveredResourceDetails(resourceType,
-          "queue",
-          "queue",
-          "desc",
-          "",
-          new Configuration(),
-          null));
+
       return set;
    }
+
+   public CreateResourceReport createResource(CreateResourceReport createResourceReport)
+   {
+      return null;  //To change body of implemented methods use File | Settings | File Templates.
+   }
 }

Added: branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/QueueManagerComponent.java
===================================================================
--- branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/QueueManagerComponent.java	                        (rev 0)
+++ branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/QueueManagerComponent.java	2010-03-16 21:57:26 UTC (rev 102488)
@@ -0,0 +1,96 @@
+package org.jboss.as.integration.hornetq.jopr;
+
+import org.jboss.as.integration.hornetq.jopr.util.LocalProfileServiceConnectionProvider;
+import org.jboss.as.integration.hornetq.jopr.util.ManagementSupport;
+import org.jboss.as.integration.hornetq.jopr.util.ProfileServiceConnection;
+import org.jboss.as.integration.hornetq.jopr.util.ProfileServiceConnectionProvider;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedOperation;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.ArrayValueSupport;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.content.PackageDetailsKey;
+import org.rhq.core.domain.content.transfer.ResourcePackageDetails;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.domain.resource.CreateResourceStatus;
+import org.rhq.core.pluginapi.inventory.*;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy
+ * Date: 11-Mar-2010
+ * Time: 16:03:42
+ * To change this template use File | Settings | File Templates.
+ */
+public class QueueManagerComponent implements ResourceComponent, CreateChildResourceFacet
+{
+   public CreateResourceReport createResource(CreateResourceReport createResourceReport)
+   {
+      createResourceReport.setStatus(CreateResourceStatus.IN_PROGRESS);
+      ManagementView managementView = ManagementSupport.connect();
+      Map<String, PropertySimple> simpleProps = createResourceReport.getResourceConfiguration().getSimpleProperties();
+
+      String name = simpleProps.get("name").getStringValue();
+      String jndiName = simpleProps.get("jndiBindings").getStringValue();
+      String DLA = simpleProps.get("dla").getStringValue();
+      String expiryAddress = simpleProps.get("expiryAddress").getStringValue();
+      int maxSize = simpleProps.get("maxSize").getIntegerValue();
+      int pageSize = simpleProps.get("pageSize").getIntegerValue();
+      int maxDeliveryAttempts = simpleProps.get("maxDeliveryAttempts").getIntegerValue();
+      long redeliveryDelay = simpleProps.get("redeliveryDelay").getLongValue();
+      boolean lastValueQueue = simpleProps.get("lastValueQueue").getBooleanValue();
+      long redistributionDelay = simpleProps.get("redistributionDelay").getLongValue();
+      boolean sendToDLAOnNoRoute = simpleProps.get("sendToDLAOnNoRoute").getBooleanValue();
+      String addressFullMessagePolicy = simpleProps.get("addressFullMessagePolicy").getStringValue();
+      try
+      {
+         ManagedOperation operation = ManagementSupport.getOperation(managementView, "QueueManageMO", "createQueue", new ComponentType("JMSDestinationManage", "QueueManage"));
+
+         operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, name),
+             new SimpleValueSupport(SimpleMetaType.STRING, jndiName),
+             new SimpleValueSupport(SimpleMetaType.STRING, DLA),
+             new SimpleValueSupport(SimpleMetaType.STRING, expiryAddress),
+             new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, maxSize),
+             new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, pageSize),
+             new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, maxDeliveryAttempts),
+             new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, redeliveryDelay),
+             new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, lastValueQueue),
+             new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, redistributionDelay),
+             new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, sendToDLAOnNoRoute),
+             new SimpleValueSupport(SimpleMetaType.STRING, addressFullMessagePolicy));
+         createResourceReport.setStatus(CreateResourceStatus.SUCCESS);
+
+      }
+      catch (Exception e)
+      {
+         createResourceReport.setStatus(CreateResourceStatus.FAILURE);
+         createResourceReport.setErrorMessage(e.getMessage());
+         e.printStackTrace();
+      }
+      return createResourceReport;
+   }
+
+
+   public void start(ResourceContext resourceContext) throws InvalidPluginConfigurationException, Exception
+   {
+      //To change body of implemented methods use File | Settings | File Templates.
+   }
+
+   public void stop()
+   {
+      //To change body of implemented methods use File | Settings | File Templates.
+   }
+
+   public AvailabilityType getAvailability()
+   {
+      return AvailabilityType.UP;
+   }
+}

Added: branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/QueueManagerDiscoveryComponent.java
===================================================================
--- branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/QueueManagerDiscoveryComponent.java	                        (rev 0)
+++ branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/QueueManagerDiscoveryComponent.java	2010-03-16 21:57:26 UTC (rev 102488)
@@ -0,0 +1,35 @@
+package org.jboss.as.integration.hornetq.jopr;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy
+ * Date: 11-Mar-2010
+ * Time: 16:02:33
+ * To change this template use File | Settings | File Templates.
+ */
+public class QueueManagerDiscoveryComponent implements ResourceDiscoveryComponent
+{
+   public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext ctx) throws InvalidPluginConfigurationException, Exception
+   {
+      DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
+                  ctx.getResourceType(), // Resource type
+                  ctx.getResourceType().getName(), // Resource key
+                  ctx.getResourceType().getName(), // Resource name
+                  null, // Resource version
+                  ctx.getResourceType().getDescription(), // Description
+                  ctx.getDefaultPluginConfiguration(), // Plugin config
+                  null // Process info from a process scan
+            );
+      return Collections.singleton(detail);
+   }
+}

Added: branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/util/ManagementSupport.java
===================================================================
--- branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/util/ManagementSupport.java	                        (rev 0)
+++ branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/util/ManagementSupport.java	2010-03-16 21:57:26 UTC (rev 102488)
@@ -0,0 +1,39 @@
+package org.jboss.as.integration.hornetq.jopr.util;
+
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedOperation;
+
+import java.util.Set;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy
+ * Date: 16-Mar-2010
+ * Time: 15:57:23
+ * To change this template use File | Settings | File Templates.
+ */
+public class ManagementSupport
+{
+   public static ManagementView connect()
+   {
+      ProfileServiceConnectionProvider connectionProvider = new LocalProfileServiceConnectionProvider();
+      ProfileServiceConnection connection = connectionProvider.connect();
+      return connection.getManagementView();
+   }
+
+   public static ManagedOperation getOperation(ManagementView view, String componentName, String operName, ComponentType componentType) throws Exception
+   {
+      ManagedComponent component = view.getComponent(componentName, componentType);
+      Set<ManagedOperation> operations = component.getOperations();
+      for (ManagedOperation operation : operations)
+      {
+         if (operation.getName().equals(operName))
+         {
+            return operation;
+         }
+      }
+      throw new IllegalArgumentException(" no operation available " + operName);
+   }
+}

Added: branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/AddressSettingsMapper.java
===================================================================
--- branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/AddressSettingsMapper.java	                        (rev 0)
+++ branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/AddressSettingsMapper.java	2010-03-16 21:57:26 UTC (rev 102488)
@@ -0,0 +1,122 @@
+package org.jboss.as.integration.hornetq.management.jms;
+
+import org.hornetq.core.settings.impl.AddressSettings;
+import org.hornetq.jms.server.config.JMSQueueConfiguration;
+import org.jboss.metatype.api.types.*;
+import org.jboss.metatype.api.values.CompositeValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.jboss.metatype.spi.values.MetaMapper;
+
+import java.lang.reflect.Type;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy
+ * Date: 15-Mar-2010
+ * Time: 11:38:58
+ * To change this template use File | Settings | File Templates.
+ */
+public class AddressSettingsMapper extends MetaMapper<Object[]>
+{
+   public static final CompositeMetaType ADDRESS_SETTINGS_TYPE;
+   static
+   {
+      String[] itemNames = {
+            "name",
+            "jndiBindings",
+            "dla",
+            "expiryAddress",
+            "maxSize",
+            "pageSize",
+            "maxDeliveryAttempts",
+            "redeliveryDelay",
+            "lastValueQueue",
+            "redistributionDelay",
+            "sendToDLAOnNoRoute",
+            "addressFullMessagePolicy"
+      };
+      String[] itemDescriptions = {
+            "name",
+            "jndiBindings",
+            "dla",
+            "expiryAddress",
+            "maxSize",
+            "pageSize",
+            "maxDeliveryAttempts",
+            "redeliveryDelay",
+            "lastValueQueue",
+            "redistributionDelay",
+            "sendToDLAOnNoRoute",
+            "addressFullMessagePolicy"
+      };
+      MetaType[] itemTypes = {
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.INTEGER_PRIMITIVE,
+            SimpleMetaType.INTEGER_PRIMITIVE,
+            SimpleMetaType.INTEGER_PRIMITIVE,
+            SimpleMetaType.LONG_PRIMITIVE,
+            SimpleMetaType.BOOLEAN_PRIMITIVE,
+            SimpleMetaType.LONG_PRIMITIVE,
+            SimpleMetaType.BOOLEAN_PRIMITIVE,
+            SimpleMetaType.STRING
+      };
+      ADDRESS_SETTINGS_TYPE = new ImmutableCompositeMetaType("org.hornetq.core.settings.impl.AddressSettings", "Address Settings",
+            itemNames, itemDescriptions, itemTypes);
+   }
+   @Override
+   public MetaValue createMetaValue(MetaType metaType, Object[] val)
+   {
+      CompositeValueSupport cvs = new CompositeValueSupport(ADDRESS_SETTINGS_TYPE);
+      JMSQueueConfiguration queueConfiguration = (JMSQueueConfiguration) val[0];
+      cvs.set("name", new SimpleValueSupport(SimpleMetaType.STRING, queueConfiguration.getName()));
+      cvs.set("jndiBindings", new SimpleValueSupport(SimpleMetaType.STRING, getJndiString(queueConfiguration.getBindings())));
+      AddressSettings addressSettings = (AddressSettings) val[1];
+      cvs.set("dla", new SimpleValueSupport(SimpleMetaType.STRING, addressSettings.getDeadLetterAddress()));
+      cvs.set("expiryAddress", new SimpleValueSupport(SimpleMetaType.STRING, addressSettings.getExpiryAddress()));
+      cvs.set("maxSize", new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, addressSettings.getMaxSizeBytes()));
+      cvs.set("pageSize", new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, addressSettings.getPageSizeBytes()));
+      cvs.set("maxDeliveryAttempts", new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, addressSettings.getMaxDeliveryAttempts()));
+      cvs.set("redeliveryDelay", new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, addressSettings.getRedeliveryDelay()));
+      cvs.set("lastValueQueue", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, addressSettings.isLastValueQueue()));
+      cvs.set("redistributionDelay", new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, addressSettings.getRedistributionDelay()));
+      cvs.set("sendToDLAOnNoRoute", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, addressSettings.isSendToDLAOnNoRoute()));
+      cvs.set("addressFullMessagePolicy", new SimpleValueSupport(SimpleMetaType.STRING, addressSettings.getAddressFullMessagePolicy()));
+      return cvs;
+   }
+
+   @Override
+   public Object[] unwrapMetaValue(MetaValue metaValue)
+   {
+      return null;
+   }
+
+   @Override
+   public Type mapToType()
+   {
+      return Object[].class;
+   }
+
+   @Override
+   public MetaType getMetaType()
+   {
+      return ADDRESS_SETTINGS_TYPE;
+   }
+
+   private String getJndiString(String[] array)
+   {
+      StringBuffer sb = new StringBuffer();
+      for (int i = 0, arrayLength = array.length; i < arrayLength; i++)
+      {
+         if(i > 0)
+         {
+            sb.append(",");
+         }
+         sb.append(array[i]);
+      }
+      return sb.toString();
+   }
+}

Modified: branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/MessageListMapper.java
===================================================================
--- branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/MessageListMapper.java	2010-03-16 21:17:22 UTC (rev 102487)
+++ branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/MessageListMapper.java	2010-03-16 21:57:26 UTC (rev 102488)
@@ -21,9 +21,11 @@
  */
 package org.jboss.as.integration.hornetq.management.jms;
 
+import java.io.Serializable;
 import java.lang.reflect.Type;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 import javax.jms.Message;
 
@@ -44,7 +46,7 @@
  * @author Scott.Stark at jboss.org
  * @version $Revision: 90349 $
  */
-public class MessageListMapper extends MetaMapper<List<Message>>
+public class MessageListMapper extends MetaMapper<List>
 {
    private static final Logger log = Logger.getLogger(MessageListMapper.class);
    public static final CollectionMetaType TYPE;
@@ -55,16 +57,22 @@
       String[] itemNames = {
             "JMSMessageID",
             "JMSTimestamp",
-            "JMSCorrelationID"
+            "JMSPriority",
+            "JMSDeliveryMode",
+            "JMSExpiration"
       };
       String[] itemDescriptions = {
             "JMSMessageID",
             "JMSTimestamp",
-            "JMSCorrelationID"
+            "JMSPriority",
+            "JMSDeliveryMode",
+            "JMSExpiration"
       };
       MetaType[] itemTypes = {
             SimpleMetaType.STRING,
-            SimpleMetaType.LONG_PRIMITIVE,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
             SimpleMetaType.STRING
       };
       MSG_TYPE = new ImmutableCompositeMetaType("javax.jms.Message", "JMS Message",
@@ -73,19 +81,22 @@
    }
 
    @Override
-   public MetaValue createMetaValue(MetaType metaType, List<Message> object)
+   public MetaValue createMetaValue(MetaType metaType, List object)
    {
       ArrayList<MetaValue> tmp = new ArrayList<MetaValue>();
       if(object != null)
       {
-         for(Message m : object)
+         for(Object o : object)
          {
+            Map m = (Map) o;
             try
             {
                CompositeValueSupport cvs = new CompositeValueSupport(MSG_TYPE);
-               cvs.set("JMSCorrelationID", SimpleValueSupport.wrap(m.getJMSCorrelationID()));
-               cvs.set("JMSTimestamp", SimpleValueSupport.wrap(m.getJMSTimestamp()));
-               cvs.set("JMSMessageID", SimpleValueSupport.wrap(m.getJMSMessageID()));
+               cvs.set("JMSMessageID", SimpleValueSupport.wrap((Serializable) m.get("JMSMessageID").toString()));
+               cvs.set("JMSTimestamp", SimpleValueSupport.wrap((Serializable) m.get("JMSTimestamp").toString()));
+               cvs.set("JMSPriority", SimpleValueSupport.wrap((Serializable) m.get("JMSPriority").toString()));
+               cvs.set("JMSDeliveryMode", SimpleValueSupport.wrap((Serializable) m.get("JMSDeliveryMode").toString()));
+               cvs.set("JMSExpiration", SimpleValueSupport.wrap((Serializable) m.get("JMSExpiration").toString()));
                tmp.add(cvs);
             }
             catch(Exception e)
@@ -116,7 +127,7 @@
     * This always returns null as Messages cannot be created from a meta value
     */
    @Override
-   public List<Message> unwrapMetaValue(MetaValue metaValue)
+   public List unwrapMetaValue(MetaValue metaValue)
    {
       // TODO Auto-generated method stub
       return null;

Modified: branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/QueueManageImplMO.java
===================================================================
--- branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/QueueManageImplMO.java	2010-03-16 21:17:22 UTC (rev 102487)
+++ branches/Branch_Hornet_Temporary_2/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/QueueManageImplMO.java	2010-03-16 21:57:26 UTC (rev 102488)
@@ -1,12 +1,22 @@
 package org.jboss.as.integration.hornetq.management.jms;
 
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.api.core.management.HornetQServerControl;
 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.server.HornetQServer;
 import org.hornetq.core.server.management.ManagementService;
-import org.hornetq.jms.server.JMSServerManager;
+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.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.*;
+
 /**
  * Created by IntelliJ IDEA.
  * User: andy
@@ -14,13 +24,14 @@
  * Time: 14:48:43
  * To change this template use File | Settings | File Templates.
  */
- at ManagementObject( componentType = @ManagementComponent(type = "JMSDestinationManage", subtype = "QueueManage"),
-      properties = ManagementProperties.EXPLICIT, isRuntime = true)
+ at ManagementObject(componentType = @ManagementComponent(type = "JMSDestinationManage", subtype = "QueueManage"),
+    properties = ManagementProperties.EXPLICIT, isRuntime = true)
 public class QueueManageImplMO
 {
    private JMSServerControl jmsServerControl;
    private ManagementService managementService;
    private HornetQServer server;
+   private HornetQServerControl hornetQServerControl;
 
    public QueueManageImplMO(HornetQServer server)
    {
@@ -31,33 +42,237 @@
    {
       managementService = server.getManagementService();
       jmsServerControl = (JMSServerControl) managementService.getResource(ResourceNames.JMS_SERVER);
+      hornetQServerControl = (HornetQServerControl) managementService.getResource(ResourceNames.CORE_SERVER);
    }
+
    @ManagementOperation(name = "createQueue", description = "Creates a new Queue",
-       params ={
+       params = {
            @ManagementParameter(name = "name", description = "the queue name"),
-           @ManagementParameter(name = "address", description = "the queue address"),
-           @ManagementParameter(name = "DLA", description = "the dead letter address"),
-           @ManagementParameter(name = "ExpiryAddress", description = "the queue expiry address")
+           @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 address, String DLA, String DLQ) throws Exception
+   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, address);
-      //update the address settings
+      jmsServerControl.createQueue(name, jndiName);
+      //update security
+      jmsServerControl.addSecuritySettings(sendRoles, consumeRoles, null, null, null, null, null, null);
    }
-   @ManagementOperation(name = "getJMSQueues", description = "returns the JMS Queues")
-   public String[] getJMSQueues()
+
+   @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)
    {
-      return jmsServerControl.getQueueNames();
+      Object[] config = new Object[2];
+      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);
+      return config;
    }
 
-   public String getQueueConfiguration(String name)
+   @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")
+       })
+   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) throws Exception
    {
-      return null;  //probably not a string
+      jmsServerControl.addAddressSettings("jms.queue." + name,
+          dla,
+          expiryAddress,
+          lastValueQueue,
+          deliveryAttempts,
+          maxSizeBytes,
+          pageSizeBytes,
+          redeliveryDelay,
+          redistributionDelay,
+          sendToDLAOnNoRoute,
+          addressFullMessagePolicy);
    }
 
-   public void updateQueueConfiguration(String name, String DLA, String ExpiryAddress)
+   @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
    {
-      //update the address settings of this queue
+      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);
+      try
+      {
+         return m.invoke(control, getParams(params, classes));
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         return e;
+      }
+   }
+
+   @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);
+      try
+      {
+         Map<String, Serializable>[] maps = (Map<String, Serializable>[]) m.invoke(control, getParams(params, classes));
+         List list = new ArrayList();
+         list.addAll(Arrays.asList(maps));
+         return list;
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         return Collections.singletonList(e);
+      }
+   }
+
+   private Object[] getParams(String[] params, Class[] classes)
+   {
+      Object[] objects = new Object[params.length];
+      for (int i = 0, objectsLength = objects.length; i < objectsLength; i++)
+      {
+         if("null".equalsIgnoreCase(params[i]))
+         {
+            objects[i] = null;
+         }
+         else if (classes[i] == String.class)
+         {
+            objects[i] = params[i];
+         }
+         else if (classes[i] == Double.class)
+         {
+            objects[i] = Double.valueOf(params[i]);
+         }
+         else if (classes[i] == double.class)
+         {
+            objects[i] = Double.valueOf(params[i]);
+         }
+         else if (classes[i] == Long.class)
+         {
+            objects[i] = Long.valueOf(params[i]);
+         }
+         else if (classes[i] == long.class)
+         {
+            objects[i] = Long.valueOf(params[i]);
+         }
+         else if (classes[i] == Integer.class)
+         {
+            objects[i] = Integer.valueOf(params[i]);
+         }
+         else if (classes[i] == int.class)
+         {
+            objects[i] = Integer.valueOf(params[i]);
+         }
+         else if (classes[i] == Float.class)
+         {
+            objects[i] = Float.valueOf(params[i]);
+         }
+         else if (classes[i] == float.class)
+         {
+            objects[i] = Float.valueOf(params[i]);
+         }
+      }
+      return objects;
+   }
+
+   private Class[] getClassTypes(String[] type) throws Exception
+   {
+      Class[] classes = new Class[type.length];
+      for (int i = 0, typeLength = type.length; i < typeLength; i++)
+      {
+         classes[i] = Class.forName(type[i]);
+      }
+      return classes;
+   }
+
+   @ManagementOperation(name = "getJMSQueues", description = "returns the JMS Queues")
+   public String[] getJMSQueues()
+   {
+      return jmsServerControl.getQueueNames();
+   }
 }

Modified: branches/Branch_Hornet_Temporary_2/hornetq-int/src/resources/META-INF/rhq-plugin.xml
===================================================================
--- branches/Branch_Hornet_Temporary_2/hornetq-int/src/resources/META-INF/rhq-plugin.xml	2010-03-16 21:17:22 UTC (rev 102487)
+++ branches/Branch_Hornet_Temporary_2/hornetq-int/src/resources/META-INF/rhq-plugin.xml	2010-03-16 21:57:26 UTC (rev 102488)
@@ -10,16 +10,280 @@
         xmlns:c="urn:xmlns:rhq-configuration">
 
    <depends plugin="JMX" useClasses="true"/>
+   <service name="JMS Manager"
+            discovery="QueueManagerDiscoveryComponent"
+            class="QueueManagerComponent"
+            singleton="true">
 
-
-   <service name="JMSHornetQueue"
-            discovery="JMSQueueDiscoveryComponent2"
-            class="JMSQueueComponent2">
       <runs-inside>
          <parent-resource-type name="JBossAS Server" plugin="JBossAS"/>
          <parent-resource-type name="JBossAS Server" plugin="JBossAS5"/>
          <parent-resource-type name="JBossAS Server" plugin="JBossAS6"/>
       </runs-inside>
+
+      <service name="JMS Queue"
+               discovery="JMSQueueDiscoveryComponent2"
+               class="JMSQueueComponent2"
+               createDeletePolicy="both">
+         <operation name="removeMessages" displayName="remove messages"
+                    description="Remove the messages corresponding to the given filter.">
+            <parameters>
+               <c:simple-property required="false" name="filter" displayName="A message filter"/>
+            </parameters>
+            <results>
+               <c:simple-property name="operationResult" type="integer" description="Number of removed messages."/>
+            </results>
+         </operation>
+         <operation name="listMessages,result=JMSMessage" displayName="list all the messages"
+                    description="list all the messages.">
+            <parameters>
+               <c:simple-property required="false" name="filter" displayName="A JMS message filter (can be empty)"/>
+            </parameters>
+            <results>
+               <c:list-property name="result">
+                  <c:map-property required="false" name="element">
+                     <c:simple-property type="string" name="JMSMessageID"/>
+                     <c:simple-property type="long" required="false" name="JMSTimestamp"/>
+                     <c:simple-property type="integer" required="false" name="JMSPriority"/>
+                     <c:simple-property type="long" required="false" name="JMSExpiration"/>
+                     <c:simple-property type="string" required="false" name="JMSDeliveryMode"/>
+                  </c:map-property>
+               </c:list-property>
+            </results>
+         </operation>
+         <operation name="countMessages" displayName="list all the messages"
+                    description="Returns the number of the messages in the queue matching the given filter.">
+            <parameters>
+               <c:simple-property required="false" name="selector" displayName="the selector"/>
+            </parameters>
+            <results>
+               <c:simple-property name="operationResult" type="integer"
+                                  description="Number of the messages in the queue matching the given filter."/>
+            </results>
+         </operation>
+         <operation name="removeMessage" displayName="remove message"
+                    description="Remove the message corresponding to the given messageID.">
+            <parameters>
+               <c:simple-property required="true" name="messageID" displayName="The message ID"/>
+            </parameters>
+            <results>
+               <c:simple-property name="operationResult" type="boolean" description="Was the message removed."/>
+            </results>
+         </operation>
+         <operation name="expireMessages" displayName="expire messages"
+                    description="Expires the messages corresponding to the given filter.">
+            <parameters>
+               <c:simple-property required="false" name="filter" displayName="A message filter"/>
+            </parameters>
+            <results>
+               <c:simple-property name="operationResult" type="integer" description="Number of expired messages."/>
+            </results>
+         </operation>
+         <operation name="expireMessage" displayName="expire message"
+                    description="Expire the message corresponding to the given messageID.">
+            <parameters>
+               <c:simple-property required="true" name="messageID" displayName="The message ID"/>
+            </parameters>
+            <results>
+               <c:simple-property name="operationResult" type="boolean" description="Was the message removed."/>
+            </results>
+         </operation>
+         <operation name="sendMessageToDeadLetterAddress" displayName="send message to dead letter address"
+                    description="Send the message corresponding to the given messageID to this queue's Dead Letter Address.">
+            <parameters>
+               <c:simple-property required="true" name="messageID" displayName="The message ID"/>
+            </parameters>
+            <results>
+               <c:simple-property name="operationResult" type="boolean" description="Was the message sent."/>
+            </results>
+         </operation>
+         <operation name="sendMessagesToDeadLetterAddress" displayName="send messages to dead letter address"
+                    description="Send the messages corresponding to the given filter to this queue's Dead Letter Address.">
+            <parameters>
+               <c:simple-property required="false" name="filterStr" displayName="A message filter"/>
+            </parameters>
+            <results>
+               <c:simple-property name="operationResult" type="integer" description="Number of expired messages."/>
+            </results>
+         </operation>
+         <operation name="changeMessagePriority" displayName="change message priority"
+                    description="Change the priority of the message corresponding to the given messageID.">
+            <parameters>
+               <c:simple-property required="true" name="messageID" displayName="A message ID"/>
+               <c:simple-property required="true" type="integer" name="int:newPriority"
+                                  displayName="the new priority (between 0 and 9)"/>
+            </parameters>
+            <results>
+               <c:simple-property name="operationResult" type="boolean" description="True if priority set."/>
+            </results>
+         </operation>
+         <operation name="changeMessagesPriority" displayName="change messages priority"
+                    description="Change the priority of the messages corresponding to the given filter.">
+            <parameters>
+               <c:simple-property required="false" name="filter" displayName="A message filter"/>
+               <c:simple-property required="true" type="integer" name="int:newPriority"
+                                  displayName="the new priority (between 0 and 9)"/>
+            </parameters>
+            <results>
+               <c:simple-property name="operationResult" type="integer"
+                                  description="Number of messages reset with priority."/>
+            </results>
+         </operation>
+         <operation name="moveMessage" displayName="move message"
+                    description="Move the message corresponding to the given messageID to another queue.">
+            <parameters>
+               <c:simple-property required="true" name="messageID" displayName="A message ID"/>
+               <c:simple-property required="true" name="otherQueueName"
+                                  displayName="The name of the queue to move the message to"/>
+            </parameters>
+            <results>
+               <c:simple-property name="operationResult" type="boolean" description="True if message moved."/>
+            </results>
+         </operation>
+         <operation name="moveMessages" displayName="move messages"
+                    description="Move the messages corresponding to the given filter.">
+            <parameters>
+               <c:simple-property required="false" name="filter" displayName="the filter"/>
+               <c:simple-property required="true" name="otherQueueName"
+                                  displayName="The name of the queue to move the message to"/>
+            </parameters>
+            <results>
+                <c:simple-property name="operationResult" type="integer" description="Number of moved messages."/>
+            </results>
+         </operation>
+         <operation name="listMessageCounter" displayName="list message counter"
+                    description="List the message counters.">
+            <results>
+               <c:simple-property name="operationResult" description="Message Counters."/>
+            </results>
+         </operation>
+         <operation name="resetMessageCounter" displayName="reset message counters"
+                    description="Reset the message counters.">
+         </operation>
+         <operation name="listMessageCounterAsHTML" displayName="list message counter in HTML"
+                    description="List the message counters in HTML.">
+            <results>
+               <c:simple-property name="operationResult" description="Message Counters."/>
+            </results>
+         </operation>
+         <operation name="listMessageCounterHistory" displayName="list message counter history"
+                    description="List the message counters history.">
+            <results>
+               <c:simple-property name="operationResult" description="Message Counter history."/>
+            </results>
+         </operation>
+         <operation name="listMessageCounterHistoryAsHTML" displayName="list message counter history in HTML"
+                    description="List the message counters history in HTML.">
+            <results>
+               <c:simple-property name="operationResult" description="Message Counter history."/>
+            </results>
+         </operation>
+         <operation name="pause" displayName="pause the queue" description="Pause the queue.">
+         </operation>
+         <operation name="resume" displayName="resume the queue" description="Resume the queue.">
+         </operation>
+         <metric property="getMessageCount"
+                 displayName="Message Count"
+                 description="number of messages currently in this destination"
+                 dataType="measurement" displayType="summary"/>
+         <metric property="getScheduledCount"
+                 displayName="Scheduled Count"
+                 description="number of scheduled messages in this queue"
+                 dataType="measurement" displayType="summary"/>
+         <metric property="getConsumerCount"
+                 displayName="Consumer Count"
+                 description="number of consumers consuming messages from this queue"
+                 dataType="measurement" displayType="summary"/>
+         <metric property="getDeliveringCount"
+                 displayName="Delivering Count"
+                 description="number of messages that this queue is currently delivering to its consumers"
+                 dataType="measurement" displayType="summary"/>
+         <metric property="getMessagesAdded"
+                 displayName="Messages Added"
+                 description="number of messages added to this queue since it was created"
+                 dataType="measurement" displayType="summary"/>
+         <metric property="isPaused"
+                 displayName="paused"
+                 description="Is the queue currently paused"
+                 dataType="trait" displayType="summary"/>
+         <resource-configuration>
+            <c:group name="HornetQCustomProperties" displayName="Destination Options">
+               <c:simple-property name="name" displayName="The Queues Name" required="true">
+                  <c:description>The Name of the queue to deploy</c:description>
+               </c:simple-property>
+               <c:simple-property name="jndiBindings" displayName="The Queues JNDI Name" required="true">
+                  <c:description>The JNDI Name of the queue to deploy</c:description>
+               </c:simple-property>
+               <c:simple-property name="dla" displayName="Dead Letter Address" required="false">
+                  <c:description>The Address to route dead messages to</c:description>
+               </c:simple-property>
+               <c:simple-property name="expiryAddress" displayName="Expiry Address" required="false">
+                  <c:description>The Address to route dead messages to</c:description>
+               </c:simple-property>
+               <c:simple-property name="maxSize" default="10485760" type="integer" displayName="Max Size of Address"
+                                  required="true">
+                  <c:description>The maximum size in bytes an address can hold</c:description>
+               </c:simple-property>
+               <c:simple-property name="pageSize" default="10485760" type="integer" displayName="Page Size"
+                                  required="true">
+                  <c:description>The point at which messages will be paged on an Address</c:description>
+               </c:simple-property>
+               <c:simple-property name="maxDeliveryAttempts" type="integer" default="10"
+                                  displayName="Max Delivery Attempts" required="true">
+                  <c:description>The maximum time to attempt delivery to this Address</c:description>
+               </c:simple-property>
+               <c:simple-property name="redeliveryDelay" type="long" default="0" displayName="Redelivery Delay"
+                                  required="true">
+                  <c:description>The delay before re routing a message to this Address</c:description>
+               </c:simple-property>
+               <c:simple-property name="lastValueQueue" default="false" type="boolean" displayName="Last Value Queue"
+                                  required="true">
+                  <c:description>Is this queue a last value queue</c:description>
+               </c:simple-property>
+               <c:simple-property name="redistributionDelay" default="-1" type="long" displayName="Redistribution Delay"
+                                  required="true">
+                  <c:description>How long to wait before redistributing messages to another node when clustered
+                  </c:description>
+               </c:simple-property>
+               <c:simple-property name="sendToDLAOnNoRoute" default="false" type="boolean"
+                                  displayName="Send To DLA on no route" required="true">
+                  <c:description>Whether or not messages routed to this address gets sent to DLA when no consumers are
+                     available
+                  </c:description>
+               </c:simple-property>
+               <c:simple-property name="addressFullMessagePolicy" default="PAGE" type="string"
+                                  displayName="Address Full Message Policy" required="true">
+                  <c:description>The policy to use when this Address is full (PAGE,DROP,BLOCK)</c:description>
+               </c:simple-property>
+                <c:list-property name="securityConfig"
+                                 displayName="Security Configurations"
+                                 description="This element specifies a XML fragment which describes the access control list to be used by the SecurityManager to authorize client operations against the destination. The content model is the same as for the SecurityManager SecurityConf attribute.">
+                    <c:map-property name="role"
+                                    displayName="Security Configuration Attributes"
+                                    description="These are the attributes that define the role name, and if the role is allowed to read, write or create Messages on this Queue">
+                       <c:simple-property name="name"
+                                           displayName="Read"
+                                           description="The name of the role?"
+                                           summary="true"
+                                           required="true"
+                                           type="string"/>
+                       <c:simple-property name="send"
+                                           displayName="Read"
+                                           description="Is this role allowed to write messages to this address?"
+                                           summary="true"
+                                           required="true"
+                                           type="boolean"/>
+                        <c:simple-property name="consume"
+                                           displayName="Write"
+                                           description="Is this role allowed to read messages from this address?"
+                                           summary="true"
+                                           required="true"
+                                           type="boolean"/>
+                    </c:map-property>
+
+                </c:list-property>
+            </c:group>
+         </resource-configuration>
+      </service>
    </service>
-
 </plugin>

Modified: branches/Branch_Hornet_Temporary_2/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml
===================================================================
--- branches/Branch_Hornet_Temporary_2/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml	2010-03-16 21:17:22 UTC (rev 102487)
+++ branches/Branch_Hornet_Temporary_2/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml	2010-03-16 21:57:26 UTC (rev 102488)
@@ -43,7 +43,7 @@
    </bean>
 
 	<bean name="HornetQManagedObjectCreator" class="org.jboss.as.integration.hornetq.management.HornetQManagedObjectCreator">
-		<constructor><parameter><inject bean="ManagedObjectFactory" /></parameter></constructor>
+      <constructor><parameter><inject bean="ManagedObjectFactory" /></parameter></constructor>
         <demand>HornetQDestinationCreator</demand>
 	</bean>
 	




More information about the jboss-cvs-commits mailing list