[jboss-cvs] JBossAS SVN: r103400 - in projects/profileservice/trunk/domain/src: main/java/org/jboss/profileservice/domain/resources and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Apr 1 03:12:10 EDT 2010


Author: scott.stark at jboss.org
Date: 2010-04-01 03:12:09 -0400 (Thu, 01 Apr 2010)
New Revision: 103400

Added:
   projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/DependsMetaData.java
   projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/resources/JmsResource.java
   projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/resources/QueueResource.java
   projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/resources/TopicResource.java
Modified:
   projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/AbstractDomainMetaData.java
   projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/resources/JdbcResource.java
   projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/spi/DomainMetaData.java
   projects/profileservice/trunk/domain/src/test/resources/parsing/domain.xml
Log:
Add jms-resources

Modified: projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/AbstractDomainMetaData.java
===================================================================
--- projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/AbstractDomainMetaData.java	2010-04-01 07:07:30 UTC (rev 103399)
+++ projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/AbstractDomainMetaData.java	2010-04-01 07:12:09 UTC (rev 103400)
@@ -26,6 +26,7 @@
 import javax.xml.bind.annotation.XmlAnyElement;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlElements;
 import javax.xml.bind.annotation.XmlNs;
 import javax.xml.bind.annotation.XmlNsForm;
 import javax.xml.bind.annotation.XmlRootElement;
@@ -33,10 +34,11 @@
 import javax.xml.bind.annotation.XmlType;
 
 import org.jboss.profileservice.domain.resources.JdbcResource;
+import org.jboss.profileservice.domain.resources.JmsResource;
+import org.jboss.profileservice.domain.resources.QueueResource;
+import org.jboss.profileservice.domain.resources.TopicResource;
 import org.jboss.profileservice.domain.spi.DomainFeatureNode;
 import org.jboss.profileservice.domain.spi.DomainMetaData;
-import org.jboss.profileservice.domain.threadpool.BasicThreadPoolMetaData;
-import org.jboss.profileservice.domain.threadpool.IThreadPool;
 import org.jboss.profileservice.domain.threadpool.ThreadsMetaData;
 import org.jboss.xb.annotations.JBossXmlNsPrefix;
 import org.jboss.xb.annotations.JBossXmlSchema;
@@ -53,9 +55,10 @@
       replacePropertyRefs=true,
       xmlns={@XmlNs(namespaceURI=DomainMetaData.SERVER_NAMESPACE, prefix="server"),
       @XmlNs(namespaceURI=DomainMetaData.JDBC_RESOURCES_NAMESPACE, prefix="jdbc"),
+      @XmlNs(namespaceURI=DomainMetaData.JMS_RESOURCES_NAMESPACE, prefix="jms"),
       @XmlNs(namespaceURI=DomainMetaData.THREADS_NAMESPACE, prefix="tp")})
 @XmlRootElement(name = "domain")
- at XmlType(name = "domainType", propOrder = {"server", "jdbcResources", "threads", "features"})
+ at XmlType(name = "domainType", propOrder = {"server", "jdbcResources", "jmsResources", "threads", "features"})
 public class AbstractDomainMetaData implements DomainMetaData
 {
 
@@ -68,6 +71,7 @@
    /** The thread pools of the domain. */
    private ThreadsMetaData threadPools;
    private List<JdbcResource> jdbcResources;
+   private List<JmsResource> jmsResources;
 
    /** The elements of the domain. */
    private List<DomainFeatureNode> features;
@@ -127,6 +131,21 @@
       this.threadPools = threadPools;
    }
 
