[jboss-cvs] JBossAS SVN: r102535 - in trunk: hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/util and 7 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Mar 17 18:47:27 EDT 2010


Author: clebert.suconic at jboss.com
Date: 2010-03-17 18:47:26 -0400 (Wed, 17 Mar 2010)
New Revision: 102535

Added:
   trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/QueueManagerComponent.java
   trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/QueueManagerDiscoveryComponent.java
   trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/util/ManagementSupport.java
   trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/AddressSettingsMapper.java
   trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/
   trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/BindingEntry.java
   trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/BindingEntryAdapter.java
   trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/HornetQDestinationTemplate.java
   trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/HornetQDestinationTemplateInfo.java
   trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSConfiguration.java
   trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSQueueConfiguration.java
   trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSTopicConfiguration.java
   trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/package-info.java
Modified:
   trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueComponent2.java
   trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueDiscoveryComponent2.java
   trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSQueueConfigurationMO.java
   trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/MessageListMapper.java
   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/TopicConfigurationMO.java
   trunk/hornetq-int/src/resources/META-INF/rhq-plugin.xml
   trunk/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml
   trunk/testsuite/local.properties
   trunk/testsuite/src/main/org/jboss/test/profileservice/test/JmsDestinationUnitTestCase.java
Log:
last update from hornetq's temporary branch

Modified: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueComponent2.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueComponent2.java	2010-03-17 22:22:42 UTC (rev 102534)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueComponent2.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -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: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueDiscoveryComponent2.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueDiscoveryComponent2.java	2010-03-17 22:22:42 UTC (rev 102534)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueDiscoveryComponent2.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -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: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/QueueManagerComponent.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/QueueManagerComponent.java	                        (rev 0)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/QueueManagerComponent.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -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: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/QueueManagerDiscoveryComponent.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/QueueManagerDiscoveryComponent.java	                        (rev 0)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/QueueManagerDiscoveryComponent.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -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: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/util/ManagementSupport.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/util/ManagementSupport.java	                        (rev 0)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/jopr/util/ManagementSupport.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -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: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/AddressSettingsMapper.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/AddressSettingsMapper.java	                        (rev 0)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/AddressSettingsMapper.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -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: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSQueueConfigurationMO.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSQueueConfigurationMO.java	2010-03-17 22:22:42 UTC (rev 102534)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSQueueConfigurationMO.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -39,14 +39,14 @@
 public interface JMSQueueConfigurationMO extends JMSQueueConfiguration
 {
 
-   @ManagementProperty(name = "name", description = "The queue name")
+   @ManagementProperty(name = "name", description = "The queue name", includeInTemplate=true)
    @ManagementObjectID(type = "Queue")
    public String getName();
    
-   @ManagementProperty(name = "bindings", description = "The queue bindings")
+   @ManagementProperty(name = "bindings", description = "The queue bindings", includeInTemplate=true)
    public String[] getBindings();
    
-   @ManagementProperty(name = "selector", description = "The queue selector")
+   @ManagementProperty(name = "selector", description = "The queue selector", includeInTemplate=true)
    public String getSelector();
    
 }

Modified: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/MessageListMapper.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/MessageListMapper.java	2010-03-17 22:22:42 UTC (rev 102534)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/MessageListMapper.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -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: 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-17 22:22:42 UTC (rev 102534)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/QueueManageImplMO.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -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: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/TopicConfigurationMO.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/TopicConfigurationMO.java	2010-03-17 22:22:42 UTC (rev 102534)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/TopicConfigurationMO.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -42,13 +42,15 @@
 
    @ManagementProperty(name = "name",
          use = ViewUse.CONFIGURATION,
-         description = "The topic name")
+         description = "The topic name",
+         includeInTemplate=true)
    @ManagementObjectID(type = "Topic")
    public String getName();
    
    @ManagementProperty(name = "bindings", 
          use = ViewUse.CONFIGURATION,
-         description = "The topic bindings")
+         description = "The topic bindings",
+         includeInTemplate=true)
    public String[] getBindings();
    
 }

Added: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/BindingEntry.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/BindingEntry.java	                        (rev 0)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/BindingEntry.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -0,0 +1,24 @@
+package org.jboss.as.integration.hornetq.management.template;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * A BindingEntry.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class BindingEntry
+{
+   @XmlAttribute()
+   public String name;
+   
+   public BindingEntry()
+   {
+   }
+   
+   public BindingEntry(String name)
+   {
+      this.name = name;
+   }
+}

