[jboss-cvs] JBoss Messaging SVN: r3323 - in branches/Branch_MC_Integration_New: src/etc/server/default/deploy and 5 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Nov 13 13:29:00 EST 2007


Author: ataylor
Date: 2007-11-13 13:29:00 -0500 (Tue, 13 Nov 2007)
New Revision: 3323

Modified:
   branches/Branch_MC_Integration_New/build-messaging.xml
   branches/Branch_MC_Integration_New/build-thirdparty.xml
   branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jbm-beans.xml
   branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jbm-configuration.xml
   branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/Configuration.java
   branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryDeployer.java
   branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/DestinationDeployer.java
   branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/JBMBootstrapServer.java
   branches/Branch_MC_Integration_New/tests/build.xml
Log:
initial microcontainer integration, updated deployment config files

Modified: branches/Branch_MC_Integration_New/build-messaging.xml
===================================================================
--- branches/Branch_MC_Integration_New/build-messaging.xml	2007-11-13 18:27:17 UTC (rev 3322)
+++ branches/Branch_MC_Integration_New/build-messaging.xml	2007-11-13 18:29:00 UTC (rev 3323)
@@ -110,6 +110,7 @@
    <property name="build.todo" value="${project.output}/todo"/>
    <property name="build.jar" value="${project.output}/jar"/>
    <property name="build.sar" value="${project.output}/sar"/>
+   <property name="build.embedded" value="${project.output}/embedded"/>
    <property name="project.thirdparty" value="${project.root}/thirdparty"/>
    <property name="release.output" value="${project.root}/release/jboss-messaging-${module.version}"/>
 
@@ -366,11 +367,88 @@
 
    <target name="sar-structure" depends="jar-structure">
       <copy todir="${build.sar}/META-INF" file="${source.etc}/server/default/deploy/jbm-beans.xml"/>
-      <copy todir="${build.sar}" file="${source.etc}/server/default/deploy/jbm-destinations.xml"/>
       <copy todir="${build.sar}" file="${source.etc}/server/default/deploy/jbm-configuration.xml"/>
-      <copy todir="${build.sar}" file="${source.etc}/server/default/deploy/jbm-connection-factories.xml"/>
    </target>
 
+   <target name="embedded-structure" depends="jar-structure">
+      <mkdir dir="${build.embedded}"/>
+      <mkdir dir="${build.embedded}/lib"/>
+      <copy todir="${build.embedded}">
+         <fileset dir="${source.etc}/server/standalone/">
+            <include name="**/*"/>
+         </fileset>
+      </copy>
+      <copy todir="${build.embedded}/config" file="${source.etc}/server/default/deploy/jbm-beans.xml"/>
+      <copy todir="${build.embedded}/config" file="${source.etc}/server/default/deploy/multiplexer-stacks.xml"/>
+      <copy todir="${build.embedded}/config" file="${source.etc}/server/default/deploy/jbm-configuration.xml"/>
+
+      <jar jarfile="${build.embedded}/lib/jboss-${module.name}.jar" manifest="${build.etc}/embedded.mf">
+         <fileset dir="${build.classes}" includes="**"/>
+         <fileset dir="${build.jar}">
+            <exclude name="*-service.xml"/>
+            <exclude name="*-ds.xml"/>
+            <exclude name="messaging-*.properties"/>
+         </fileset>
+      </jar>
+      <copy todir="${build.embedded}/lib">
+         <fileset dir="${jboss.microcontainer.lib}">
+            <include name="jboss-container.jar"/>
+            <include name="jboss-kernel.jar"/>
+            <include name="jboss-dependency.jar"/>
+         </fileset>
+         <fileset dir="${jbossas.core.libs.lib}">
+            <include name="jboss-j2ee.jar"/>
+            <include name="jboss-common.jar"/>
+            <include name="jboss-xml-binding.jar"/>
+            <include name="jbosssx-client.jar"/>
+            <include name="jboss-system.jar"/>
+            <include name="jboss-jmx.jar"/>
+         </fileset>
+         <fileset dir="${jboss.common.core.lib}">
+            <include name="jboss-common-core.jar"/>
+         </fileset>
+         <fileset dir="${oswego.concurrent.lib}">
+            <include name="concurrent.jar"/>
+         </fileset>
+         <fileset dir="${project.thirdparty}/naming/">
+            <include name="jnp-client.jar"/>
+            <include name="jnpserver.jar"/>
+         </fileset>
+         <fileset dir="${apache.xerces.lib}">
+            <include name="xercesImpl.jar"/>
+         </fileset>
+         <fileset dir="${jgroups.jgroups.lib}">
+            <include name="jgroups.jar"/>
+         </fileset>
+         <fileset dir="${jboss.remoting.lib}">
+            <include name="jboss-remoting.jar"/>
+         </fileset>
+         <fileset dir="${apache.logging.lib}">
+            <include name="commons-logging.jar"/>
+         </fileset>
+         <fileset dir="${apache.log4j.lib}">
+            <include name="log4j.jar"/>
+         </fileset>
+         <fileset dir="${hsqldb.hsqldb.lib}">
+            <include name="hsqldb.jar"/>
+         </fileset>
+         <fileset dir="${jboss.jbossts14.lib}">
+            <include name="jbossjta.jar"/>
+            <include name="jbossts-common.jar"/>
+            <include name="jbossjta-integration.jar"/>
+         </fileset>
+         <fileset dir="${jboss.aop.lib}">
+            <include name="jboss-aop-jdk50.jar"/>
+         </fileset>
+         <fileset dir="${trove.lib}">
+            <include name="trove.jar"/>
+         </fileset>
+         <fileset dir="${javassist.lib}">
+            <include name="javassist.jar"/>
+         </fileset>
+      </copy>
+   </target>
+
    <target name="artifacts" depends="jar, sar, client-jar"/>
 
    <target name="client-jar" depends="compile">