+   @XmlElementWrapper(name="jms-resources", namespace=DomainMetaData.JMS_RESOURCES_NAMESPACE)
+   @XmlElements({
+         @XmlElement(name="queue", type=QueueResource.class),
+         @XmlElement(name="topic", type=TopicResource.class)
+   })
+   @JBossXmlNsPrefix(prefix="jms")
+   public List<JmsResource> getJmsResources()
+   {
+      return jmsResources;
+   }
+   public void setJmsResources(List<JmsResource> jmsResources)
+   {
+      this.jmsResources = jmsResources;
+   }
+
    /**
     * Get the domain elements.
     * 

Added: projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/DependsMetaData.java
===================================================================
--- projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/DependsMetaData.java	                        (rev 0)
+++ projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/DependsMetaData.java	2010-04-01 07:12:09 UTC (rev 103400)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * 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.profileservice.domain;
+
+import java.util.List;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class DependsMetaData
+{
+   private List<String> depends;
+
+   public List<String> getDepends()
+   {
+      return depends;
+   }
+   public void setDepends(List<String> depends)
+   {
+      this.depends = depends;
+   }
+
+}

Modified: projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/resources/JdbcResource.java
===================================================================
--- projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/resources/JdbcResource.java	2010-04-01 07:07:30 UTC (rev 103399)
+++ projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/resources/JdbcResource.java	2010-04-01 07:12:09 UTC (rev 103400)
@@ -41,7 +41,6 @@
       normalizeSpace=true,
       replacePropertyRefs=true
 )
- at XmlRootElement(name = "jdbc-resources")
 @XmlType(name="jdbcResType", propOrder={})
 public class JdbcResource
 {

Added: projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/resources/JmsResource.java
===================================================================
--- projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/resources/JmsResource.java	                        (rev 0)
+++ projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/resources/JmsResource.java	2010-04-01 07:12:09 UTC (rev 103400)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * 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.profileservice.domain.resources;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlTransient;
+
+import org.jboss.profileservice.domain.DependsMetaData;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class JmsResource
+{
+   private String name;
+   private boolean isQueue;
+   private DependsMetaData depends;
+
+   protected JmsResource(boolean isQueue)
+   {
+      this.isQueue = isQueue;
+   }
+
+   @XmlAttribute
+   public String getName()
+   {
+      return name;
+   }
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   @XmlTransient
+   public boolean isQueue()
+   {
+      return isQueue;
+   }
+   public boolean isTopic()
+   {
+      return isQueue == false;
+   }
+
+   public DependsMetaData getDepends()
+   {
+      return depends;
+   }
+   public void setDepends(DependsMetaData depends)
+   {
+      this.depends = depends;
+   }
+}

Added: projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/resources/QueueResource.java
===================================================================
--- projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/resources/QueueResource.java	                        (rev 0)
+++ projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/resources/QueueResource.java	2010-04-01 07:12:09 UTC (rev 103400)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * 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.profileservice.domain.resources;
+
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+ at XmlType(name="topicType", propOrder={})
+public class QueueResource extends JmsResource
+{
+   public QueueResource()
+   {
+      super(true);
+   }
+}

Added: projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/resources/TopicResource.java
===================================================================
--- projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/resources/TopicResource.java	                        (rev 0)
+++ projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/resources/TopicResource.java	2010-04-01 07:12:09 UTC (rev 103400)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * 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.profileservice.domain.resources;
+
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+ at XmlType(name="topicType", propOrder={})
+public class TopicResource extends JmsResource
+{
+   public TopicResource()
+   {
+      super(false);
+   }
+}

Modified: projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/spi/DomainMetaData.java
===================================================================
--- projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/spi/DomainMetaData.java	2010-04-01 07:07:30 UTC (rev 103399)
+++ projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/spi/DomainMetaData.java	2010-04-01 07:12:09 UTC (rev 103400)
@@ -38,6 +38,8 @@
    String SERVER_NAMESPACE = "urn:jboss:profileservice:server:1.0";
    /** The jdbc resources xml namespace. */
    String JDBC_RESOURCES_NAMESPACE = "urn:jboss:profileservice:jdbc-resources:1.0";
+   /** The jms resources xml namespace. */
+   String JMS_RESOURCES_NAMESPACE = "urn:jboss:profileservice:jms-resources:1.0";
    /** The threads xml namespace. */
    String THREADS_NAMESPACE = "urn:jboss:profileservice:threads:1.0";
 

Modified: projects/profileservice/trunk/domain/src/test/resources/parsing/domain.xml
===================================================================
--- projects/profileservice/trunk/domain/src/test/resources/parsing/domain.xml	2010-04-01 07:07:30 UTC (rev 103399)
+++ projects/profileservice/trunk/domain/src/test/resources/parsing/domain.xml	2010-04-01 07:12:09 UTC (rev 103400)
@@ -47,6 +47,13 @@
       </jdbc-resource>
      </jdbc-resources>
 
+   <jms-resources xmls="urn:jboss:profileservice:jms-resources:1.0">
+      <topic name="topic/MyTopic" />
+      <queue name="queue/MyQueue">
+         <depends name="someDependencyRealNameNotJMXObjectName" />
+      </queue> 
+   </jms-resources>
+
  	<threads xmlns="urn:jboss:profileservice:threads:1.0">
 
       <!-- The system thread group for all JBoss threads. -->




More information about the jboss-cvs-commits mailing list