Added: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/BindingEntryAdapter.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/BindingEntryAdapter.java	                        (rev 0)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/BindingEntryAdapter.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -0,0 +1,24 @@
+package org.jboss.as.integration.hornetq.management.template;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+/**
+ * A BindingEntryAdapter.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class BindingEntryAdapter extends XmlAdapter<BindingEntry, String>
+{
+   @Override
+   public BindingEntry marshal(String v) throws Exception
+   {
+      return v == null ? null : new BindingEntry(v);
+   }
+
+   @Override
+   public String unmarshal(BindingEntry v) throws Exception
+   {
+      return v == null ? null : v.name;
+   }
+}

Added: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/HornetQDestinationTemplate.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/HornetQDestinationTemplate.java	                        (rev 0)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/HornetQDestinationTemplate.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -0,0 +1,201 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.template;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.Context;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+import org.hornetq.jms.server.config.ConnectionFactoryConfiguration;
+import org.hornetq.jms.server.config.JMSConfiguration;
+import org.hornetq.jms.server.config.JMSQueueConfiguration;
+import org.hornetq.jms.server.config.TopicConfiguration;
+import org.jboss.deployers.spi.management.DeploymentTemplate;
+import org.jboss.managed.api.DeploymentTemplateInfo;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.api.annotation.ViewUse;
+import org.jboss.metatype.api.types.CompositeMetaType;
+import org.jboss.metatype.api.values.CompositeValue;
+import org.jboss.metatype.api.values.MapCompositeValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
+import org.jboss.metatype.api.values.SimpleValue;
+import org.jboss.metatype.plugins.values.MetaValueFactoryBuilder;
+import org.jboss.vfs.VirtualFile;
+import org.jboss.vfs.VFS;
+
+/**
+ * A HornetQDestinationTemplate.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class HornetQDestinationTemplate implements DeploymentTemplate
+{
+   /** The file suffix. */
+   private static final String FILE_SUFFIX = "hornetq-jms.xml";
+   
+   /** The role attributes. */
+   protected static final String[] attributes = new String[] { "read", "write", "create"};
+   
+   private static final MetaValueFactory mvf = MetaValueFactoryBuilder.create();
+   
+   private DeploymentTemplateInfo info;
+
+   public VirtualFile applyTemplate(DeploymentTemplateInfo info) throws Exception
+   {
+      // Create a temp file
+      File xml = File.createTempFile(getClass().getSimpleName(), FILE_SUFFIX);
+      // Write template
+      writeTemplate(xml, info);
+      // Return virtual file
+      
+      return VFS.getChild(xml.toURI());
+   }
+
+   public String getDeploymentName(String deploymentBaseName)
+   {
+      if(deploymentBaseName == null)
+         throw new IllegalArgumentException("Null base name.");
+      
+      if(deploymentBaseName.endsWith(FILE_SUFFIX) == false)
+         deploymentBaseName = deploymentBaseName + FILE_SUFFIX;
+      
+      return deploymentBaseName;
+   }
+
+   public DeploymentTemplateInfo getInfo()
+   {
+      return info;
+   }
+
+   public void setInfo(DeploymentTemplateInfo info)
+   {
+      this.info = info;
+   }
+   
+   private void writeTemplate(File xml, DeploymentTemplateInfo info) throws Exception
+   {
+      if (info == null)
+         throw new IllegalArgumentException("Null template info.");
+      if (info.getProperties() == null)
+         throw new IllegalArgumentException("Null template info.");
+
+      JAXBJMSConfiguration config = new JAXBJMSConfiguration();
+
+      // Look for the destination type using the destinationType ManagedProperty
+      ManagedProperty destTypeMP = info.getProperties().get("destinationType");
+      String destinationType = null;
+      if(destTypeMP == null)
+      {
+         // Try casting this to a DsDataSourceTemplateInfo
+         destinationType = ((HornetQDestinationTemplateInfo)info).getDestinationType();
+      }
+      else
+      {
+         SimpleValue dsTypeSV = (SimpleValue) destTypeMP.getValue();
+         destinationType = dsTypeSV.getValue().toString();
+      }
+
+      String destinationName = (String) getProperty(info, "name");
+      if(destinationName == null)
+         throw new IllegalStateException("Destination name has not been specified!");
+
+      String[] bindings = (String[]) getProperty(info, "bindings");
+      if(bindings == null)
+         throw new IllegalStateException("bindings have not been specified!");
+
+      if("QueueTemplate".equals(destinationType))
+      {
+         JAXBJMSQueueConfiguration queue = new JAXBJMSQueueConfiguration();
+         config.setQueueConfigurations(Arrays.asList(new JMSQueueConfiguration[]{queue}));
+         queue.setName(destinationName);
+         queue.setBindings(bindings);
+      }
+      else if("TopicTemplate".equals(destinationType))
+      {
+         JAXBJMSTopicConfiguration topic = new JAXBJMSTopicConfiguration();
+         config.setTopicConfigurations(Arrays.asList(new TopicConfiguration[]{topic}));
+         topic.setName(destinationName);
+         topic.setBindings(bindings);
+      }
+      else
+         throw new IllegalStateException("Unsupported destination type: " + destinationType);
+
+      JAXBContext context = JAXBContext.newInstance(JAXBJMSConfiguration.class);
+      Marshaller marshaller = context.createMarshaller();
+      marshaller.setProperty("jaxb.formatted.output", Boolean.TRUE);
+
+      JAXBElement<JAXBJMSConfiguration> root = new JAXBElement<JAXBJMSConfiguration>(
+            new javax.xml.namespace.QName("urn:hornetq", "configuration"), JAXBJMSConfiguration.class, null, config);
+
+      Writer fw = null;
+      try
+      {
+         fw = new FileWriter(xml);
+         marshaller.marshal(root, fw);
+      }
+      finally
+      {
+         if (fw != null)
+         {
+            fw.close();
+         }
+      }
+   }
+   
+   /**
+    * Extract the value from the property MetaValue
+    * @param info - template info
+    * @param propName - the name of the property to return a value for
+    * @return the unwrapped property value
+    */
+   private Object getProperty(DeploymentTemplateInfo info, String propName)
+   {
+      Map<String, ManagedProperty> propsInfo = info.getProperties();
+      ManagedProperty prop = propsInfo.get(propName);
+      if(prop == null)
+      {
+         return null;
+      }
+      Object value = prop.getValue();
+      if(value instanceof MetaValue)
+      {
+         return mvf.unwrap((MetaValue) value);
+      }
+      return value;
+   }
+}