Modified: branches/Branch_MC_Integration_New/build-thirdparty.xml
===================================================================
--- branches/Branch_MC_Integration_New/build-thirdparty.xml	2007-11-13 18:27:17 UTC (rev 3322)
+++ branches/Branch_MC_Integration_New/build-thirdparty.xml	2007-11-13 18:29:00 UTC (rev 3323)
@@ -88,11 +88,12 @@
       <componentref name="jgroups" version="2.4.1.SP3-brew"/>
       <componentref name="trove" version="1.0.2-brew"/>
       <componentref name="jboss/common" version="1.2.1.GA"/>
-      <componentref name="jboss/aop" version="2.0.0.alpha4"/>
+      <componentref name="jboss/common-core" version="2.2.2.GA"/>
+      <componentref name="jboss/aop" version="2.0.0.beta2"/>
       <componentref name="jboss/remoting" version="2.2.2.SP1-brew"/>
       <componentref name="jboss/jbossts14" version="4.2.3.SP3"/>
       <componentref name="jbossas/core-libs" version="4.2.1.GA"/>
-      <componentref name="jboss/microcontainer" version="2.0.0.Beta4"/>
+      <componentref name="jboss/microcontainer" version="2.0.0.Beta5"/>        
 
 
       <!--
@@ -114,7 +115,7 @@
       <componentref name="jboss/test14" version="1.0.0.GA"/>
 
       <!-- This is a non declared dependency of jboss/test14 -->
-      <componentref name="jboss/jbossretro-rt" version="1.0.5.GA"/>
+      <!--<componentref name="jboss/jbossretro-rt" version="1.0.5.GA"/>-->
       <!-- This is a non declared dependency of jboss/test14 -->
       <componentref name="jboss/backport-concurrent" version="2.1.0.GA"/>
 

Modified: branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jbm-beans.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jbm-beans.xml	2007-11-13 18:27:17 UTC (rev 3322)
+++ branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jbm-beans.xml	2007-11-13 18:29:00 UTC (rev 3323)
@@ -130,7 +130,7 @@
       <constructor>
          <parameter>bisocket</parameter>
          <parameter>localhost</parameter>
-         <parameter>5400</parameter>
+         <parameter><inject bean="Configuration" property="remotingBindAddress"/> </parameter>
          <parameter>
             <null/>
          </parameter>

Modified: branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jbm-configuration.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jbm-configuration.xml	2007-11-13 18:27:17 UTC (rev 3322)
+++ branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jbm-configuration.xml	2007-11-13 18:29:00 UTC (rev 3323)
@@ -1,74 +1,229 @@
-<configuration>
-   <!-- The unique id of the server peer - in a cluster each node MUST have a unique value - must be an integer -->
-   <server-peer-id>0</server-peer-id>
-   <!-- The default JNDI context to use for queues when they are deployed without specifying one -->
-   <default-queue-jndi-context>/queue</default-queue-jndi-context>
-   <!-- The default JNDI context to use for topics when they are deployed without specifying one -->
-   <default-topic-jndi-context>/topic</default-topic-jndi-context>
-   <!-- The JAAS security domain to use for JBoss Messaging -->
-   <security-domain>java:/jaas/messaging</security-domain>
-   <!-- The default security configuration to apply to destinations - this can be overridden on a per destination basis -->
-   <default-security-config>
-      <role name="guest" read="true" write="true" create="true"/>
-   </default-security-config>
-   <!-- The default Dead Letter Queue (DLQ) to use for destinations. This can be overridden on a per destinatin basis -->
-   <defaul-dlq>DLQ</defaul-dlq>
-   <!-- The default maximum number of times to attempt delivery of a message before sending to the DLQ (if configured).
+<deployment>
+   <configuration>
+      <!-- The unique id of the server peer - in a cluster each node MUST have a unique value - must be an integer -->
+      <server-peer-id>0</server-peer-id>
+      <!-- The default JNDI context to use for queues when they are deployed without specifying one -->
+      <default-queue-jndi-context>/queue</default-queue-jndi-context>
+      <!-- The default JNDI context to use for topics when they are deployed without specifying one -->
+      <default-topic-jndi-context>/topic</default-topic-jndi-context>
+      <!-- The JAAS security domain to use for JBoss Messaging -->
+      <security-domain>java:/jaas/messaging</security-domain>
+      <!-- The default security configuration to apply to destinations - this can be overridden on a per destination basis -->
+      <default-security-config>
+         <role name="guest" read="true" write="true" create="true"/>
+      </default-security-config>
+      <!-- The default Dead Letter Queue (DLQ) to use for destinations. This can be overridden on a per destinatin basis -->
+      <defaul-dlq>DLQ</defaul-dlq>
+      <!-- The default maximum number of times to attempt delivery of a message before sending to the DLQ (if configured).
 This can be overridden on a per destinatin basis -->
