[jboss-cvs] JBossAS SVN: r102866 - in trunk/hornetq-int/src: main/java/org/jboss/as/integration/hornetq/management and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Mar 24 05:57:36 EDT 2010
Author: ataylor
Date: 2010-03-24 05:57:34 -0400 (Wed, 24 Mar 2010)
New Revision: 102866
Removed:
trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/HornetQManagedObjectCreator.java
trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/ConnectionFactoryConfigurationMO.java
trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/ConnectionFactoryControlMO.java
trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSConfigurationICF.java
trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSConfigurationMO.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/JMSQueueControlMO.java
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/TopicControlMO.java
trunk/hornetq-int/src/test/java/org/jboss/test/hornetq/integration/test/AbstractManagementTestBase.java
trunk/hornetq-int/src/test/java/org/jboss/test/hornetq/integration/test/BasicJMSConfigurationMOUnitTestCase.java
Modified:
trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQJMSParserDeployer.java
trunk/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml
Log:
removed unwanted hornetq MO's
Modified: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQJMSParserDeployer.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQJMSParserDeployer.java 2010-03-24 09:42:28 UTC (rev 102865)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQJMSParserDeployer.java 2010-03-24 09:57:34 UTC (rev 102866)
@@ -1,22 +1,16 @@
package org.jboss.as.integration.hornetq.deployers;
-import java.io.InputStream;
-import java.util.Map;
-import java.util.Set;
-
import org.hornetq.jms.server.JMSServerConfigParser;
import org.hornetq.jms.server.config.JMSConfiguration;
import org.hornetq.jms.server.impl.JMSServerConfigParserImpl;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.managed.ManagedObjectCreator;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
import org.jboss.logging.Logger;
-import org.jboss.managed.api.ManagedObject;
import org.jboss.vfs.VirtualFile;
+import java.io.InputStream;
+
/**
* This Deployer will take a hornetq-jms.xml parse the JMSConfiguration and
* attach the JMSConfiguration output into the deployment unit. Another deployer
@@ -30,7 +24,7 @@
* @author <mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
*
*/
-public class HornetQJMSParserDeployer extends AbstractVFSParsingDeployer<JMSConfiguration> implements ManagedObjectCreator
+public class HornetQJMSParserDeployer extends AbstractVFSParsingDeployer<JMSConfiguration>
{
private static final Logger log = Logger.getLogger(HornetQJMSParserDeployer.class);
@@ -39,9 +33,6 @@
private final JMSServerConfigParser jmsConfigParser;
- /** The mgt object creator delegate. */
- private ManagedObjectCreator mgtObjectCreator;
-
public HornetQJMSParserDeployer()
{
super(JMSConfiguration.class);
@@ -49,21 +40,8 @@
this.jmsConfigParser = new JMSServerConfigParserImpl();
setSuffix(FILENAME);
-
- // We build managed objects
- setBuildManagedObject(true);
}
-
- public ManagedObjectCreator getMgtObjectCreator()
- {
- return mgtObjectCreator;
- }
- public void setMgtObjectCreator(ManagedObjectCreator mgtObjectCreator)
- {
- this.mgtObjectCreator = mgtObjectCreator;
- }
-
@Override
protected JMSConfiguration parse(VFSDeploymentUnit unit, VirtualFile file, JMSConfiguration root) throws Exception
{
@@ -87,17 +65,4 @@
}
}
- /**
- * {@inheritDoc}
- */
- public void build(DeploymentUnit unit, Set<String> attachmentNames, Map<String, ManagedObject> managedObjects)
- throws DeploymentException
- {
- if(isBuildManagedObject())
- {
- // delegate
- mgtObjectCreator.build(unit, attachmentNames, managedObjects);
- }
- }
-
}
Deleted: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/HornetQManagedObjectCreator.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/HornetQManagedObjectCreator.java 2010-03-24 09:42:28 UTC (rev 102865)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/HornetQManagedObjectCreator.java 2010-03-24 09:57:34 UTC (rev 102866)
@@ -1,185 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, Red Hat Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.as.integration.hornetq.management;
-
-import java.util.Map;
-import java.util.Set;
-
-import javax.management.ObjectName;
-
-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.as.integration.hornetq.management.jms.ConnectionFactoryControlMO;
-import org.jboss.as.integration.hornetq.management.jms.JMSConfigurationICF;
-import org.jboss.as.integration.hornetq.management.jms.JMSConfigurationMO;
-import org.jboss.as.integration.hornetq.management.jms.JMSQueueControlMO;
-import org.jboss.as.integration.hornetq.management.jms.TopicControlMO;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.managed.ManagedObjectCreator;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.logging.Logger;
-import org.jboss.managed.api.ManagedObject;
-import org.jboss.managed.api.MutableManagedObject;
-import org.jboss.managed.api.factory.ManagedObjectFactory;
-import org.jboss.managed.spi.factory.ManagedObjectBuilder;
-import org.jboss.metadata.plugins.loader.reflection.AnnotatedElementMetaDataLoader;
-import org.jboss.metadata.spi.MetaData;
-import org.jboss.metadata.spi.retrieval.MetaDataRetrievalToMetaDataBridge;
-import org.jboss.metatype.api.values.SimpleValueSupport;
-
-/**
- * The HornetQ ManagedObject creator. This overrides the default creation of managed objects
- * for the {@code JMSConfiguration} and adds additional runtime managed objects which
- * reference the {@code DestinationControl} MBeans. To make the runtime dispatching work, those
- * MBeans have to registered in MC {@see HornetQControlRuntimeDispatchPlugin}
- *
- * This gets injected into the {@code HornetQJMSParserDeployer}.
- *
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class HornetQManagedObjectCreator implements ManagedObjectCreator
-{
-
- /** The logger. */
- private static final Logger log = Logger.getLogger("org.jboss.as.integration.hornetq.management");
-
- /** The configuration meta data. */
- private static final MetaData configurationMetaData;
-
- /** The managed object factory. */
- private final ManagedObjectFactory managedObjectFactory;
-
- static
- {
- // Create the meta data loader, to override the annotations of the JMSConfiguration
- AnnotatedElementMetaDataLoader configurationLoader = new AnnotatedElementMetaDataLoader(JMSConfigurationMO.class);
- configurationMetaData = new MetaDataRetrievalToMetaDataBridge(configurationLoader);
- }
-
- public HornetQManagedObjectCreator(ManagedObjectFactory managedObjectFactory)
- {
- if(managedObjectFactory == null)
- {
- throw new IllegalArgumentException("null managed object factory");
- }
- this.managedObjectFactory = managedObjectFactory;
- }
-
- public void start()
- {
- // Register the instance class factory
- managedObjectFactory.addInstanceClassFactory(new JMSConfigurationICF(managedObjectFactory));
- }
-
- public void stop()
- {
- // Remove instance class factory
- managedObjectFactory.setInstanceClassFactory(JMSConfiguration.class, null);
- }
-
- /**
- * {@inheritDoc}
- */
- public void build(DeploymentUnit unit, Set<String> attachmentNames, Map<String, ManagedObject> managedObjects)
- throws DeploymentException
- {
- // Get the configuration
- JMSConfiguration configuration = unit.getAttachment(JMSConfiguration.class);
- if (configuration != null)
- {
- // Create and populate the management object
- // Use the JMSConfiguration.class to reference the ICF and override the annotations using MDR
- ManagedObject mo = managedObjectFactory.initManagedObject(configuration, JMSConfiguration.class,
- configurationMetaData, JMSConfiguration.class.getName(), null);
- if (mo != null)
- {
- managedObjects.put(JMSConfiguration.class.getName(), mo);
- }
-
- // Create some fake runtime managed objects referencing the Control MBeans
- for (JMSQueueConfiguration config : configuration.getQueueConfigurations())
- {
- // Build the actual ObjectName
- String name = "org.hornetq:module=JMS,name=\"" + config.getName() + "\",type=Queue";
- managedObjects.put(name, createManagedObject(config.getName(), name, JMSQueueControlMO.class));
- }
- for (TopicConfiguration config : configuration.getTopicConfigurations())
- {
- // Build the actual ObjectName
- String name = "org.hornetq:module=JMS,name=\"" + config.getName() + "\",type=Topic";
- managedObjects.put(name, createManagedObject(config.getName(), name, TopicControlMO.class));
- }
- for (ConnectionFactoryConfiguration config : configuration.getConnectionFactoryConfigurations())
- {
- // Build the actual ObjectName
- String name = "org.hornetq:module=JMS,name=\"" + config.getName() + "\",type=ConnectionFactory";
- managedObjects.put(name, createManagedObject(config.getName(), name, ConnectionFactoryControlMO.class));
- }
- }
- }
-
- /**
- * Create a {@code ManagedObject} skeleton for the runtime objects only, since all properties and operations
- * are getting dispatched to JMX via the {@code HornetQControlRuntimeDispatchPlugin}.
- *
- * The most important thing is that the runtimeMO.name is the same as the one from the attachment meta data
- * created in the parsing deployer.
- *
- * @param moName the managed object name
- * @param runtimeName the actual runtime component name
- * @param instanceType the template class we create the MO from
- * @return the managed object
- */
- protected ManagedObject createManagedObject(String moName, String runtimeName, Class<?> instanceType)
- {
- ManagedObject mo = null;
- try
- {
- final ObjectName objectName = new ObjectName(runtimeName);
-
- // Just build the MO skeleton
- // We don't need the MetaData here, since we are directly using the annotated interfaces
- mo = ManagedObjectBuilder.class.cast(managedObjectFactory).buildManagedObject(instanceType, null);
-
- // Populate needed values
- if(mo != null && mo instanceof MutableManagedObject)
- {
- MutableManagedObject mu = MutableManagedObject.class.cast(mo);
- // Set the managed object name
- mu.setName(moName);
- // Set the runtime component name
- mu.setComponentName(objectName);
- // Set the name property, so that merging works
- mo.getProperty("name").setValue(SimpleValueSupport.wrap(moName));
- }
- }
- catch(Exception e)
- {
- log.debug("failed to create the ManagedObject for " + runtimeName, e);
- }
- return mo;
- }
-
-}
Deleted: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/ConnectionFactoryConfigurationMO.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/ConnectionFactoryConfigurationMO.java 2010-03-24 09:42:28 UTC (rev 102865)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/ConnectionFactoryConfigurationMO.java 2010-03-24 09:57:34 UTC (rev 102866)
@@ -1,57 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2010, Red Hat Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.as.integration.hornetq.management.jms;
-
-import org.hornetq.jms.server.config.ConnectionFactoryConfiguration;
-import org.jboss.managed.api.annotation.ManagementComponent;
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementObjectID;
-import org.jboss.managed.api.annotation.ManagementProperties;
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.jboss.managed.api.annotation.ViewUse;
-
-/**
- * The connection factory {@code ManagedObject} template.
- *
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
- at ManagementObject( componentType = @ManagementComponent(type = "JMSDestination", subtype = "ConnectionFactory"),
- properties = ManagementProperties.EXPLICIT)
-// TODO more management properties
-// TODO change component type names
-public interface ConnectionFactoryConfigurationMO extends ConnectionFactoryConfiguration
-{
-
- @ManagementProperty(name = "name",
- use = ViewUse.CONFIGURATION,
- description = "The connection factory name")
- @ManagementObjectID(type = "ConnectionFactory")
- public String getName();
-
- @ManagementProperty(name = "binding",
- use = ViewUse.CONFIGURATION,
- description = "The connection factory bindings")
- public String[] getBindings();
-
-}
-
Deleted: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/ConnectionFactoryControlMO.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/ConnectionFactoryControlMO.java 2010-03-24 09:42:28 UTC (rev 102865)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/ConnectionFactoryControlMO.java 2010-03-24 09:57:34 UTC (rev 102866)
@@ -1,57 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, Red Hat Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.as.integration.hornetq.management.jms;
-
-import org.hornetq.api.jms.management.ConnectionFactoryControl;
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementObjectID;
-import org.jboss.managed.api.annotation.ManagementProperties;
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.jboss.managed.api.annotation.ViewUse;
-
-/**
- * The connection factory control {@code ManagementObject} template.
- *
- * All properties should have {@code ViewUse.STATISTIC} since they are only
- * fetched during runtime using the {@code HornetQControlRuntimeDispatchPlugin}.
- *
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
- at ManagementObject(isRuntime = true, properties = ManagementProperties.EXPLICIT)
-// TODO more management properties (use = ViewUse.STATISTIC) and operations
-public interface ConnectionFactoryControlMO extends ConnectionFactoryControl
-{
-
- @ManagementProperty(name = "name",
- use = ViewUse.CONFIGURATION,
- description = "The connection factory name")
- @ManagementObjectID(type = "ConnectionFactory")
- // Name has to match ConnectionFactoryConfigurationMO.getName(); The actual objectName is irrelevant
- public String getName();
-
- @ManagementProperty(description = "The connection factory client id",
- use = ViewUse.STATISTIC, readOnly = true)
- public String getClientID();
-
-}
-
Deleted: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSConfigurationICF.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSConfigurationICF.java 2010-03-24 09:42:28 UTC (rev 102865)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSConfigurationICF.java 2010-03-24 09:57:34 UTC (rev 102866)
@@ -1,120 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2010, Red Hat Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.as.integration.hornetq.management.jms;
-
-import org.hornetq.jms.server.config.JMSConfiguration;
-import org.jboss.beans.info.spi.BeanInfo;
-import org.jboss.managed.api.ManagedObject;
-import org.jboss.managed.api.ManagedProperty;
-import org.jboss.managed.api.MutableManagedObject;
-import org.jboss.managed.api.factory.ManagedObjectFactory;
-import org.jboss.managed.plugins.factory.AbstractInstanceClassFactory;
-import org.jboss.managed.plugins.factory.AbstractManagedObjectFactory;
-import org.jboss.metadata.plugins.loader.reflection.AnnotatedElementMetaDataLoader;
-import org.jboss.metadata.spi.MetaData;
-import org.jboss.metadata.spi.retrieval.MetaDataRetrievalToMetaDataBridge;
-import org.jboss.metatype.api.values.GenericValue;
-import org.jboss.metatype.api.values.GenericValueSupport;
-
-/**
- * The JMSConfiguration InstanceClassFactory. This ICF is bound to the {@code JMSConfiguration}
- * class and therefore this needs to be specified when initializing the {@code ManagementObject}.
- *
- * The main purpose of this ICF is to override the annotations of the configurations.
- *
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class JMSConfigurationICF extends AbstractInstanceClassFactory<JMSConfiguration>
-{
-
- /** The {@code QueueConfiguration} meta data. */
- private static final MetaData queueConfigurationMetaData;
-
- /** The {@code TopicConfiguration} meta data. */
- private static final MetaData topicConfiguratiomMetaData;
-
- /** The {@code ConnectionFactoryConfiguration} meta data. */
- private static final MetaData factoryConfigurationMetaData;
-
- static
- {
- // Create the meta data loaders
- AnnotatedElementMetaDataLoader queueLoader = new AnnotatedElementMetaDataLoader(JMSQueueConfigurationMO.class);
- queueConfigurationMetaData = new MetaDataRetrievalToMetaDataBridge(queueLoader);
- AnnotatedElementMetaDataLoader topicLoader = new AnnotatedElementMetaDataLoader(TopicConfigurationMO.class);
- topicConfiguratiomMetaData = new MetaDataRetrievalToMetaDataBridge(topicLoader);
- AnnotatedElementMetaDataLoader factoryLoader = new AnnotatedElementMetaDataLoader(ConnectionFactoryConfigurationMO.class);
- factoryConfigurationMetaData = new MetaDataRetrievalToMetaDataBridge(factoryLoader);
- }
-
- public JMSConfigurationICF(ManagedObjectFactory factory)
- {
- super(factory);
- }
-
- @Override
- public Class<JMSConfiguration> getType()
- {
- return JMSConfiguration.class;
- }
-
- /**
- * Override the creation of nested managed objects, since we have to overlay the actual deployment
- * metadata with the annotated ManagedObject template.
- *
- */
- protected GenericValue getManagedObjectValue(BeanInfo beanInfo, ManagedProperty property, MetaData metaData,
- Object value)
- {
- // Override the annotations for connection-factories, queues and topics
- // NOTE those objects are nested in a collection
- ManagedObject mo = null;
- if("connection-factory-configurations".equals(property.getName()))
- {
- mo = getMof().initManagedObject(value, factoryConfigurationMetaData);
- }
- else if("queue-configurations".equals(property.getName()))
- {
- mo = getMof().initManagedObject(value, queueConfigurationMetaData);
- }
- else if("topic-configurations".equals(property.getName()))
- {
- mo = getMof().initManagedObject(value, topicConfiguratiomMetaData);
- }
- if(mo != null)
- {
- // Set the parent ManagedObject
- ManagedObject parentMO = property.getManagedObject();
- if(parentMO != null && mo instanceof MutableManagedObject)
- {
- MutableManagedObject mmo = (MutableManagedObject) mo;
- mmo.setParent(parentMO);
- }
- return new GenericValueSupport(AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE, mo);
- }
- // else
- return super.getManagedObjectValue(beanInfo, property, metaData, value);
- }
-
-}
-
Deleted: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSConfigurationMO.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSConfigurationMO.java 2010-03-24 09:42:28 UTC (rev 102865)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSConfigurationMO.java 2010-03-24 09:57:34 UTC (rev 102866)
@@ -1,63 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2010, Red Hat Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.as.integration.hornetq.management.jms;
-
-import java.util.List;
-
-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.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementProperties;
-import org.jboss.managed.api.annotation.ManagementProperty;
-
-/**
- * ProfileService JMS configuration {@code ManagedObject} template.
- *
- * This is a indirection layer so that HornetQ does not need to depend
- * on the the jboss-man annotations directly.
- *
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
- at ManagementObject(properties = ManagementProperties.EXPLICIT)
-public interface JMSConfigurationMO extends JMSConfiguration
-{
-
- @ManagementProperty(name = "connection-factory-configurations",
- description = "The connection factory configurations",
- managed = true)
- public List<ConnectionFactoryConfiguration> getConnectionFactoryConfigurations();
-
- @ManagementProperty(name = "queue-configurations",
- description = "The queue configurations",
- managed = true)
- public List<JMSQueueConfiguration> getQueueConfigurations();
-
- @ManagementProperty(name = "topic-configurations",
- description = "The topic configurations",
- managed = true)
- public List<TopicConfiguration> getTopicConfigurations();
-
-}
-
Deleted: 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-24 09:42:28 UTC (rev 102865)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSQueueConfigurationMO.java 2010-03-24 09:57:34 UTC (rev 102866)
@@ -1,53 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2010, Red Hat Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.as.integration.hornetq.management.jms;
-
-import org.hornetq.jms.server.config.JMSQueueConfiguration;
-import org.jboss.managed.api.annotation.ManagementComponent;
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementObjectID;
-import org.jboss.managed.api.annotation.ManagementProperties;
-import org.jboss.managed.api.annotation.ManagementProperty;
-
-/**
- * The queue configuration {@code ManagementObject} template.
- *
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
- at ManagementObject( componentType = @ManagementComponent(type = "JMSDestination", subtype = "Queue"),
- properties = ManagementProperties.EXPLICIT)
-public interface JMSQueueConfigurationMO extends JMSQueueConfiguration
-{
-
- @ManagementProperty(name = "name", description = "The queue name", includeInTemplate=true)
- @ManagementObjectID(type = "Queue")
- public String getName();
-
- @ManagementProperty(name = "bindings", description = "The queue bindings", includeInTemplate=true)
- public String[] getBindings();
-
- @ManagementProperty(name = "selector", description = "The queue selector", includeInTemplate=true)
- public String getSelector();
-
-}
-
Deleted: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSQueueControlMO.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSQueueControlMO.java 2010-03-24 09:42:28 UTC (rev 102865)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSQueueControlMO.java 2010-03-24 09:57:34 UTC (rev 102866)
@@ -1,94 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, Red Hat Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.as.integration.hornetq.management.jms;
-
-import org.hornetq.api.jms.management.JMSQueueControl;
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementObjectID;
-import org.jboss.managed.api.annotation.ManagementOperation;
-import org.jboss.managed.api.annotation.ManagementProperties;
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.jboss.managed.api.annotation.ViewUse;
-
-/**
- * The jms queue control {@code ManagedObject} template.
- *
- * All properties should have {@code ViewUse.STATISTIC} since they are only
- * fetched during runtime using the {@code HornetQControlRuntimeDispatchPlugin}.
- *
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
- at ManagementObject(isRuntime = true, properties = ManagementProperties.EXPLICIT)
-// TODO more management properties (use = ViewUse.STATISTIC) and operations
-public interface JMSQueueControlMO extends JMSQueueControl
-{
-
- @ManagementProperty(name = "name",
- use = ViewUse.CONFIGURATION,
- description = "The queue name")
- @ManagementObjectID( type = "Queue")
- // Name has to match JMSQueueConfigurationMO.getName(); The actual objectName is irrelevant
- public String getName();
-
- @ManagementProperty(description = "The queue address",
- use = ViewUse.STATISTIC, readOnly = true)
- public String getAddress();
-
- @ManagementProperty(description = "The queue dead letter address",
- use = ViewUse.STATISTIC, readOnly = true)
- public String getDeadLetterAddress();
-
- @ManagementProperty(description = "The queue expiry address",
- use = ViewUse.STATISTIC, readOnly = true)
- public String getExpiryAddress();
-
- @ManagementProperty(description = "The queue jndi binding",
- use = ViewUse.STATISTIC, readOnly = true)
- public String getJNDIBinding();
-
- @ManagementProperty(description = "The queue consumer count",
- use = ViewUse.STATISTIC, readOnly = true)
- public int getConsumerCount();
-
- @ManagementProperty(description = "The queue delivering count",
- use = ViewUse.STATISTIC, readOnly = true)
- public int getDeliveringCount();
-
- @ManagementProperty(description = "The queue message count",
- use = ViewUse.STATISTIC, readOnly = true)
- public int getMessageCount() throws Exception;
-
- @ManagementProperty(description = "The queue messages added",
- use = ViewUse.STATISTIC, readOnly = true)
- public int getMessagesAdded();
-
- @ManagementProperty(description = "The queue scheduled count",
- use = ViewUse.STATISTIC, readOnly = true)
- public long getScheduledCount();
-
- @ManagementOperation
- public void resetMessageCounter() throws Exception;
-
-
-}
-
Deleted: 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-24 09:42:28 UTC (rev 102865)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/TopicConfigurationMO.java 2010-03-24 09:57:34 UTC (rev 102866)
@@ -1,57 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2010, Red Hat Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.as.integration.hornetq.management.jms;
-
-import org.hornetq.jms.server.config.TopicConfiguration;
-import org.jboss.managed.api.annotation.ManagementComponent;
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementObjectID;
-import org.jboss.managed.api.annotation.ManagementProperties;
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.jboss.managed.api.annotation.ViewUse;
-
-/**
- * The topic configuration {@code ManagedObject} template.
- *
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
- at ManagementObject( componentType = @ManagementComponent(type = "JMSDestination", subtype = "Topic"),
- properties = ManagementProperties.EXPLICIT)
-public interface TopicConfigurationMO extends TopicConfiguration
-{
-
- @ManagementProperty(name = "name",
- use = ViewUse.CONFIGURATION,
- description = "The topic name",
- includeInTemplate=true)
- @ManagementObjectID(type = "Topic")
- public String getName();
-
- @ManagementProperty(name = "bindings",
- use = ViewUse.CONFIGURATION,
- description = "The topic bindings",
- includeInTemplate=true)
- public String[] getBindings();
-
-}
-
Deleted: trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/TopicControlMO.java
===================================================================
--- trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/TopicControlMO.java 2010-03-24 09:42:28 UTC (rev 102865)
+++ trunk/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/TopicControlMO.java 2010-03-24 09:57:34 UTC (rev 102866)
@@ -1,58 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, Red Hat Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.as.integration.hornetq.management.jms;
-
-import org.hornetq.api.jms.management.TopicControl;
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementObjectID;
-import org.jboss.managed.api.annotation.ManagementOperation;
-import org.jboss.managed.api.annotation.ManagementProperties;
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.jboss.managed.api.annotation.ViewUse;
-
-/**
- * The topic control {@code ManagedObject} template.
- *
- * All properties should have {@code ViewUse.STATISTIC} since they are only
- * fetched during runtime using the {@code HornetQControlRuntimeDispatchPlugin}.
- *
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
- at ManagementObject(isRuntime = true, properties = ManagementProperties.EXPLICIT)
-// TODO more management properties (use = ViewUse.STATISTIC) and operations
-public interface TopicControlMO extends TopicControl
-{
-
- @ManagementProperty(name = "name",
- use = ViewUse.CONFIGURATION,
- description = "The topic name")
- @ManagementObjectID(type = "Topic")
- // Name has to match TopicConfigurationMO.getName(); The actual objectName is irrelevant
- public String getName();
-
- @ManagementOperation
- public void dropAllSubscriptions() throws Exception;
-
-
-}
-
Modified: trunk/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml
===================================================================
--- trunk/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml 2010-03-24 09:42:28 UTC (rev 102865)
+++ trunk/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml 2010-03-24 09:57:34 UTC (rev 102866)
@@ -16,8 +16,6 @@
<bean name="HornetQCoreConfigRealDeployer" class="org.jboss.as.integration.hornetq.deployers.HornetQCoreConfigRealDeployer"/>
<bean name="HornetQJMSParserDeployer" class="org.jboss.as.integration.hornetq.deployers.HornetQJMSParserDeployer">
- <property name="mgtObjectCreator"><inject bean="HornetQManagedObjectCreator" /></property>
- <property name="buildManagedObject">true</property>
</bean>
@@ -43,11 +41,6 @@
</property>
</bean>
- <bean name="HornetQManagedObjectCreator" class="org.jboss.as.integration.hornetq.management.HornetQManagedObjectCreator">
- <constructor><parameter><inject bean="ManagedObjectFactory" /></parameter></constructor>
- <demand>HornetQDestinationCreator</demand>
- </bean>
-
<bean name="JMSQueueManageMO" class="org.jboss.as.integration.hornetq.management.jms.QueueManageImplMO">
<constructor><parameter><inject bean="HornetQServer" /></parameter></constructor>
<demand>JMSServerManager</demand>
Deleted: trunk/hornetq-int/src/test/java/org/jboss/test/hornetq/integration/test/AbstractManagementTestBase.java
===================================================================
--- trunk/hornetq-int/src/test/java/org/jboss/test/hornetq/integration/test/AbstractManagementTestBase.java 2010-03-24 09:42:28 UTC (rev 102865)
+++ trunk/hornetq-int/src/test/java/org/jboss/test/hornetq/integration/test/AbstractManagementTestBase.java 2010-03-24 09:57:34 UTC (rev 102866)
@@ -1,84 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2010, Red Hat Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.test.hornetq.integration.test;
-
-import org.jboss.as.integration.hornetq.management.jms.JMSConfigurationICF;
-import org.jboss.managed.api.ManagedObject;
-import org.jboss.managed.api.factory.ManagedObjectFactory;
-import org.jboss.managed.plugins.factory.ManagedObjectFactoryBuilder;
-import org.jboss.metadata.spi.MetaData;
-import org.jboss.metatype.api.types.MetaTypeFactory;
-import org.jboss.metatype.api.values.MetaValueFactory;
-import org.jboss.metatype.plugins.types.MetaTypeFactoryBuilder;
-import org.jboss.metatype.plugins.values.MetaValueFactoryBuilder;
-import org.jboss.test.BaseTestCase;
-
-/**
- * The abstract management object unit test base.
- *
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class AbstractManagementTestBase extends BaseTestCase
-{
-
- /** The managed object factory. */
- private static final ManagedObjectFactory mof = ManagedObjectFactoryBuilder.create();
-
- /** The meta type factory. */
- private static final MetaTypeFactory typeFactory = MetaTypeFactoryBuilder.create();
-
- /** The meta value factory. */
- private static final MetaValueFactory valueFactory = MetaValueFactoryBuilder.create();
-
- static
- {
- mof.addInstanceClassFactory(new JMSConfigurationICF(mof));
- }
-
- public AbstractManagementTestBase(String name)
- {
- super(name);
- }
-
- public ManagedObjectFactory getMof()
- {
- return mof;
- }
-
- public MetaTypeFactory getTypefactory()
- {
- return typeFactory;
- }
-
- public MetaValueFactory getValuefactory()
- {
- return valueFactory;
- }
-
- ManagedObject initManagedObject(Object instance, Class<?> instanceType, MetaData metaData)
- {
- return getMof().initManagedObject(instance, instanceType, metaData, null, null);
- }
-
-}
-
Deleted: trunk/hornetq-int/src/test/java/org/jboss/test/hornetq/integration/test/BasicJMSConfigurationMOUnitTestCase.java
===================================================================
--- trunk/hornetq-int/src/test/java/org/jboss/test/hornetq/integration/test/BasicJMSConfigurationMOUnitTestCase.java 2010-03-24 09:42:28 UTC (rev 102865)
+++ trunk/hornetq-int/src/test/java/org/jboss/test/hornetq/integration/test/BasicJMSConfigurationMOUnitTestCase.java 2010-03-24 09:57:34 UTC (rev 102866)
@@ -1,166 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2010, Red Hat Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.test.hornetq.integration.test;
-
-import java.util.Collections;
-
-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.hornetq.jms.server.config.impl.ConnectionFactoryConfigurationImpl;
-import org.hornetq.jms.server.config.impl.JMSConfigurationImpl;
-import org.hornetq.jms.server.config.impl.JMSQueueConfigurationImpl;
-import org.hornetq.jms.server.config.impl.TopicConfigurationImpl;
-import org.jboss.as.integration.hornetq.management.jms.JMSConfigurationMO;
-import org.jboss.managed.api.ManagedObject;
-import org.jboss.managed.api.ManagedProperty;
-import org.jboss.metadata.plugins.loader.reflection.AnnotatedElementMetaDataLoader;
-import org.jboss.metadata.spi.MetaData;
-import org.jboss.metadata.spi.retrieval.MetaDataRetrievalToMetaDataBridge;
-import org.jboss.metatype.api.values.CollectionValue;
-import org.jboss.metatype.api.values.GenericValue;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.SimpleValue;
-
-/**
- * Basic test case for the {@code JMSConfiguration} managed object.
- *
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class BasicJMSConfigurationMOUnitTestCase extends AbstractManagementTestBase
-{
-
- /** The jms configuration meta data. */
- private static final MetaData configurationMetaData;
-
- static
- {
- AnnotatedElementMetaDataLoader loader = new AnnotatedElementMetaDataLoader(JMSConfigurationMO.class);
- configurationMetaData = new MetaDataRetrievalToMetaDataBridge(loader);
- }
-
- public BasicJMSConfigurationMOUnitTestCase(String name)
- {
- super(name);
- }
-
- public void testJMSConfiguration()
- {
- ManagedObject mo = initJMSConfigurationMO();
-
- ManagedProperty queues = mo.getProperty("queue-configurations");
- assertNotNull(queues);
- assertTrue(queues.getMetaType().isCollection());
-
- ManagedProperty topics = mo.getProperty("topic-configurations");
- assertNotNull(topics);
- assertTrue(topics.getMetaType().isCollection());
-
- ManagedProperty factories = mo.getProperty("connection-factory-configurations");
- assertNotNull(factories);
- assertTrue(factories.getMetaType().isCollection());
-
- }
-
- public void testConnectionFactories()
- {
- ManagedObject mo = initJMSConfigurationMO();
-
- // Get the nested connection factory
- ManagedObject cf = getNestedManagedObject(mo.getProperty("connection-factory-configurations"));
- assertNotNull(cf.getProperty("name"));
- assertEquals("cf1", ((SimpleValue)cf.getProperty("name").getValue()).getValue());
- assertTrue(cf.getParent() == mo);
- }
-
- public void testQueue()
- {
- ManagedObject mo = initJMSConfigurationMO();
-
- // Get the nested queue
- ManagedObject queue = getNestedManagedObject(mo.getProperty("queue-configurations"));
- assertNotNull(queue.getProperty("name"));
- assertEquals("queue1", ((SimpleValue)queue.getProperty("name").getValue()).getValue());
-
- assertTrue(queue.getParent() == mo);
- }
-
- public void testTopic()
- {
- ManagedObject mo = initJMSConfigurationMO();
-
- // Get the nested topic
- ManagedObject topic = getNestedManagedObject(mo.getProperty("topic-configurations"));
- assertNotNull(topic.getProperty("name"));
- assertEquals("topic1", ((SimpleValue)topic.getProperty("name").getValue()).getValue());
- assertTrue(topic.getParent() == mo);
- }
-
- ManagedObject initJMSConfigurationMO()
- {
- JMSConfiguration configuration = createTestMetaData();
- ManagedObject mo = initManagedObject(configuration, JMSConfiguration.class, configurationMetaData);
- assertNotNull(mo);
- return mo;
- }
-
- ManagedObject getNestedManagedObject(ManagedProperty property)
- {
- MetaValue value = property.getValue();
- assertNotNull(property.getName(), value);
- return getNestedManagedObject(value);
- }
-
- ManagedObject getNestedManagedObject(MetaValue value)
- {
- assertTrue(value.getMetaType().isCollection());
- GenericValue generic = GenericValue.class.cast(((CollectionValue)value).getElements()[0]);
- return ManagedObject.class.cast(generic.getValue());
- }
-
- JMSConfiguration createTestMetaData()
- {
- return new JMSConfigurationImpl(
- Collections.singletonList(createConnectionFactoryMetaData()),
- Collections.singletonList(createQueueMetaData()),
- Collections.singletonList(createTopicConfiguration()));
- }
-
- JMSQueueConfiguration createQueueMetaData()
- {
- return new JMSQueueConfigurationImpl("queue1", "selector", true, "binding1");
- }
-
- TopicConfiguration createTopicConfiguration()
- {
- return new TopicConfigurationImpl("topic1", "binding1");
- }
-
- ConnectionFactoryConfiguration createConnectionFactoryMetaData()
- {
- return new ConnectionFactoryConfigurationImpl("cf1", "binding1");
- }
-
-}
-
More information about the jboss-cvs-commits
mailing list