Added: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/HornetQDestinationTemplateInfo.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/HornetQDestinationTemplateInfo.java	                        (rev 0)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/HornetQDestinationTemplateInfo.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.template;
+
+import java.io.ObjectStreamException;
+import java.util.Map;
+
+import org.jboss.managed.api.Fields;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.api.annotation.ViewUse;
+import org.jboss.managed.plugins.BasicDeploymentTemplateInfo;
+import org.jboss.managed.plugins.DefaultFieldsImpl;
+import org.jboss.managed.plugins.ManagedPropertyImpl;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+
+
+/**
+ * A HornetQDestinationTemplateInfo.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class HornetQDestinationTemplateInfo extends BasicDeploymentTemplateInfo
+{
+
+   /** The serialVersionUID */
+   private static final long serialVersionUID = 1L;
+
+   private String destinationType = "QueueTemplate";
+
+   public HornetQDestinationTemplateInfo(String name, String description)
+   {
+      super(name, description);
+   }
+
+   public HornetQDestinationTemplateInfo(String name, String description, Map<String, ManagedProperty> properties)
+   {
+      super(name, description, properties);
+   }
+
+   public void setDestinationType(String destinationType)
+   {
+      this.destinationType = destinationType;
+   }
+   
+   public String getDestinationType()
+   {
+      return destinationType;
+   }
+
+   public void start()
+   {
+      populate();
+   }
+
+   @Override
+   public HornetQDestinationTemplateInfo copy()
+   {
+      HornetQDestinationTemplateInfo copy = new HornetQDestinationTemplateInfo(getName(), getDescription(), getProperties());
+      copy.setDestinationType(getDestinationType());
+      super.copy(copy);
+      copy.populate();
+      return copy;
+   }
+
+   private void populate()
+   {
+      // Add the destination type as a ManagedProperty 
+      DefaultFieldsImpl fields = new DefaultFieldsImpl("destinationType");
+      fields.setDescription("The destination type");
+      fields.setMetaType(SimpleMetaType.STRING);
+      fields.setValue(SimpleValueSupport.wrap(destinationType));
+      fields.setField(Fields.READ_ONLY, Boolean.TRUE);
+      ManagedPropertyImpl destTypeMP = new ManagedPropertyImpl(fields);
+      addProperty(destTypeMP);
+
+      if(getProperties() == null) return;
+      for(ManagedProperty property : getProperties().values())
+      {
+         // Create a new (non-writethrough) managed property
+         Fields f = property.getFields();
+         
+         ManagedPropertyImpl newProperty = new ManagedPropertyImpl(f);
+         
+         // Skip non configuration properties except clustered
+         if(newProperty.hasViewUse(ViewUse.CONFIGURATION) == false
+               && property.getName().equals("clustered") == false)
+            continue;
+         
+         // Override
+         addProperty(newProperty);
+      }
+   }
+
+   /**
+    * Expose only plain BasicDeploymentTemplateInfo to avoid leaking server types.
+    *
+    * @return simpler ManagedPropertyImpl
+    * @throws java.io.ObjectStreamException for any error
+    */
+   private Object writeReplace() throws ObjectStreamException
+   {
+      BasicDeploymentTemplateInfo info = new BasicDeploymentTemplateInfo(getName(), getDescription(), getProperties());
+      return info;
+   }
+}