-   <default-max-delivery-attempts>10</default-max-delivery-attempts>
-   <!-- The default Expiry Queue to use for destinations. This can be overridden on a per destinatin basis -->
-   <default-expiry-queue>ExpiryQueue</default-expiry-queue>
-   <!-- The default redelivery delay to impose. This can be overridden on a per destination basis -->
-   <default-redelivery-delay>0</default-redelivery-delay>
-   <!-- The periodicity of the message counter manager enquiring on queues for statistics -->
-   <message-counter-sample-period>5000</message-counter-sample-period>
-   <!-- The maximum amount of time for a client to wait for failover to start on the server side after
-it has detected failure -->
-   <failover-start-timeout>60000</failover-start-timeout>
-   <!-- The maximum amount of time for a client to wait for failover to complete on the server side after
-it has detected failure -->
-   <failover-complete-timeout>300000</failover-complete-timeout>
-   <!-- The maximum number of days results to maintain in the message counter history -->
-   <default-message-counter-history-day-limit>-1</default-message-counter-history-day-limit>
-   <!-- The name of the connection factory to use for creating connections between nodes to pull messages -->
-   <cluster-pull-connection-factory-name>jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory</cluster-pull-connection-factory-name>
+      <default-max-delivery-attempts>10</default-max-delivery-attempts>
+      <!-- The default Expiry Queue to use for destinations. This can be overridden on a per destinatin basis -->
+      <default-expiry-queue>ExpiryQueue</default-expiry-queue>
+      <!-- The default redelivery delay to impose. This can be overridden on a per destination basis -->
+      <default-redelivery-delay>0</default-redelivery-delay>
+      <!-- The periodicity of the message counter manager enquiring on queues for statistics -->
+      <message-counter-sample-period>5000</message-counter-sample-period>
+      <!-- The maximum amount of time for a client to wait for failover to start on the server side after
+  it has detected failure -->
+      <failover-start-timeout>60000</failover-start-timeout>
+      <!-- The maximum amount of time for a client to wait for failover to complete on the server side after
+  it has detected failure -->
+      <failover-complete-timeout>300000</failover-complete-timeout>
+      <!-- The maximum number of days results to maintain in the message counter history -->
+      <default-message-counter-history-day-limit>-1</default-message-counter-history-day-limit>
+      <!-- The name of the connection factory to use for creating connections between nodes to pull messages -->
+      <cluster-pull-connection-factory-name>jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory
+      </cluster-pull-connection-factory-name>
 
-   <!-- Use XA when pulling persistent messages from a remote node to this one. -->
-   <use-xa-for-message-pull>true</use-xa-for-message-pull>
-   <!-- When redistributing messages in the cluster. Do we need to preserve the order of messages received
+      <!-- Use XA when pulling persistent messages from a remote node to this one. -->
+      <use-xa-for-message-pull>true</use-xa-for-message-pull>
+      <!-- When redistributing messages in the cluster. Do we need to preserve the order of messages received
 by a particular consumer from a particular producer? -->
-   <default-preserve-ordering>false</default-preserve-ordering>
+      <default-preserve-ordering>false</default-preserve-ordering>
 
-   <!-- Max. time to hold previously delivered messages back waiting for clients to reconnect after failover -->
-   <recover-deliveries-timeout>300000</recover-deliveries-timeout>
+      <!-- Max. time to hold previously delivered messages back waiting for clients to reconnect after failover -->
+      <recover-deliveries-timeout>300000</recover-deliveries-timeout>
 
 
-   <!-- The password used by the message sucker connections to create connections.
-        THIS SHOULD ALWAYS BE CHANGED AT INSTALL TIME TO SECURE SYSTEM
-   <suckerPassword></suckerPassword>
-   -->
-   <strict-tck>false</strict-tck>
-   <post-office-name>JMS post office</post-office-name>
+      <!-- The password used by the message sucker connections to create connections.
+           THIS SHOULD ALWAYS BE CHANGED AT INSTALL TIME TO SECURE SYSTEM
+      <suckerPassword></suckerPassword>
+      -->
+      <strict-tck>false</strict-tck>
+      <post-office-name>JMS post office</post-office-name>
 
-   <clustered>false</clustered>
+      <clustered>false</clustered>
 
-   <!-- All the remaining properties only have to be specified if the post office is clustered.
+      <!-- All the remaining properties only have to be specified if the post office is clustered.
 You can safely comment them out if your post office is non clustered -->
 
-   <!-- The JGroups group name that the post office will use -->
+      <!-- The JGroups group name that the post office will use -->
 
-   <!--<group-name>MessagingPostOffice</group-name>-->
+      <!--<group-name>MessagingPostOffice</group-name>-->
 
-   <!-- Max time to wait for state to arrive when the post office joins the cluster -->
+      <!-- Max time to wait for state to arrive when the post office joins the cluster -->
 
-   <!--<state-timeout>5000</state-timeout>-->
+      <!--<state-timeout>5000</state-timeout>-->
 
-   <!-- Max time to wait for a synchronous call to node members using the MessageDispatcher -->
+      <!-- Max time to wait for a synchronous call to node members using the MessageDispatcher -->
 
-  <!-- <cast-timeout>50000</cast-timeout>
+      <!-- <cast-timeout>50000</cast-timeout>
 
-   <control-channel-name>udp-sync</control-channel-name>
-   <data-channel-name>udp</data-channel-name>
-   <channel-partition-name>${jboss.partition.name:DefaultPartition}-JMS</channel-partition-name>-->
+      <control-channel-name>udp-sync</control-channel-name>
+      <data-channel-name>udp</data-channel-name>
+      <channel-partition-name>${jboss.partition.name:DefaultPartition}-JMS</channel-partition-name>-->
 
-</configuration>
\ No newline at end of file
+      <remoting-bind-address>5400</remoting-bind-address>
+
+   </configuration>
+
+   <factories>
+
+      <!-- The default connection factory does not support automatic failover or load balancing-
+           this is so we can maintain compatiblity with applications written for JBoss MQ which use this
+           connection factory.
+      -->
+      <factory name="ConnectionFactory">
+         <jndi-bindings>
+            <binding>/ConnectionFactory</binding>
+            <binding>/XAConnectionFactory</binding>
+            <binding>java:/ConnectionFactory</binding>
+            <binding>java:/XAConnectionFactory</binding>
+         </jndi-bindings>
+      </factory>
+
+      <factory name="ClusteredConnectionFactory">
+         <jndi-bindings>
+            <binding>/ClusteredConnectionFactory</binding>
+            <binding>/ClusteredXAConnectionFactory</binding>
+            <binding>java:/ClusteredConnectionFactory</binding>
+            <binding>java:/ClusteredXAConnectionFactory</binding>
+         </jndi-bindings>
+         <supports-failover>true</supports-failover>
+         <supports-load-balancing>true</supports-load-balancing>
+      </factory>
+
+      <factory name="jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory">
+         <supports-failover>true</supports-failover>
+         <supports-load-balancing>true</supports-load-balancing>
+      </factory>
+      <!-- An example connection factory with all attributes shown  -->
+
+      <factory name="jboss.messaging.connectionfactory:service=MyExampleConnectionFactory">
+         <!-- You can specify the default Client ID to use for connections created using this factory -->
+         <client-id>MyClientID</client-id>
+         <!-- PrefetchSize determines the approximate maximum number of messages the client consumer will buffer locally -->
+         <prefetch-size>150</prefetch-size>
+         <!-- Paging params to be used for temporary queues -->
+         <default-temp-queue-full-size>200000</default-temp-queue-full-size>
+         <default-temp-queue-page-size>2000</default-temp-queue-page-size>
+         <default-temp-queue-down-cache-size>2000</default-temp-queue-down-cache-size>
+         <!-- The batch size to use when using the DUPS_OK_ACKNOWLEDGE acknowledgement mode -->
+         <dups-ok-batch-size>5000</dups-ok-batch-size>
+         <!-- Does this connection factory support automatic failover? -->
+         <supports-failover>false</supports-failover>
+         <!-- Does this connection factory support automatic client side load balancing? -->
+         <supports-load-balancing>false</supports-load-balancing>
+         <!-- The class name of the factory used to create the load balancing policy to use on the client side -->
+         <load-balancing-factory>org.jboss.jms.client.plugin.RoundRobinLoadBalancingFactory</load-balancing-factory>
+         <!-- Whether we should be strict TCK compliant, i.e. how we deal with foreign messages, defaults to false-->
+         <strict-tck>true</strict-tck>
+         <!-- Disable JBoss Remoting Connector sanity checks - There is rarely a good reason to set this to true -->
+         <disable-remoting-checks>false</disable-remoting-checks>
+         <!-- The connection factory will be bound in the following places in JNDI -->
+         <jndi-bindings>
+            <binding>/acme/MyExampleConnectionFactory</binding>
+            <binding>/acme/MyExampleConnectionFactoryDupe</binding>
+            <binding>java:/xyz/CF1</binding>
+            <binding>java:/connectionfactories/acme/connection_factory</binding>
+         </jndi-bindings>
+      </factory>
+
+   </factories>
+
+   <destinations>
+      <!--
+         The Default Dead Letter Queue. This destination is a dependency of an EJB MDB container.
+      -->
+      <queue name="DLQ"/>
+      <!--
+         The Default Expiry Queue.
+      -->
+      <queue name="ExpiryQueue"/>
+      <!--
+           Example destinations.
+      -->
+      <topic name="testTopic">
+         <security>
+            <role name="guest" read="true" write="true"/>
+            <role name="publisher" read="true" write="true" create="false"/>
+            <role name="durpublisher" read="true" write="true" create="true"/>
+         </security>
+      </topic>
+
+      <topic name="securedTopic">
+         <security>
+            <role name="publisher" read="true" write="true" create="false"/>
+         </security>
+      </topic>
+
+      <topic name="testDurableTopic">
+         <security>
+            <role name="guest" read="true" write="true"/>
+            <role name="publisher" read="true" write="true" create="false"/>
+            <role name="durpublisher" read="true" write="true" create="true"/>
+         </security>
+      </topic>
+
+      <queue name="testQueue">
+         <security>
+            <role name="guest" read="true" write="true"/>
+            <role name="publisher" read="true" write="true" create="false"/>
+            <role name="noacc" read="false" write="false" create="false"/>
+         </security>
+      </queue>
+
+      <queue name="A"/>
+      <queue name="B"/>
+      <queue name="C"/>
+      <queue name="D"/>
+      <queue name="ex"/>
+
+      <!-- It's possible for indiviual queues and topics to use a specific queue for
+  an expiry or DLQ -->
+
+      <queue name="PrivateDLQ"/>
+      <queue name="PrivateExpiryQueue"/>
+      <queue name="QueueWithOwnDLQAndExpiryQueue">
+         <dlq>PrivateDLQ</dlq>
+         <expiry-queue>PrivateExpiryQueue</expiry-queue>
+      </queue>
+
+      <topic name="TopicWithOwnDLQAndExpiryQueue">
+         <dlq>PrivateDLQ</dlq>
+         <expiry-queue>PrivateExpiryQueue</expiry-queue>
+      </topic>
+
+      <!-- Queues and Topics can also specify their own redelivery delay -->
+      <queue name="QueueWithOwnRedeliveryDelay">
+         <redelivery-delay>5000</redelivery-delay>
+      </queue>
+
+      <topic name="TopicWithOwnRedeliveryDelay">
+         <redelivery-delay>5000</redelivery-delay>
+      </topic>
+
+      <!--
+           Example clustered destinations.
+      -->
+      <queue name="testDistributedQueue">
+         <clustered>true</clustered>
+      </queue>
+
+      <topic name="testDistributedTopic">
+         <clustered>true</clustered>
+      </topic>
+
+   </destinations>
+
+</deployment>
\ No newline at end of file

Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/Configuration.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/Configuration.java	2007-11-13 18:27:17 UTC (rev 3322)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/Configuration.java	2007-11-13 18:29:00 UTC (rev 3323)
@@ -100,6 +100,8 @@
 
    private  Boolean _useJGroupsWorkaround = false;
 