Added: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSConfiguration.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSConfiguration.java	                        (rev 0)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSConfiguration.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.template;
+
+import java.util.List;
+
+import javax.naming.Context;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+import org.hornetq.jms.server.config.ConnectionFactoryConfiguration;
+import org.hornetq.jms.server.config.JMSConfiguration;
+import org.hornetq.jms.server.config.JMSQueueConfiguration;
+import org.hornetq.jms.server.config.TopicConfiguration;
+
+/**
+ * A JAXBJMSConfiguration.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlRootElement(name="configuration", namespace="urn:hornetq")
+ at XmlType(propOrder={"queues", "topics"})
+public class JAXBJMSConfiguration implements JMSConfiguration, java.io.Serializable
+{   
+   @XmlElement(name="queue", type=JAXBJMSQueueConfiguration.class)
+   private List<JMSQueueConfiguration> queues;
+   
+   @XmlElement(name="topic", type=JAXBJMSTopicConfiguration.class)
+   private List<TopicConfiguration> topics;
+   
+   @Override
+   public List<ConnectionFactoryConfiguration> getConnectionFactoryConfigurations()
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+   @Override
+   public Context getContext()
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+   @Override
+   public void setContext(Context arg0)
+   {
+      // TODO Auto-generated method stub
+   }
+
+   @Override
+   public List<JMSQueueConfiguration> getQueueConfigurations()
+   {
+      return queues;
+   }
+
+   public void setQueueConfigurations(List<JMSQueueConfiguration> queues)
+   {
+      this.queues = queues;
+   }
+
+   @Override
+   public List<TopicConfiguration> getTopicConfigurations()
+   {
+      return topics;
+   }
+
+   public void setTopicConfigurations(List<TopicConfiguration> topics)
+   {
+      this.topics = topics;
+   }
+}

Added: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSQueueConfiguration.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSQueueConfiguration.java	                        (rev 0)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSQueueConfiguration.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.template;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.hornetq.jms.server.config.JMSQueueConfiguration;
+
+/**
+ * A JAXBJMSQueueConfiguration.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(propOrder={"bindings", "selector"})
+public class JAXBJMSQueueConfiguration implements JMSQueueConfiguration
+{
+   @XmlAttribute
+   private String name;
+   
+   @XmlElement(name="entry")
+   @XmlJavaTypeAdapter(BindingEntryAdapter.class)
+   private String[] bindings;
+   
+   @XmlElement
+   private String selector;
+   
+   @Override
+   public String[] getBindings()
+   {
+      return bindings;
+   }
+
+   public void setBindings(String[] bindings)
+   {
+      this.bindings = bindings;
+   }
+   
+   @Override
+   public String getName()
+   {
+      return name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   @Override
+   public String getSelector()
+   {
+      return selector;
+   }
+
+   public void setSelector(String selector)
+   {
+      this.selector = selector;
+   }
+
+   @Override
+   public boolean isDurable()
+   {
+      // TODO Auto-generated method stub
+      return false;
+   }
+}

Added: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSTopicConfiguration.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSTopicConfiguration.java	                        (rev 0)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSTopicConfiguration.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.template;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.hornetq.jms.server.config.TopicConfiguration;
+
+/**
+ * A JAXBJMSTopicConfiguration.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+public class JAXBJMSTopicConfiguration implements TopicConfiguration
+{
+   @XmlAttribute
+   private String name;
+   
+   @XmlElement(name="entry")
+   @XmlJavaTypeAdapter(BindingEntryAdapter.class)
+   private String[] bindings;
+
+   @Override
+   public String[] getBindings()
+   {
+      return bindings;
+   }
+
+   public void setBindings(String[] bindings)
+   {
+      this.bindings = bindings;
+   }
+   
+   @Override
+   public String getName()
+   {
+      return name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+}

Added: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/package-info.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/package-info.java	                        (rev 0)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/package-info.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.
+ */
+ at XmlSchema(namespace = "urn:hornetq",
+      elementFormDefault = XmlNsForm.QUALIFIED)
+package org.jboss.as.integration.hornetq.management.template;
+
+import javax.xml.bind.annotation.XmlSchema;
+import javax.xml.bind.annotation.XmlNsForm;