+   private Integer _remotingBindAddress;
+
    public void start() throws Exception
    {
       propertyChangeSupport = new PropertyChangeSupport(this);
@@ -136,6 +138,7 @@
       _dataChannelName = getString(e, "data-channel-name", _dataChannelName);
       _channelPartitionName = getString(e, "channel-partition-name", _channelPartitionName);
       _maxConcurrentReplications = getInteger(e, "max-concurrent-replications", _maxConcurrentReplications);
+      _remotingBindAddress = getInteger(e, "remoting-bind-address", _remotingBindAddress);
       NodeList security = e.getElementsByTagName("default-security-config");
       if (security.getLength() > 0)
       {
@@ -533,4 +536,14 @@
    {
       _useJGroupsWorkaround = useJGroupsWorkaround;
    }
+
+   public Integer getRemotingBindAddress()
+   {
+      return _remotingBindAddress;
+   }
+
+   public void setRemotingBindAddress(Integer remotingBindAddress)
+   {
+      this._remotingBindAddress = remotingBindAddress;
+   }
 }

Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryDeployer.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryDeployer.java	2007-11-13 18:27:17 UTC (rev 3322)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryDeployer.java	2007-11-13 18:29:00 UTC (rev 3323)
@@ -36,7 +36,7 @@
  */
 public class ConnectionFactoryDeployer
 {
-   private static final String JBM_FACTORIES_XML = "jbm-connection-factories.xml";
+   private static final String JBM_FACTORIES_XML = "jbm-configuration.xml";
    private static final String FACTORY_ELEMENT = "factory";
    private static final String NAME_ATTR = "name";
    private static final String CLIENTID_ELEMENT = "client-id";

Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/DestinationDeployer.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/DestinationDeployer.java	2007-11-13 18:27:17 UTC (rev 3322)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/DestinationDeployer.java	2007-11-13 18:29:00 UTC (rev 3323)
@@ -52,7 +52,7 @@
    private static final String QUEUE_MESSAGECOUNTER_PREFIX = "Queue.";
 
    private ServerPeer serverPeer;
-   private static final String JBM_DESTINATIONS_XML = "jbm-destinations.xml";
+   private static final String JBM_DESTINATIONS_XML = "jbm-configuration.xml";
    private static final String QUEUE_ELEMENT = "queue";
    private static final String NAME_ATTR = "name";
    private static final String DLQ_ELEMENT = "dlq";
@@ -223,6 +223,7 @@
       {
          getServerPeer().getPostOffice().getBindingForQueueName(name).queue.activate();
       }
+      createCounter(queue, destination);
       destination.setQueue(queue);
       getServerPeer().getDestinationManager().registerDestination(destination);
    }
@@ -270,29 +271,51 @@
          queue.setMaxSize(destination.getMaxSize());
 
          //Create a counter
-         String counterName = SUBSCRIPTION_MESSAGECOUNTER_PREFIX + queue.getName();
+         createCounter(queue, destination);
+      }
 