Modified: trunk/hornetq-int/src/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/hornetq-int/src/resources/META-INF/rhq-plugin.xml	2010-03-17 22:22:42 UTC (rev 102534)
+++ trunk/hornetq-int/src/resources/META-INF/rhq-plugin.xml	2010-03-17 22:47:26 UTC (rev 102535)
@@ -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: trunk/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml
===================================================================
--- trunk/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml	2010-03-17 22:22:42 UTC (rev 102534)
+++ trunk/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml	2010-03-17 22:47:26 UTC (rev 102535)
@@ -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>
 	

Modified: trunk/testsuite/local.properties
===================================================================
--- trunk/testsuite/local.properties	2010-03-17 22:22:42 UTC (rev 102534)
+++ trunk/testsuite/local.properties	2010-03-17 22:47:26 UTC (rev 102535)
@@ -49,12 +49,12 @@
 # (even at the same machine). Actually what we needed are just node0 and node1
 # ips and the rest are optional. 
 #
-#node0=${env.MYTESTIP_1}
+node0=127.0.0.1
 #node0.http.url=http://192.168.1.103:8080
 #node0.jndiurl=jnp://192.168.1.103:1099
 #node0.hajndi.url=jnp://192.168.1.103:1100
 
-#node1=${env.MYTESTIP_2}
+node1=127.0.0.2
 #node1.http.url=http://192.168.1.113:8080
 #node1.jndiurl=jnp://192.168.1.113:1099
 #node1.hajndi.url=jnp://192.168.1.113:1100

Modified: trunk/testsuite/src/main/org/jboss/test/profileservice/test/JmsDestinationUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/profileservice/test/JmsDestinationUnitTestCase.java	2010-03-17 22:22:42 UTC (rev 102534)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/test/JmsDestinationUnitTestCase.java	2010-03-17 22:47:26 UTC (rev 102535)
@@ -56,11 +56,13 @@
 import org.jboss.managed.api.ManagedProperty;
 import org.jboss.managed.api.RunState;
 import org.jboss.managed.plugins.ManagedOperationMatcher;
+import org.jboss.metatype.api.types.ArrayMetaType;
 import org.jboss.metatype.api.types.CollectionMetaType;
 import org.jboss.metatype.api.types.CompositeMetaType;
 import org.jboss.metatype.api.types.MapCompositeMetaType;
 import org.jboss.metatype.api.types.MetaType;
 import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.ArrayValueSupport;
 import org.jboss.metatype.api.values.CollectionValue;
 import org.jboss.metatype.api.values.CompositeValue;
 import org.jboss.metatype.api.values.CompositeValueSupport;
@@ -114,18 +116,18 @@
       suite.addTest(new JmsDestinationUnitTestCase("testDLQ"));
       suite.addTest(new JmsDestinationUnitTestCase("testCreateQueue"));
       suite.addTest(new JmsDestinationUnitTestCase("testQueueMetrics"));
-      suite.addTest(new JmsDestinationUnitTestCase("testQueueOperations"));
-      suite.addTest(new JmsDestinationUnitTestCase("testQueueRestart"));
+//      suite.addTest(new JmsDestinationUnitTestCase("testQueueOperations"));
+//      suite.addTest(new JmsDestinationUnitTestCase("testQueueRestart"));
       suite.addTest(new JmsDestinationUnitTestCase("testRemoveQueue"));
       suite.addTest(new JmsDestinationUnitTestCase("testCreateTopic"));
-      suite.addTest(new JmsDestinationUnitTestCase("testTopicMetrics"));
-      suite.addTest(new JmsDestinationUnitTestCase("testTopicSubscriptions"));
-      suite.addTest(new JmsDestinationUnitTestCase("testTopicOperations"));
+//      suite.addTest(new JmsDestinationUnitTestCase("testTopicMetrics"));
+//      suite.addTest(new JmsDestinationUnitTestCase("testTopicSubscriptions"));
+//      suite.addTest(new JmsDestinationUnitTestCase("testTopicOperations"));
       suite.addTest(new JmsDestinationUnitTestCase("testRemoveTopic"));