-         String subName = MessageQueueNameHelper.createHelper(queue.getName()).getSubName();
+      serverPeer.getDestinationManager().registerDestination(destination);
 
-         int dayLimitToUse = destination.getMessageCounterHistoryDayLimit();
-         if (dayLimitToUse == -1)
-         {
-            //Use override on server peer
-            dayLimitToUse = serverPeer.getConfiguration().getDefaultMessageCounterHistoryDayLimit();
-         }
 
-         MessageCounter counter =
-                 new MessageCounter(counterName, subName, queue, true, true,
-                         dayLimitToUse);
+   }
 
-         serverPeer.getMessageCounterManager().registerMessageCounter(counterName, counter);
+   private void createCounter(Queue queue, ManagedQueue destination)
+   {
+      String counterName = QUEUE_MESSAGECOUNTER_PREFIX + queue.getName();
+
+      int dayLimitToUse = destination.getMessageCounterHistoryDayLimit();
+      if (dayLimitToUse == -1)
+      {
+         //Use override on server peer
+         dayLimitToUse = serverPeer.getConfiguration().getDefaultMessageCounterHistoryDayLimit();
       }
 
-      serverPeer.getDestinationManager().registerDestination(destination);
+      MessageCounter counter =
+              new MessageCounter(counterName, null, queue, true, true,
+                      dayLimitToUse);
 
+      serverPeer.getMessageCounterManager().registerMessageCounter(counterName, counter);
+   }
 
+   private void createCounter(Queue queue, ManagedTopic destination)
+   {
+      String counterName = SUBSCRIPTION_MESSAGECOUNTER_PREFIX + queue.getName();
+
+      String subName = MessageQueueNameHelper.createHelper(queue.getName()).getSubName();
+
+      int dayLimitToUse = destination.getMessageCounterHistoryDayLimit();
+      if (dayLimitToUse == -1)
+      {
+         //Use override on server peer
+         dayLimitToUse = serverPeer.getConfiguration().getDefaultMessageCounterHistoryDayLimit();
+      }
+
+      MessageCounter counter =
+              new MessageCounter(counterName, subName, queue, true, true,
+                      dayLimitToUse);
+
+      serverPeer.getMessageCounterManager().registerMessageCounter(counterName, counter);
    }