-      suite.addTest(new JmsDestinationUnitTestCase("testCreateSecureQueue"));
-      suite.addTest(new JmsDestinationUnitTestCase("testRemoveSecureQueue"));
-      suite.addTest(new JmsDestinationUnitTestCase("testCreateQueueWithNullDLQ"));
-      suite.addTest(new JmsDestinationUnitTestCase("testRemoveQueueWithNullDLQ"));
+//      suite.addTest(new JmsDestinationUnitTestCase("testCreateSecureQueue"));
+//      suite.addTest(new JmsDestinationUnitTestCase("testRemoveSecureQueue"));
+//      suite.addTest(new JmsDestinationUnitTestCase("testCreateQueueWithNullDLQ"));
+//      suite.addTest(new JmsDestinationUnitTestCase("testRemoveQueueWithNullDLQ"));
 
       return suite;
    }  
@@ -138,15 +140,8 @@
       Map<String, ManagedProperty> properties = info.getProperties();
       assertNotNull(properties);
       
-      List<String> items = Arrays.asList("JNDIName", "downCacheSize", "fullSize",
-            "clustered", "maxDeliveryAttempts", "maxSize", "messageCounterHistoryDayLimit",
-            "pageSize", "redeliveryDelay");
-
+      List<String> items = Arrays.asList("name", "bindings", "selector");
       properties.keySet().containsAll(items);
-      // Validate the ObjectName property types
-      ManagedProperty serverPeer = info.getProperties().get("serverPeer");
-      assertNotNull(serverPeer);
-      assertEquals(SimpleMetaType.STRING, serverPeer.getMetaType());
    }
    
    public void testTopicTemplate() throws Exception
@@ -157,10 +152,7 @@
       Map<String, ManagedProperty> properties = info.getProperties();
       assertNotNull(properties);
       
-      List<String> items = Arrays.asList("JNDIName", "downCacheSize", "fullSize",
-            "clustered", "maxDeliveryAttempts", "maxSize", "messageCounterHistoryDayLimit",
-            "pageSize", "redeliveryDelay");
-
+      List<String> items = Arrays.asList("name", "bindings");
       properties.keySet().containsAll(items);
    }
    
@@ -171,45 +163,42 @@
    public void testDLQ() throws Exception
    {
       ManagementView mgtView = getManagementView();
-      ManagedComponent queue = mgtView.getComponent("/queue/DLQ", QueueType);
+      ManagedComponent queue = mgtView.getComponent("DLQ", QueueType);
       assertNotNull(queue);
-      assertEquals("/queue/DLQ", queue.getName());
+      assertEquals("DLQ", queue.getName());
       // Validate some of the expected properties
-      ManagedProperty serverPeer = queue.getProperty("serverPeer");
-      assertNotNull(serverPeer);
-      MetaType serverPeerType = serverPeer.getMetaType();
-      assertEquals(SimpleMetaType.STRING, serverPeerType);
+      ManagedProperty bindings = queue.getProperty("bindings");
+      assertNotNull(bindings);
+      assertEquals(ArrayMetaType.getArrayType(SimpleMetaType.STRING), bindings.getMetaType());
+      Object o = bindings.getValue();
+      assertNotNull(o);
+      o = getMetaValueFactory().unwrap((MetaValue) o);
+      assertTrue(o.getClass().toString(), o instanceof String[]);
+      String[] entries = (String[]) o;
+      assertEquals(1, entries.length);
+      assertEquals("/queue/DLQ", entries[0]);
    }
 
    public void testCreateQueue() throws Exception
    {
       Map<String, MetaValue> propValues = new HashMap<String, MetaValue>();
+      propValues.put("name", SimpleValueSupport.wrap(getName()));
       String jndiName = getName();
-      propValues.put("JNDIName", SimpleValueSupport.wrap(jndiName));
-      propValues.put("downCacheSize", SimpleValueSupport.wrap(1999));
-      propValues.put("DLQ", SimpleValueSupport.wrap("jboss.messaging.destination:name=DLQ,service=Queue"));
-      propValues.put("expiryQueue", SimpleValueSupport.wrap("jboss.messaging.destination:name=ExpiryQueue,service=Queue"));
       
+      SimpleValue bindingValue = SimpleValueSupport.wrap(jndiName);
+      ArrayMetaType.getArrayType(bindingValue.getMetaType());
+      propValues.put("bindings", new ArrayValueSupport(ArrayMetaType.getArrayType(bindingValue.getMetaType()), new MetaValue[]{bindingValue}));
+      
       ComponentType type = KnownComponentTypes.JMSDestination.Queue.getType();
       createComponentTest("QueueTemplate", propValues, getName(), type, jndiName);
       ManagedComponent queue = activeView.getComponent("testCreateQueue", type);
       assertNotNull(queue);
       assertEquals("testCreateQueue", queue.getName());
-      log.info(queue.getProperties().keySet());
-      assertEquals("downCacheSize", queue.getProperty("downCacheSize").getValue(), new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, 1999));
 
-      ManagedProperty serverPeer = queue.getProperty("serverPeer");
-      assertNotNull(serverPeer);
-      MetaType serverPeerType = serverPeer.getMetaType();
-      assertEquals(SimpleMetaType.STRING, serverPeerType);
-      ManagedProperty dlq = queue.getProperty("DLQ");
-      assertNotNull(dlq);
-      MetaType dlqType = dlq.getMetaType();
-      assertEquals(SimpleMetaType.STRING, dlqType);
-      ManagedProperty expiryQueue = queue.getProperty("expiryQueue");
-      assertNotNull(expiryQueue);
-      MetaType expiryQueueType = serverPeer.getMetaType();
-      assertEquals(SimpleMetaType.STRING, expiryQueueType);
+      ManagedProperty bindings = queue.getProperty("bindings");
+      assertNotNull(bindings);
+      MetaType bindingsType = bindings.getMetaType();
+      assertEquals(ArrayMetaType.getArrayType(SimpleMetaType.STRING), bindingsType);
    }
    
    public void testQueueMetrics() throws Exception
@@ -361,22 +350,30 @@
 
    public void testRemoveQueue() throws Exception
    {
-      removeDeployment("testCreateQueue-service.xml");
-	   ManagedComponent queue = getManagementView().getComponent("testCreateQueue", QueueType);
+      removeDeployment("testCreateQueuehornetq-jms.xml");
+	  ManagedComponent queue = getManagementView().getComponent("testCreateQueue", QueueType);
       assertNull("queue should be removed" + queue, queue);
    }
 
    public void testCreateTopic() throws Exception
    {
       Map<String, MetaValue> propValues = new HashMap<String, MetaValue>();
+      propValues.put("name", SimpleValueSupport.wrap(getName()));
       String jndiName = getName();
-      propValues.put("JNDIName", SimpleValueSupport.wrap(jndiName));
-      HashSet<String> removedProps = new HashSet<String>();
-      removedProps.add("serverPeer");
-      createComponentTest("TopicTemplate", propValues, removedProps, getName(), TopicType, jndiName, true);
+      
+      SimpleValue bindingValue = SimpleValueSupport.wrap(jndiName);
+      ArrayMetaType.getArrayType(bindingValue.getMetaType());
+      propValues.put("bindings", new ArrayValueSupport(ArrayMetaType.getArrayType(bindingValue.getMetaType()), new MetaValue[]{bindingValue}));
+
+      createComponentTest("TopicTemplate", propValues, getName(), TopicType, jndiName);
       ManagedComponent topic = activeView.getComponent("testCreateTopic", TopicType);
       assertNotNull(topic);
       assertEquals("testCreateTopic", topic.getName());
+      
+      ManagedProperty bindings = topic.getProperty("bindings");
+      assertNotNull(bindings);
+      MetaType bindingsType = bindings.getMetaType();
+      assertEquals(ArrayMetaType.getArrayType(SimpleMetaType.STRING), bindingsType);
    }
 
    /**
@@ -518,7 +515,7 @@
    
    public void testRemoveTopic() throws Exception
    {
-      removeDeployment("testCreateTopic-service.xml");
+      removeDeployment("testCreateTopichornetq-jms.xml");
       ManagedComponent topic = getManagementView().getComponent("testCreateTopic", TopicType);
       assertNull("topic should be removed " + topic, topic);
    }
@@ -602,15 +599,15 @@
       // The message count property
       ManagedProperty messageCount = component.getProperty("messageCount");
       assertNotNull("messageCount", messageCount);
-      ManagedProperty messageCounter = component.getProperty("messageCounter");
-      assertNotNull("messageCounter", messageCounter);
+      //ManagedProperty messageCounter = component.getProperty("messageCounter");
+      //assertNotNull("messageCounter", messageCounter);
 
       // Clear any 
-      Set<ManagedOperation> ops = component.getOperations();
-      ManagedOperation removeAllMessages = ManagedOperationMatcher.findOperation(ops, "removeAllMessages");
-      assertNotNull("removeAllMessages", removeAllMessages);
-      removeAllMessages.invoke();
-      assertEquals(SimpleValueSupport.wrap(0), messageCount.getValue());
+//      Set<ManagedOperation> ops = component.getOperations();
+//      ManagedOperation removeAllMessages = ManagedOperationMatcher.findOperation(ops, "removeAllMessages");
+//      assertNotNull("removeAllMessages", removeAllMessages);
+//      removeAllMessages.invoke();
+//      assertEquals(SimpleValueSupport.wrap(0), messageCount.getValue());
 
       // Send a message
       Queue queue = (Queue) getInitialContext().lookup(jndiName);
@@ -625,42 +622,44 @@
       sender.send(s.createTextMessage("Hey!"));
 
       SimpleValue messageCount1 = (SimpleValue) messageCount.getValue();
-      assertTrue((Integer) (messageCount1).getValue() > 0);
-      CompositeValue messageCounterCV = (CompositeValue) messageCounter.getValue();
-      log.info(messageCounterCV);
-      assertEquals(messageCounterCV.get("messageCount"), messageCount1);
+      //assertTrue((Integer) (messageCount1).getValue() > 0);
+      assertEquals(1, messageCount1.getValue());
+      //CompositeValue messageCounterCV = (CompositeValue) messageCounter.getValue();
+      //log.info(messageCounterCV);
+      //assertEquals(messageCounterCV.get("messageCount"), messageCount1);
 
       // Message 2
       sender.send(s.createTextMessage("Message2"));
       
       SimpleValue messageCount2 = (SimpleValue) messageCount.getValue();
-      assertTrue(messageCount2.compareTo(messageCount1) > 0);
-      messageCounterCV = (CompositeValue) messageCounter.getValue();
-      assertEquals(messageCounterCV.get("messageCount"), messageCount2);
+      //assertTrue(messageCount2.compareTo(messageCount1) > 0);
+      assertEquals(2, messageCount2.getValue());
+      //messageCounterCV = (CompositeValue) messageCounter.getValue();
+      //assertEquals(messageCounterCV.get("messageCount"), messageCount2);
       
       //
-      ManagedOperation listAllMessages = ManagedOperationMatcher.findOperation(ops, "listAllMessages");
-      assertNotNull("listAllMessages", listAllMessages);
-      MetaValue msgs = listAllMessages.invoke();
-      assertNotNull(msgs);
-      log.info("listAllMessages.MV: "+msgs);
-      assertTrue("msgs is a CollectionValue", msgs instanceof CollectionValue);
-      CollectionValue msgsCV = (CollectionValue) msgs;
-      MetaValue[] msgsMVs = msgsCV.getElements();
-      assertTrue("listAllMessages length > 0", msgsMVs.length > 0);
-      for(MetaValue mv : msgsMVs)
-      {
-         assertTrue(mv instanceof CompositeValue);
-         CompositeValue cv = (CompositeValue) mv;
-         MetaValue JMSMessageID = cv.get("JMSMessageID");
-         log.info(JMSMessageID);
-         assertNotNull(JMSMessageID);
-         MetaValue JMSCorrelationID = cv.get("JMSCorrelationID");
-         log.info(JMSCorrelationID);
-         MetaValue JMSTimestamp = cv.get("JMSTimestamp");
-         log.info(JMSTimestamp);
-         assertNotNull(JMSTimestamp);
-      }
+//      ManagedOperation listAllMessages = ManagedOperationMatcher.findOperation(ops, "listAllMessages");
+//      assertNotNull("listAllMessages", listAllMessages);
+//      MetaValue msgs = listAllMessages.invoke();
+//      assertNotNull(msgs);
+//      log.info("listAllMessages.MV: "+msgs);
+//      assertTrue("msgs is a CollectionValue", msgs instanceof CollectionValue);
+//      CollectionValue msgsCV = (CollectionValue) msgs;
+//      MetaValue[] msgsMVs = msgsCV.getElements();
+//      assertTrue("listAllMessages length > 0", msgsMVs.length > 0);
+//      for(MetaValue mv : msgsMVs)
+//      {
+//         assertTrue(mv instanceof CompositeValue);
+//         CompositeValue cv = (CompositeValue) mv;
+//         MetaValue JMSMessageID = cv.get("JMSMessageID");
+//         log.info(JMSMessageID);
+//         assertNotNull(JMSMessageID);
+//         MetaValue JMSCorrelationID = cv.get("JMSCorrelationID");
+//         log.info(JMSCorrelationID);
+//         MetaValue JMSTimestamp = cv.get("JMSTimestamp");
+//         log.info(JMSTimestamp);
+//         assertNotNull(JMSTimestamp);
+//      }
       c.stop();
       c.close();
    }




More information about the jboss-cvs-commits mailing list