-
    /**
     * deploys a new queue
     * @param name
@@ -350,6 +373,7 @@
       {
          serverPeer.getPostOffice().getBindingForQueueName(name).queue.activate();
       }
+      createCounter(queue, destination);
       destination.setQueue(queue);
       serverPeer.getDestinationManager().registerDestination(destination);
       return destination.getJndiName();
@@ -404,22 +428,7 @@
          queue.setMaxSize(destination.getMaxSize());
 
          //Create a counter
-         String counterName = SUBSCRIPTION_MESSAGECOUNTER_PREFIX + queue.getName();
-
-         String subName = MessageQueueNameHelper.createHelper(queue.getName()).getSubName();
-
-         int dayLimitToUse = destination.getMessageCounterHistoryDayLimit();
-         if (dayLimitToUse == -1)
-         {
-            //Use override on server peer
-            dayLimitToUse = serverPeer.getConfiguration().getDefaultMessageCounterHistoryDayLimit();
-         }
-
-         MessageCounter counter =
-                 new MessageCounter(counterName, subName, queue, true, true,
-                         dayLimitToUse);
-
-         serverPeer.getMessageCounterManager().registerMessageCounter(counterName, counter);
+         createCounter(queue, destination);
       }
 
       serverPeer.getDestinationManager().registerDestination(destination);

Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/JBMBootstrapServer.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/JBMBootstrapServer.java	2007-11-13 18:27:17 UTC (rev 3322)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/JBMBootstrapServer.java	2007-11-13 18:29:00 UTC (rev 3323)
@@ -23,170 +23,218 @@
 
 import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
 import org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer;
+import org.jboss.kernel.spi.config.KernelConfig;
 import org.jboss.kernel.spi.deployment.KernelDeployment;
 import org.jboss.util.CollectionsFactory;
 
 import javax.jms.*;
 import javax.naming.InitialContext;
+import javax.naming.NamingException;
 import java.net.URL;
 import java.util.List;
 import java.util.ListIterator;
+import java.util.Properties;
 
 /**
  * @author <a href="ataylor at redhat.com">Andy Taylor</a>
  */
 public class JBMBootstrapServer extends BasicBootstrap
 {
-    /**
-     * The deployer
-     */
-    protected BeanXMLDeployer deployer;
-    /**
-     * The deployments
-     */
-    protected List deployments = CollectionsFactory.createCopyOnWriteList();
-    /**
-     * The arguments
-     */
-    protected String[] args;
+   /**
+    * The deployer
+    */
+   protected BeanXMLDeployer deployer;
+   /**
+    * The deployments
+    */
+   protected List deployments = CollectionsFactory.createCopyOnWriteList();
+   /**
+    * The arguments
+    */
+   protected String[] args;
+   private Properties properties;
 
-    /**
-     * Bootstrap the kernel from the command line
-     *
-     * @param args the command line arguments
-     * @throws Exception for any error
-     */
-    public static void main(String[] args) throws Exception
-    {
-        System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.LocalOnlyContextFactory");
-        System.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
-        JBMBootstrapServer bootstrap = new JBMBootstrapServer(args);
-        bootstrap.run();
+   /**
+    * Bootstrap the kernel from the command line
+    *
+    * @param args the command line arguments
+    * @throws Exception for any error
+    */
+   public static void main(String[] args) throws Exception
+   {
+      JBMBootstrapServer bootstrap = new JBMBootstrapServer(args);
+      bootstrap.run();
+      test();
 
-        //do some JMS stuff
-        InitialContext ic = new InitialContext();
-        
 
-        ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
-        Queue q = (Queue) ic.lookup("queue/testQueue");
-        Connection c = cf.createConnection();
-        Session s = c.createSession(false, Session.AUTO_ACKNOWLEDGE);
-        TextMessage message = s.createTextMessage("test");
-        MessageProducer p = s.createProducer(q);
-        p.send(message);
-        message = s.createTextMessage("test2");
-        p.send(message);
-        message = s.createTextMessage("test3");
-        p.send(message);
-        message = s.createTextMessage("test4");
-        p.send(message);
-        c.start();
-        MessageConsumer mc = s.createConsumer(q);
-        MessageListener messageListener = new MessageListener()
-            {
-                public void onMessage(Message message)
-                {
-                    TextMessage textMessage = (TextMessage) message;
-                    try
-                    {
-                        System.out.println("textMessage.getText() = " + textMessage.getText());
-                    }
-                    catch (JMSException e)
-                    {
-                        e.printStackTrace();
-                    }
-                }
-            };
-            mc.setMessageListener(messageListener);
-            c.start();
-            Thread.sleep(20000);
-        System.exit(1);
-    }
+   }
 
-    /**
-     * JBoss 1.0.0 final
-     * Standalone
-     * Create a new bootstrap
-     *
-     * @param args the arguments
-     * @throws Exception for any error
-     */
-    public JBMBootstrapServer(String[] args) throws Exception
-    {
-        super();
-        this.args = args;
-    }
 
-    public void bootstrap() throws Throwable
-    {
-        super.bootstrap();
-        deployer = new BeanXMLDeployer(getKernel());
-        Runtime.getRuntime().addShutdownHook(new Shutdown());
-        ClassLoader cl = Thread.currentThread().getContextClassLoader();
-        for (String arg : args)
-        {
-            URL url = cl.getResource(arg);
-            if(url == null)
+   public void run()
+   {
+      super.run();
+      log.info("JBM Server Started");
+   }
+
+   private static void test()
+           throws NamingException, JMSException
+   {
+      //do some JMS stuff
+      InitialContext ic = new InitialContext();
+
+
+      ConnectionFactory cf = (ConnectionFactory) ic.lookup("ConnectionFactory");
+      Queue q = (Queue) ic.lookup("queue/testQueue");
+      Connection c = cf.createConnection();
+      Session s = c.createSession(false, Session.AUTO_ACKNOWLEDGE);
+      TextMessage message = s.createTextMessage("test");
+      MessageProducer p = s.createProducer(q);
+      p.send(message);
+      message = s.createTextMessage("test2");
+      p.send(message);
+      message = s.createTextMessage("test3");
+      p.send(message);
+      message = s.createTextMessage("test4");
+      p.send(message);
+      c.start();
+      MessageConsumer mc = s.createConsumer(q);
+      MessageListener messageListener = new MessageListener()
+      {
+         public void onMessage(Message message)
+         {
+            TextMessage textMessage = (TextMessage) message;
+            try
             {
-                url = cl.getResource("META-INF/" + arg);
+               System.out.println("textMessage.getText() = " + textMessage.getText());
             }
-            if(url == null)
+            catch (JMSException e)
             {
-                throw new RuntimeException("Unable to find rersource:" + arg);
+               e.printStackTrace();
             }
-            deploy(url);
-        }
+         }
+      };
+      mc.setMessageListener(messageListener);
+      c.start();
+      c.close();
+   }
 
-        deployer.validate();
-    }
+   /**
+    * JBoss 1.0.0 final
+    * Standalone
+    * Create a new bootstrap
+    *
+    * @param args the arguments
+    * @throws Exception for any error
+    */
+   public JBMBootstrapServer(String[] args) throws Exception
+   {
+      super();
+      this.args = args;
+   }
 
-    /**
-     * Deploy a url
-     *
-     * @param url the deployment url
-     * @throws Throwable for any error
-     */
-    protected void deploy(URL url) throws Throwable
-    {
-        log.debug("Deploying " + url);
-        KernelDeployment deployment = deployer.deploy(url);
-        deployments.add(deployment);
-        log.debug("Deployed " + url);
-    }
+   public JBMBootstrapServer(String[] args, KernelConfig kernelConfig) throws Exception
+   {
+      super(kernelConfig);
+      System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.LocalOnlyContextFactory");
+      System.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
+      this.args = args;
+   }
+   public void bootstrap() throws Throwable
+   {
+      super.bootstrap();
+      deployer = new BeanXMLDeployer(getKernel());
+      Runtime.getRuntime().addShutdownHook(new Shutdown());
+      ClassLoader cl = Thread.currentThread().getContextClassLoader();
 
-    /**
-     * Undeploy a deployment
-     *
-     * @param deployment the deployment
-     */
-    protected void undeploy(KernelDeployment deployment)
-    {
-        log.debug("Undeploying " + deployment.getName());
-        deployments.remove(deployment);
-        try
-        {
-            deployer.undeploy(deployment);
-            log.debug("Undeployed " + deployment.getName());
-        }
-        catch (Throwable t)
-        {
-            log.warn("Error during undeployment: " + deployment.getName(), t);
-        }
-    }
+      for (String arg : args)
+      {
+         URL url = cl.getResource(arg);
+         if (url == null)
+         {
+            url = cl.getResource("META-INF/" + arg);
+         }
+         //try the system classpath
+         if(url == null)
+         {
+            url = getClass().getClassLoader().getResource(arg);
+         }
+         if (url == null)
+         {
+            throw new RuntimeException("Unable to find resource:" + arg);
+         }
+         deploy(url);
+      }
 
-    protected class Shutdown extends Thread
-    {
-        public void run()
-        {
-            log.info("Shutting down");
-            ListIterator iterator = deployments.listIterator(deployments.size());
-            while (iterator.hasPrevious())
-            {
-                KernelDeployment deployment = (KernelDeployment) iterator.previous();
-                undeploy(deployment);
-            }
-        }
-    }
+      deployer.validate();
+   }
+
+   /**
+    * Deploy a url
+    *
+    * @param url the deployment url
+    * @throws Throwable for any error
+    */
+   protected void deploy(URL url) throws Throwable
+   {
+      log.debug("Deploying " + url);
+      KernelDeployment deployment = deployer.deploy(url);
+      deployments.add(deployment);
+      log.debug("Deployed " + url);
+   }
+
+   /**
+    * Undeploy a deployment
+    *
+    * @param deployment the deployment
+    */
+   protected void undeploy(KernelDeployment deployment)
+   {
+      log.debug("Undeploying " + deployment.getName());
+      deployments.remove(deployment);
+      try
+      {
+         deployer.undeploy(deployment);
+         log.debug("Undeployed " + deployment.getName());
+      }
+      catch (Throwable t)
+      {
+         log.warn("Error during undeployment: " + deployment.getName(), t);
+      }
+   }
+
+   public void shutDown()
+   {
+      log.info("Shutting down");
+      ListIterator iterator = deployments.listIterator(deployments.size());
+      while (iterator.hasPrevious())
+      {
+         KernelDeployment deployment = (KernelDeployment) iterator.previous();
+         undeploy(deployment);
+      }
+   }
+
+   protected Properties getConfigProperties()
+   {
+      return properties;
+   }
+
+   public void setProperties(Properties props)
+   {
+      properties = props;
+   }
+   protected class Shutdown extends Thread
+   {
+      public void run()
+      {
+         log.info("Shutting down");
+         ListIterator iterator = deployments.listIterator(deployments.size());
+         while (iterator.hasPrevious())
+         {
+            KernelDeployment deployment = (KernelDeployment) iterator.previous();
+            undeploy(deployment);
+         }
+      }
+   }
 }
 
 

Modified: branches/Branch_MC_Integration_New/tests/build.xml
===================================================================
--- branches/Branch_MC_Integration_New/tests/build.xml	2007-11-13 18:27:17 UTC (rev 3322)
+++ branches/Branch_MC_Integration_New/tests/build.xml	2007-11-13 18:29:00 UTC (rev 3323)
@@ -150,7 +150,7 @@
       <path refid="hsqldb.hsqldb.classpath"/>
       <path refid="jboss.profiler.jvmti.classpath"/>
       <path refid="jboss.test14.classpath"/>
-      <path refid="jboss.jbossretro.rt.classpath"/>
+      <!--<path refid="jboss.jbossretro.rt.classpath"/>-->
    </path>
 
    <!--
@@ -162,6 +162,7 @@
       <pathelement location="${build.tests.classes}"/>
       <pathelement location="${project.root}/src/etc"/> <!-- server's configuration files -->
       <pathelement location="${project.root}/src/etc/server/default/deploy"/>
+      <pathelement location="${project.thirdparty}/naming/jnp-client.jar"/>
       <path refid="test.compilation.classpath"/>
       <path refid="dom4j.dom4j.classpath"/>
       <path refid="apache.log4j.classpath"/>




More information about the jboss-cvs-commits mailing list