[jboss-cvs] JBoss Messaging SVN: r3287 - in branches/Branch_MC_Integration_New: docs/examples/common/src/org/jboss/example/jms/common and 23 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Nov 5 12:26:50 EST 2007
Author: ataylor
Date: 2007-11-05 12:26:49 -0500 (Mon, 05 Nov 2007)
New Revision: 3287
Added:
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/etc/server/default/deploy/jbm-destinations.xml
branches/Branch_MC_Integration_New/src/etc/server/standalone/
branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/
branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/bindings.xml
branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/mbeansupport.xml
branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/mysql-beans.xml
branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/naming.xml
branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/tm-beans.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/JmsServer.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/
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/AuthenticationManager.java
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/JMSTXAgent.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/JndiBinder.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/NonSerializableFactory.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/ServiceLocator.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/factory/
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/factory/Connector.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/factory/mBeanServerCreator.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/security/Role.java
Removed:
branches/Branch_MC_Integration_New/src/etc/server/default/deploy/db2-persistence-service.xml
branches/Branch_MC_Integration_New/src/etc/server/default/deploy/hsqldb-persistence-service.xml
branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jboss-beans.xml
branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jboss-service.xml
branches/Branch_MC_Integration_New/src/etc/server/default/deploy/messaging-service.xml
branches/Branch_MC_Integration_New/src/etc/server/default/deploy/mssql-persistence-service.xml
branches/Branch_MC_Integration_New/src/etc/server/default/deploy/mysql-persistence-service.xml
branches/Branch_MC_Integration_New/src/etc/server/default/deploy/mysqlcluster-persistence-service.xml
branches/Branch_MC_Integration_New/src/etc/server/default/deploy/oracle-persistence-service.xml
branches/Branch_MC_Integration_New/src/etc/server/default/deploy/postgresql-persistence-service.xml
branches/Branch_MC_Integration_New/src/etc/server/default/deploy/sybase-persistence-service.xml
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/QueueService.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/TopicService.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManagerService.java
branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/jmx/JDBCPersistenceManagerService.java
branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/jmx/MessagingPostOfficeService.java
Modified:
branches/Branch_MC_Integration_New/build-messaging.xml
branches/Branch_MC_Integration_New/build-thirdparty.xml
branches/Branch_MC_Integration_New/build.xml
branches/Branch_MC_Integration_New/docs/examples/common/src/org/jboss/example/jms/common/Util.java
branches/Branch_MC_Integration_New/docs/examples/distributed-queue/build.xml
branches/Branch_MC_Integration_New/docs/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/DistributedQueueExample.java
branches/Branch_MC_Integration_New/docs/examples/queue/build.xml
branches/Branch_MC_Integration_New/docs/examples/topic/build.xml
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/client/container/ClusteringAspect.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/ConnectionFactoryManager.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/DestinationJNDIMapper.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/SecurityStore.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/ServerPeer.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryJNDIMapper.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/ManagedDestination.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/ManagedTopic.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManager.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/security/SecurityMetadata.java
branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/security/SecurityMetadataStore.java
branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/contract/PostOffice.java
branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java
branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/impl/JDBCSupport.java
branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/impl/jchannelfactory/MultiplexerChannelFactory.java
branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
branches/Branch_MC_Integration_New/tests/src/org/jboss/test/messaging/tools/aop/PoisonInterceptor.java
Log:
initial microcontainer integration
Modified: branches/Branch_MC_Integration_New/build-messaging.xml
===================================================================
--- branches/Branch_MC_Integration_New/build-messaging.xml 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/build-messaging.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -45,11 +45,11 @@
Module name(s) & version.
-->
- <property name="messaging.version.major" value="1"/>
- <property name="messaging.version.minor" value="4"/>
+ <property name="messaging.version.major" value="2"/>
+ <property name="messaging.version.minor" value="0"/>
<property name="messaging.version.revision" value="0"/>
- <property name="messaging.version.incrementing" value="19"/>
- <property name="messaging.version.tag" value="SP1"/>
+ <property name="messaging.version.incrementing" value="0"/>
+ <property name="messaging.version.tag" value="alpha1"/>
<property name="messaging.version.name" value="Stilton"/>
<property name="messaging.version.cvstag" value="JBossMessaging_1_4_0_SP1"/>
<property name="module.name" value="messaging"/>
@@ -163,6 +163,7 @@
<path refid="jbossas.core.libs.classpath"/>
<!-- some components at JBoss use JBossSerialization (JCA for instance) -->
<path refid="jboss.serialization.classpath"/>
+ <path refid="jboss.microcontainer.classpath"/>
</path>
<!--
@@ -309,6 +310,18 @@
</javadoc>
</target>
+ <property name="jboss.home" value="${ENV.JBOSS_HOME}"/>
+ <property name="jboss.config" value="messaging"/>
+ <target name="deploy" depends="jar, sar">
+ <copy file="${build.lib}/jboss-${module.name}.jar"
+ todir="${jboss.home}/server/${jboss.config}/lib"/>
+ <!--<copy file="${build.lib}/jboss-${module.name}.sar"
+ todir="${jboss.home}/server/${jboss.config}/deploy"/>-->
+ <copy
+ todir="${jboss.home}/server/${jboss.config}/deploy/messaging.sar">
+ <fileset dir="${build.sar}"/>
+ </copy>
+ </target>
<!-- ======================================================================================== -->
<!-- Archival Tasks -->
<!-- ======================================================================================== -->
@@ -346,11 +359,6 @@
<mkdir dir="${build.jar}/META-INF"/>
<mkdir dir="${build.jar}/xmdesc"/>
- <copy todir="${build.jar}" file="${source.etc}/server/default/deploy/messaging-service.xml"/>
- <copy todir="${build.jar}" file="${source.etc}/server/default/deploy/connection-factories-service.xml"/>
- <copy todir="${build.jar}" file="${source.etc}/server/default/deploy/destinations-service.xml"/>
- <copy todir="${build.jar}" file="${source.etc}/server/default/deploy/hsqldb-persistence-service.xml"/>
- <copy todir="${build.jar}" file="${source.etc}/remoting/remoting-bisocket-service.xml"/>
<copy file="${build.etc}/VERSION" toFile="${build.jar}/VERSION"/>
<copy todir="${build.jar}/xmdesc">
<fileset dir="${source.etc}/xmdesc" includes="*.xml"/>
@@ -360,7 +368,9 @@
</target>
<target name="sar-structure" depends="jar-structure">
- <copy todir="${build.sar}/META-INF" file="${source.etc}/server/default/deploy/jboss-service.xml"/>
+ <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"/>
</target>
<target name="artifacts" depends="jar, sar, client-jar"/>
Modified: branches/Branch_MC_Integration_New/build-thirdparty.xml
===================================================================
--- branches/Branch_MC_Integration_New/build-thirdparty.xml 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/build-thirdparty.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -84,14 +84,15 @@
<componentref name="sun-javacc" version="3.2"/>
<componentref name="oswego-concurrent" version="1.3.4-brew"/>
<componentref name="apache-log4j" version="1.2.14-brew"/>
- <componentref name="javassist" version="3.5.0.GA-brew"/>
+ <componentref name="javassist" version="3.6.0.GA/"/>
<componentref name="jgroups" version="2.4.1.SP3-brew"/>
<componentref name="trove" version="1.0.2-brew"/>
- <componentref name="jboss/common" version="1.2.0.GA-brew"/>
- <componentref name="jboss/aop" version="1.5.5.GA"/>
+ <componentref name="jboss/common" version="1.2.1.GA"/>
+ <componentref name="jboss/aop" version="2.0.0.alpha4"/>
<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.0.GA"/>
+ <componentref name="jbossas/core-libs" version="4.2.1.GA"/>
+ <componentref name="jboss/microcontainer" version="2.0.0.Beta4"/>
<!--
@@ -109,7 +110,7 @@
<componentref name="dom4j" version="1.6.1-brew"/>
<componentref name="apache-xerces" version="2.7.1-brew"/> <!-- needed by org.jboss.logging.Log4jLoggerPlugin -->
<componentref name="jboss/profiler/jvmti" version="1.0.0.CR5-brew"/>
- <componentref name="jboss/jbossxb" version="1.0.0.GA-brew"/>
+ <componentref name="jboss/jbossxb" version="2.0.0.CR4"/>
<componentref name="jboss/test14" version="1.0.0.GA"/>
<!-- This is a non declared dependency of jboss/test14 -->
Modified: branches/Branch_MC_Integration_New/build.xml
===================================================================
--- branches/Branch_MC_Integration_New/build.xml 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/build.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -80,6 +80,14 @@
<ant antfile="build-messaging.xml" target="fat-client-jar"/>
</target>
+ <target name="deploy" depends="jar">
+ <ant antfile="build-messaging.xml" target="deploy"/>
+ </target>
+
+ <target name="bootstrap">
+ <ant antfile="build-messaging.xml" target="bootstrap"/>
+ </target>
+
<target name="jar" depends="createthirdparty">
<ant antfile="build-messaging.xml" target="jar"/>
</target>
Modified: branches/Branch_MC_Integration_New/docs/examples/common/src/org/jboss/example/jms/common/Util.java
===================================================================
--- branches/Branch_MC_Integration_New/docs/examples/common/src/org/jboss/example/jms/common/Util.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/docs/examples/common/src/org/jboss/example/jms/common/Util.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -70,7 +70,7 @@
{
MBeanServerConnection mBeanServer = lookupMBeanServerProxy(ic);
- ObjectName serverObjectName = new ObjectName("jboss.messaging:service=ServerPeer");
+ ObjectName serverObjectName = new ObjectName("jboss.messaging:service=Server");
String queueName = jndiName.substring(jndiName.lastIndexOf('/') + 1);
@@ -90,7 +90,7 @@
{
MBeanServerConnection mBeanServer = lookupMBeanServerProxy(ic);
- ObjectName serverObjectName = new ObjectName("jboss.messaging:service=ServerPeer");
+ ObjectName serverObjectName = new ObjectName("jboss.messaging:service=Server");
String queueName = jndiName.substring(jndiName.lastIndexOf('/') + 1);
Modified: branches/Branch_MC_Integration_New/docs/examples/distributed-queue/build.xml
===================================================================
--- branches/Branch_MC_Integration_New/docs/examples/distributed-queue/build.xml 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/docs/examples/distributed-queue/build.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -19,11 +19,11 @@
<property name="messaging.client.jar.path" value="../../"/>
<property name="messaging.client.jar.name" value="jboss-messaging-client.jar"/>
<property name="jboss.home" value="${ENV.JBOSS_HOME}"/>
- <property name="jboss.configuration0" value="messaging-node0"/>
+ <property name="jboss.configuration0" value="messaging"/>
<property name="example.queue.name" value="testDistributedQueue"/>
<path id="common.compilation.classpath">
- <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+ <fileset file="${jboss.home}/client/jboss-javaee.jar"/>
<fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
</path>
@@ -40,9 +40,10 @@
<fileset file="${jboss.home}/server/${jboss.configuration0}/lib/jboss-remoting.jar"/>
<fileset file="${jboss.home}/client/jbossall-client.jar"/>
<fileset file="${jboss.home}/server/${jboss.configuration0}/lib/log4j.jar"/>
- <fileset file="${jboss.home}/server/${jboss.configuration0}/lib/javassist.jar"/>
- <fileset file="${jboss.home}/server/${jboss.configuration0}/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
- <fileset file="${jboss.home}/server/${jboss.configuration0}/deploy/jboss-aop-jdk50.deployer/trove.jar"/>
+ <fileset file="${jboss.home}/lib/javassist.jar"/>
+ <fileset file="${jboss.home}/lib/jboss-aop-jdk50.jar"/>
+ <fileset file="${jboss.home}/lib/trove.jar"/>
+ <fileset file="${jboss.home}/lib/jboss-container.jar"/>
</path>
<target name="identify">
@@ -51,6 +52,7 @@
<echo message="###########################################################################"/>
<echo message="The queue: ${example.queue.name}"/>
<echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+ <echo message="JBOSS_HOME is: ${jboss.home}"/>
</target>
<target name="sanity-check" depends="identify">
Modified: branches/Branch_MC_Integration_New/docs/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/DistributedQueueExample.java
===================================================================
--- branches/Branch_MC_Integration_New/docs/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/DistributedQueueExample.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/docs/examples/distributed-queue/src/org/jboss/example/jms/distributedqueue/DistributedQueueExample.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,18 +21,11 @@
*/
package org.jboss.example.jms.distributedqueue;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-
import org.jboss.example.jms.common.ExampleSupport;
+import javax.jms.*;
+import javax.naming.InitialContext;
+
/**
* The example creates two connections to two distinct cluster nodes on which we have previously
* deployed a distributed queue. The example sends messages on one node and consumes them from another
@@ -106,7 +99,7 @@
log("The message was successfully sent to the distributed queue");
- messageListener1.waitForMessage(3000);
+ messageListener1.waitForMessage(6000);
message = (TextMessage)messageListener1.getMessage();
log(messageListener1.getName() + " received message: " + message.getText());
Modified: branches/Branch_MC_Integration_New/docs/examples/queue/build.xml
===================================================================
--- branches/Branch_MC_Integration_New/docs/examples/queue/build.xml 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/docs/examples/queue/build.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,7 +21,7 @@
<property name="example.queue.name" value="testQueue"/>
<path id="common.compilation.classpath">
- <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+ <fileset file="${jboss.home}/client/jboss-javaee.jar"/>
<fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
</path>
@@ -38,9 +38,10 @@
<fileset file="${jboss.home}/server/${jboss.configuration}/lib/jboss-remoting.jar"/>
<fileset file="${jboss.home}/client/jbossall-client.jar"/>
<fileset file="${jboss.home}/server/${jboss.configuration}/lib/log4j.jar"/>
- <fileset file="${jboss.home}/server/${jboss.configuration}/lib/javassist.jar"/>
- <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
- <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/trove.jar"/>
+ <fileset file="${jboss.home}/lib/javassist.jar"/>
+ <fileset file="${jboss.home}/lib/jboss-aop-jdk50.jar"/>
+ <fileset file="${jboss.home}/lib/trove.jar"/>
+ <fileset file="${jboss.home}/lib/jboss-container.jar"/>
</path>
<target name="identify">
@@ -49,6 +50,7 @@
<echo message="###########################################################################"/>
<echo message="The queue: ${example.queue.name}"/>
<echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+ <echo message="JBOSS_HOME is: ${jboss.home}"/>
</target>
<target name="sanity-check" depends="identify">
Modified: branches/Branch_MC_Integration_New/docs/examples/topic/build.xml
===================================================================
--- branches/Branch_MC_Integration_New/docs/examples/topic/build.xml 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/docs/examples/topic/build.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,7 +21,7 @@
<property name="example.topic.name" value="testTopic"/>
<path id="common.compilation.classpath">
- <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+ <fileset file="${jboss.home}/client/jboss-javaee.jar"/>
<fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
</path>
@@ -38,9 +38,10 @@
<fileset file="${jboss.home}/server/${jboss.configuration}/lib/jboss-remoting.jar"/>
<fileset file="${jboss.home}/client/jbossall-client.jar"/>
<fileset file="${jboss.home}/server/${jboss.configuration}/lib/log4j.jar"/>
- <fileset file="${jboss.home}/server/${jboss.configuration}/lib/javassist.jar"/>
- <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
- <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/trove.jar"/>
+ <fileset file="${jboss.home}/lib/javassist.jar"/>
+ <fileset file="${jboss.home}/lib/jboss-aop-jdk50.jar"/>
+ <fileset file="${jboss.home}/lib/trove.jar"/>
+ <fileset file="${jboss.home}/lib/jboss-container.jar"/>
</path>
<target name="identify">
@@ -49,6 +50,7 @@
<echo message="###########################################################################"/>
<echo message="The topic: ${example.topic.name}"/>
<echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+ <echo message="JBOSS_HOME is: ${jboss.home}"/>
</target>
<target name="sanity-check" depends="identify">
Deleted: branches/Branch_MC_Integration_New/src/etc/server/default/deploy/db2-persistence-service.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/default/deploy/db2-persistence-service.xml 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/etc/server/default/deploy/db2-persistence-service.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -1,258 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- DB2 persistence deployment descriptor.
-
- UNTESTED
-
- $Id$
- -->
-
-<server>
-
- <!-- Persistence Manager MBean configuration
- ======================================== -->
-
- <mbean code="org.jboss.messaging.core.jmx.JDBCPersistenceManagerService"
- name="jboss.messaging:service=PersistenceManager"
- xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml">
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <!-- The datasource to use for the persistence manager -->
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <!-- If true will attempt to create tables and indexes on every start-up -->
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <!-- If true then will use JDBC batch updates -->
- <attribute name="UsingBatchUpdates">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
- CREATE_DUAL=CREATE TABLE JBM_DUAL (DUAL_DUMMY INTEGER NOT NULL, PRIMARY KEY (DUAL_DUMMY))
- CREATE_MESSAGE_REFERENCE=CREATE TABLE JBM_MSG_REF (CHANNEL_ID BIGINT NOT NULL, MESSAGE_ID BIGINT NOT NULL, TRANSACTION_ID BIGINT, STATE CHAR(1), ORD BIGINT, PAGE_ORD BIGINT, DELIVERY_COUNT INTEGER, SCHED_DELIVERY BIGINT, PRIMARY KEY(CHANNEL_ID, MESSAGE_ID))
- CREATE_IDX_MESSAGE_REF_TX=CREATE INDEX JBM_MSG_REF_TX ON JBM_MSG_REF (TRANSACTION_ID)
- CREATE_IDX_MESSAGE_REF_ORD=CREATE INDEX JBM_MSG_REF_ORD ON JBM_MSG_REF (ORD)
- CREATE_IDX_MESSAGE_REF_PAGE_ORD=CREATE INDEX PG_OD_IDX ON JBM_MSG_REF (PAGE_ORD)
- CREATE_IDX_MESSAGE_REF_MESSAGE_ID=CREATE INDEX JBREIDIDX ON JBM_MSG_REF (MESSAGE_ID)
- CREATE_IDX_MESSAGE_REF_SCHED_DELIVERY=CREATE INDEX SC_DL_IDX ON JBM_MSG_REF (SCHED_DELIVERY)
- CREATE_MESSAGE=CREATE TABLE JBM_MSG (MESSAGE_ID BIGINT NOT NULL, RELIABLE CHAR(1), EXPIRATION BIGINT, TIMESTAMP BIGINT, PRIORITY SMALLINT, TYPE SMALLINT, INS_TIME BIGINT, HEADERS BLOB, PAYLOAD BLOB, PRIMARY KEY (MESSAGE_ID))
- CREATE_IDX_MESSAGE_TIMESTAMP=CREATE INDEX JBM_TMST_ID ON JBM_MSG (TIMESTAMP)
- CREATE_TRANSACTION=CREATE TABLE JBM_TX (NODE_ID INTEGER NOT NULL, TRANSACTION_ID BIGINT NOT NULL, BRANCH_QUAL BLOB(254), FORMAT_ID INTEGER, GLOBAL_TXID BLOB(254), PRIMARY KEY (TRANSACTION_ID))
- CREATE_COUNTER=CREATE TABLE JBM_COUNTER (NAME VARCHAR(255) NOT NULL, NEXT_ID BIGINT, PRIMARY KEY(NAME))
- INSERT_DUAL=INSERT INTO JBM_DUAL VALUES (1)
- CHECK_DUAL=SELECT 1 FROM JBM_DUAL
- INSERT_MESSAGE_REF=INSERT INTO JBM_MSG_REF (CHANNEL_ID, MESSAGE_ID, TRANSACTION_ID, STATE, ORD, PAGE_ORD, DELIVERY_COUNT, SCHED_DELIVERY) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
- DELETE_MESSAGE_REF=DELETE FROM JBM_MSG_REF WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
- UPDATE_MESSAGE_REF=UPDATE JBM_MSG_REF SET TRANSACTION_ID=?, STATE='-' WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
- UPDATE_PAGE_ORDER=UPDATE JBM_MSG_REF SET PAGE_ORD = ? WHERE MESSAGE_ID=? AND CHANNEL_ID=?
- COMMIT_MESSAGE_REF1=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='+'
- COMMIT_MESSAGE_REF2=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='-'
- ROLLBACK_MESSAGE_REF1=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='+'
- ROLLBACK_MESSAGE_REF2=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='-'
- LOAD_PAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, PAGE_ORD, SCHED_DELIVERY FROM JBM_MSG_REF WHERE CHANNEL_ID = ? AND PAGE_ORD BETWEEN ? AND ? ORDER BY PAGE_ORD
- LOAD_UNPAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? AND PAGE_ORD IS NULL ORDER BY ORD
- LOAD_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? ORDER BY ORD
- UPDATE_REFS_NOT_PAGED=UPDATE JBM_MSG_REF SET PAGE_ORD = NULL WHERE PAGE_ORD BETWEEN ? AND ? AND CHANNEL_ID=?
- SELECT_MIN_MAX_PAGE_ORD=SELECT MIN(PAGE_ORD), MAX(PAGE_ORD) FROM JBM_MSG_REF WHERE CHANNEL_ID = ?
- SELECT_EXISTS_REF_MESSAGE_ID=SELECT MESSAGE_ID FROM JBM_MSG_REF WHERE MESSAGE_ID = ?
- UPDATE_DELIVERY_COUNT=UPDATE JBM_MSG_REF SET DELIVERY_COUNT = ? WHERE CHANNEL_ID = ? AND MESSAGE_ID = ?
- UPDATE_CHANNEL_ID=UPDATE JBM_MSG_REF SET CHANNEL_ID = ? WHERE CHANNEL_ID = ?
- LOAD_MESSAGES=SELECT MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, HEADERS, PAYLOAD, TYPE FROM JBM_MSG
- INSERT_MESSAGE=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME, HEADERS, PAYLOAD) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
- INSERT_MESSAGE_CONDITIONAL=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME) SELECT ?, ?, ?, ?, ?, ?, ? FROM JBM_DUAL WHERE NOT EXISTS (SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ?)
- UPDATE_MESSAGE_4CONDITIONAL=UPDATE JBM_MSG SET HEADERS=?, PAYLOAD=? WHERE MESSAGE_ID=?
- INSERT_MESSAGE_CONDITIONAL_FULL=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME, HEADERS, PAYLOAD) SELECT ?, ?, ?, ?, ?, ?, ?, ?, ? FROM JBM_DUAL WHERE NOT EXISTS (SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ?)
- MESSAGE_ID_COLUMN=MESSAGE_ID
- REAP_MESSAGES=DELETE FROM JBM_MSG WHERE INS_TIME < ? AND NOT EXISTS (SELECT * FROM JBM_MSG_REF WHERE JBM_MSG_REF.MESSAGE_ID = JBM_MSG.MESSAGE_ID)
- DELETE_MESSAGE=DELETE FROM JBM_MSG WHERE MESSAGE_ID = ? AND NOT EXISTS (SELECT * FROM JBM_MSG_REF WHERE JBM_MSG_REF.MESSAGE_ID = ?)
- INSERT_TRANSACTION=INSERT INTO JBM_TX (NODE_ID, TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID) VALUES(?, ?, ?, ?, ?)
- DELETE_TRANSACTION=DELETE FROM JBM_TX WHERE NODE_ID = ? AND TRANSACTION_ID = ?
- SELECT_PREPARED_TRANSACTIONS=SELECT TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID FROM JBM_TX WHERE NODE_ID = ?
- SELECT_MESSAGE_ID_FOR_REF=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '+' ORDER BY ORD
- SELECT_MESSAGE_ID_FOR_ACK=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '-' ORDER BY ORD
- UPDATE_COUNTER=UPDATE JBM_COUNTER SET NEXT_ID = ? WHERE NAME=?
- SELECT_COUNTER=SELECT NEXT_ID FROM JBM_COUNTER WHERE NAME=? FOR UPDATE
- INSERT_COUNTER=INSERT INTO JBM_COUNTER (NAME, NEXT_ID) VALUES (?, ?)
- SELECT_ALL_CHANNELS=SELECT DISTINCT(CHANNEL_ID) FROM JBM_MSG_REF
- UPDATE_TX=UPDATE JBM_TX SET NODE_ID=? WHERE NODE_ID=?
- ]]></attribute>
-
- <!-- The maximum number of parameters to include in a prepared statement -->
-
- <attribute name="MaxParams">500</attribute>
-
- </mbean>
-
- <!-- Messaging Post Office MBean configuration
- ========================================= -->
-
- <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
- name="jboss.messaging:service=PostOffice"
- xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml">
-
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <!-- The name of the post office -->
-
- <attribute name="PostOfficeName">JMS post office</attribute>
-
- <!-- The datasource used by the post office to access it's binding information -->
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <!-- If true will attempt to create tables and indexes on every start-up -->
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
-CREATE_POSTOFFICE_TABLE=CREATE TABLE JBM_POSTOFFICE (POSTOFFICE_NAME VARCHAR(255), NODE_ID INTEGER, QUEUE_NAME VARCHAR(255), COND VARCHAR(1023), SELECTOR VARCHAR(1023), CHANNEL_ID BIGINT, CLUSTERED CHAR(1), ALL_NODES CHAR(1), PRIMARY KEY(POSTOFFICE_NAME, NODE_ID, QUEUE_NAME))
-INSERT_BINDING=INSERT INTO JBM_POSTOFFICE (POSTOFFICE_NAME, NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED, ALL_NODES) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
-DELETE_BINDING=DELETE FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=? AND QUEUE_NAME=?
-LOAD_BINDINGS=SELECT QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED, ALL_NODES FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=?
- ]]></attribute>
-
- <!-- This post office is clustered. If you don't want a clustered post office then set to false -->
-
- <attribute name="Clustered">true</attribute>
-
- <!-- 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 -->
-
- <attribute name="GroupName">${jboss.messaging.groupname:MessagingPostOffice}</attribute>
-
- <!-- Max time to wait for state to arrive when the post office joins the cluster -->
-
- <attribute name="StateTimeout">5000</attribute>
-
- <!-- Max time to wait for a synchronous call to node members using the MessageDispatcher -->
-
- <attribute name="CastTimeout">5000</attribute>
-
- <!-- JGroups stack configuration for the data channel - used for sending data across the cluster -->
-
- <!-- By default we use the TCP stack for data -->
- <attribute name="DataChannelConfig">
- <config>
- <TCP start_port="7900"
- loopback="true"
- recv_buf_size="20000000"
- send_buf_size="640000"
- discard_incompatible_packets="true"
- max_bundle_size="64000"
- max_bundle_timeout="30"
- use_incoming_packet_handler="true"
- use_outgoing_packet_handler="false"
- down_thread="false" up_thread="false"
- enable_bundling="false"
- use_send_queues="false"
- sock_conn_timeout="300"
- skip_suspected_members="true"/>
- <MPING timeout="4000"
- bind_to_all_interfaces="true"
- mcast_addr="${jboss.messaging.datachanneludpaddress:228.6.6.6}"
- mcast_port="${jboss.messaging.datachanneludpport:45567}"
- ip_ttl="8"
- num_initial_members="2"
- num_ping_requests="1"/>
- <MERGE2 max_interval="100000"
- down_thread="false" up_thread="false" min_interval="20000"/>
- <FD_SOCK down_thread="false" up_thread="false"/>
- <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
- <pbcast.NAKACK max_xmit_size="60000"
- use_mcast_xmit="false" gc_lag="0"
- retransmit_timeout="300,600,1200,2400,4800"
- down_thread="false" up_thread="false"
- discard_delivered_msgs="true"/>
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
- down_thread="false" up_thread="false"
- max_bytes="400000"/>
- <pbcast.GMS print_local_addr="true" join_timeout="3000"
- down_thread="false" up_thread="false"
- join_retry_timeout="2000" shun="false"
- view_bundling="true"/>
- </config>
- </attribute>
-
- <!-- JGroups stack configuration to use for the control channel - used for control messages -->
-
- <!-- We use udp stack for the control channel -->
- <attribute name="ControlChannelConfig">
- <config>
- <UDP
- mcast_addr="${jboss.messaging.controlchanneludpaddress:228.7.7.7}"
- mcast_port="${jboss.messaging.controlchanneludpport:45568}"
- tos="8"
- ucast_recv_buf_size="20000000"
- ucast_send_buf_size="640000"
- mcast_recv_buf_size="25000000"
- mcast_send_buf_size="640000"
- loopback="false"
- discard_incompatible_packets="true"
- max_bundle_size="64000"
- max_bundle_timeout="30"
- use_incoming_packet_handler="true"
- use_outgoing_packet_handler="false"
- ip_ttl="2"
- down_thread="false" up_thread="false"
- enable_bundling="false"/>
- <PING timeout="2000"
- down_thread="false" up_thread="false" num_initial_members="3"/>
- <MERGE2 max_interval="100000"
- down_thread="false" up_thread="false" min_interval="20000"/>
- <FD_SOCK down_thread="false" up_thread="false"/>
- <FD timeout="10000" max_tries="5" down_thread="false" up_thread="false" shun="true"/>
- <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
- <pbcast.NAKACK max_xmit_size="60000"
- use_mcast_xmit="false" gc_lag="0"
- retransmit_timeout="300,600,1200,2400,4800"
- down_thread="false" up_thread="false"
- discard_delivered_msgs="true"/>
- <UNICAST timeout="300,600,1200,2400,3600"
- down_thread="false" up_thread="false"/>
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
- down_thread="false" up_thread="false"
- max_bytes="400000"/>
- <pbcast.GMS print_local_addr="true" join_timeout="3000" use_flush="true" flush_timeout="3000"
- down_thread="false" up_thread="false"
- join_retry_timeout="2000" shun="false"
- view_bundling="true"/>
- <FRAG2 frag_size="60000" down_thread="false" up_thread="false"/>
- <pbcast.STATE_TRANSFER down_thread="false" up_thread="false" use_flush="true" flush_timeout="3000"/>
- <pbcast.FLUSH down_thread="false" up_thread="false" timeout="20000" auto_flush_conf="false"/>
- </config>
- </attribute>
- </mbean>
-
- <!-- Messaging JMS User Manager MBean config
- ======================================= -->
-
- <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
- name="jboss.messaging:service=JMSUserManager"
- xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
-CREATE_USER_TABLE=CREATE TABLE JBM_USER (USER_ID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, CLIENTID VARCHAR(128), PRIMARY KEY(USER_ID))
-CREATE_ROLE_TABLE=CREATE TABLE JBM_ROLE (ROLE_ID VARCHAR(32) NOT NULL, USER_ID VARCHAR(32) NOT NULL, PRIMARY KEY(USER_ID, ROLE_ID))
-SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JBM_USER WHERE USER_ID=?
-POPULATE.TABLES.1=INSERT INTO JBM_USER (USER_ID,PASSWD,CLIENTID) VALUES ('dilbert','dogbert','dilbert-id')
- ]]></attribute>
- </mbean>
-
-</server>
Deleted: branches/Branch_MC_Integration_New/src/etc/server/default/deploy/hsqldb-persistence-service.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/default/deploy/hsqldb-persistence-service.xml 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/etc/server/default/deploy/hsqldb-persistence-service.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Hypersonic persistence deployment descriptor.
-
- DO NOT USE HYPERSONIC IN PRODUCTION or in a clustered environment- Hypersonic does not have transaction isolation
-
- $Id$
- -->
-
-<server>
-
- <!-- Persistence Manager MBean configuration
- ======================================= -->
-
- <mbean code="org.jboss.messaging.core.jmx.JDBCPersistenceManagerService"
- name="jboss.messaging:service=PersistenceManager"
- xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml">
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <!-- The datasource to use for the persistence manager -->
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <!-- If true will attempt to create tables and indexes on every start-up -->
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <!-- If true then will use JDBC batch updates -->
-
- <attribute name="UsingBatchUpdates">false</attribute>
-
- <!-- The maximum number of parameters to include in a prepared statement -->
-
- <attribute name="MaxParams">500</attribute>
- </mbean>
-
- <!-- Messaging Post Office MBean configuration
- ========================================= -->
-
- <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
- name="jboss.messaging:service=PostOffice"
- xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml">
-
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <!-- The name of the post office -->
-
- <attribute name="PostOfficeName">JMS post office</attribute>
-
- <!-- The datasource used by the post office to access it's binding information -->
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <!-- If true will attempt to create tables and indexes on every start-up -->
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <!-- This post office is NON CLUSTERED - do not use clustering with Hypersonic!! -->
-
- <attribute name="Clustered">false</attribute>
- </mbean>
-
- <!-- Messaging JMS User Manager MBean config
- ======================================= -->
-
- <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
- name="jboss.messaging:service=JMSUserManager"
- xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
-POPULATE.TABLES.1=INSERT INTO JBM_USER (USER_ID,PASSWD,CLIENTID) VALUES ('dilbert','dogbert','dilbert-id')
- ]]></attribute>
- </mbean>
-
-</server>
\ No newline at end of file
Copied: branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jbm-beans.xml (from rev 3279, branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jboss-beans.xml)
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jbm-beans.xml (rev 0)
+++ branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jbm-beans.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,262 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Configuration" class="org.jboss.jms.server.Configuration"/>
+
+ <bean name="ServiceLocator" class="org.jboss.jms.server.microcontainer.ServiceLocator">
+ <demand>jboss.jca:name=DefaultDS,service=DataSourceBinding</demand>
+ <depends>jboss:service=TransactionManager</depends>
+ <!-- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>-->
+ </bean>
+
+ <bean name="ServerPeer" class="org.jboss.jms.server.ServerPeer">
+ <depends>Remoting</depends>
+ <property name="persistenceManager">
+ <inject bean="PersistenceManager"/>
+ </property>
+ <property name="postOffice">
+ <inject bean="PostOffice"/>
+ </property>
+ <property name="clusterNotifier">
+ <inject bean="ClusterNotifier"/>
+ </property>
+ <property name="jmsUserManager">
+ <inject bean="JMSUserManager"/>
+ </property>
+ </bean>
+
+
+
+ <bean name="PersistenceManager" class="org.jboss.messaging.core.impl.JDBCPersistenceManager">
+ <property name="tm">
+ <inject bean="ServiceLocator" property="transactionManager"/>
+ </property>
+ <property name="ds">
+ <inject bean="ServiceLocator" property="dataSource"/>
+ </property>
+ <property name="createTablesOnStartup">true</property>
+ <property name="maxParams">500</property>
+ </bean>
+
+ <bean name="JMSUserManager" class="org.jboss.jms.server.plugin.JDBCJMSUserManager">
+ <property name="createTablesOnStartup">true</property>
+ <property name="ds">
+ <inject bean="ServiceLocator" property="dataSource"/>
+ </property>
+ <property name="tm">
+ <inject bean="ServiceLocator" property="transactionManager"/>
+ </property>
+ <property name="sqlProperties">
+ <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>POPULATE.TABLES.1</key>
+ <value>INSERT INTO JBM_USER (USER_ID,PASSWD,CLIENTID) VALUES ('dilbert','dogbert','dilbert-id')
+ </value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <bean name="PostOffice" class="org.jboss.messaging.core.impl.postoffice.MessagingPostOffice">
+ <property name="tm">
+ <inject bean="ServiceLocator" property="transactionManager"/>
+ </property>
+ <property name="ds">
+ <inject bean="ServiceLocator" property="dataSource"/>
+ </property>
+ <property name="pm">
+ <inject bean="PersistenceManager"/>
+ </property>
+ <property name="clusterNotifier">
+ <inject bean="ClusterNotifier"/>
+ </property>
+ <property name="channelFactory"><inject bean="JChannelFactory"/></property>
+
+ <property name="createTablesOnStartup">true</property>
+ <property name="sqlProperties">
+ <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>CREATE_POSTOFFICE_TABLE</key>
+ <value>CREATE TABLE JBM_POSTOFFICE (POSTOFFICE_NAME VARCHAR(255), NODE_ID INTEGER, QUEUE_NAME
+ VARCHAR(255), COND VARCHAR(1023), SELECTOR VARCHAR(1023), CHANNEL_ID BIGINT, CLUSTERED CHAR(1),
+ ALL_NODES CHAR(1), PRIMARY KEY(POSTOFFICE_NAME, NODE_ID, QUEUE_NAME)) ENGINE = INNODB
+ </value>
+ </entry>
+ <entry>
+ <key>INSERT_BINDING</key>
+ <value>INSERT INTO JBM_POSTOFFICE (POSTOFFICE_NAME, NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID,
+ CLUSTERED, ALL_NODES) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
+ </value>
+ </entry>
+ <entry>
+ <key>DELETE_BINDING</key>
+ <value>DELETE FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=? AND QUEUE_NAME=?</value>
+ </entry>
+ <entry>
+ <key>LOAD_BINDINGS</key>
+ <value>SELECT QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED, ALL_NODES FROM JBM_POSTOFFICE WHERE
+ POSTOFFICE_NAME=? AND NODE_ID=?
+ </value>
+ </entry>
+ </map>
+ </property>
+
+ </bean>
+
+
+
+ <bean class="org.jboss.jms.server.connectionfactory.ConnectionFactory"
+ name="ConnectionFactory">
+ <property name="name">ConnectionFactory</property>
+ <property name="serverPeer">
+ <inject bean="ServerPeer"/>
+ </property>
+ <property name="connector">
+ <inject bean="Remoting"/>
+ </property>
+ <property name="JNDIBindings">
+ <list elementClass="java.lang.String">
+ <value>/ConnectionFactory</value>
+ <value>/XAConnectionFactory</value>
+ <value>java:/ConnectionFactory</value>
+ <value>java:/XAConnectionFactory</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean class="org.jboss.jms.server.connectionfactory.ConnectionFactory"
+ name="ClusteredConnectionFactory">
+ <property name="name">ClusteredConnectionFactory</property>
+ <property name="connector">
+ <inject bean="Remoting"/>
+ </property>
+ <property name="serverPeer">
+ <inject bean="ServerPeer"/>
+ </property>
+ <property name="JNDIBindings">
+ <list elementClass="java.lang.String">
+ <value>/ClusteredConnectionFactory</value>
+ <value>/ClusteredXAConnectionFactory</value>
+ <value>java:/ClusteredConnectionFactory</value>
+ <value>java:/ClusteredXAConnectionFactory</value>
+ </list>
+ </property>
+ <property name="supportsFailover">true</property>
+ <property name="supportsLoadBalancing">true</property>
+ </bean>
+ <!--cant use the LTDS as its dependant on the jboss-jca service running does this matter-->
+ <!--<bean name="DataSource" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
+ <property name="jndiName">MessagingDS</property>
+ <property name="driverClass">com.mysql.jdbc.Driver</property>
+ <property name="connectionURL">jdbc:mysql://localhost:3306/messaging</property>
+ <property name="userName">andy</property>
+ <property name="transactionManager"><inject bean="ServiceLocator" property="transactionManager"/> </property>
+ </bean>-->
+ <!--<bean name="DataSource" class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource">
+ <property name="url">jdbc:mysql://localhost:3306/messaging</property>
+ <property name="user">andy</property>
+ </bean>-->
+
+ <bean name="Remoting" class="org.jboss.jms.server.microcontainer.factory.Connector">
+ <constructor>
+ <parameter>
+ <inject bean="InvokerLocator" property="locatorURI"/>
+ </parameter>
+ <!--<parameter>
+ <inject bean="RemotingConfig"/>
+ </parameter>-->
+ </constructor>
+ <property name="invocationHandler">
+ <inject bean="InvocationHandler"/>
+ </property>
+ </bean>
+
+ <bean name="InvokerLocator" class="org.jboss.remoting.InvokerLocator">
+ <constructor>
+ <parameter>bisocket</parameter>
+ <parameter>localhost</parameter>
+ <parameter>5400</parameter>
+ <parameter>
+ <null/>
+ </parameter>
+ <parameter class="java.util.Map">
+ <inject bean="RemotingConfig"/>
+ </parameter>
+ <!--<parameter>bisocket://localhost:5400/?marshaller=org.jboss.jms.wireformat.JMSWireFormat&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat&dataType=jms
+ </parameter>-->
+ </constructor>
+ </bean>
+
+ <bean name="InvocationHandler" class="org.jboss.jms.server.remoting.JMSServerInvocationHandler"/>
+
+ <bean name="RemotingConfig" class="java.util.HashMap">
+ <constructor>
+ <parameter class="java.util.Map">
+ <map keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>marshaller</key>
+ <value>org.jboss.jms.wireformat.JMSWireFormat</value>
+ </entry>
+ <entry>
+ <key>unmarshaller</key>
+ <value>org.jboss.jms.wireformat.JMSWireFormat</value>
+ </entry>
+ <entry>
+ <key>dataType</key>
+ <value>jms</value>
+ </entry>
+ <entry>
+ <key>socket.check_connection</key>
+ <value>false</value>
+ </entry>
+ <entry>
+ <key>timeout</key>
+ <value>0</value>
+ </entry>
+ <entry>
+ <key>leasePeriod</key>
+ <value>10000</value>
+ </entry>
+ <entry>
+ <key>clientSocketClass</key>
+ <value>org.jboss.jms.client.remoting.ClientSocketWrapper</value>
+ </entry>
+ <entry>
+ <key>serverSocketClass</key>
+ <value>org.jboss.jms.server.remoting.ServerSocketWrapper</value>
+ </entry>
+ <entry>
+ <key>numberOfRetries</key>
+ <value>1</value>
+ </entry>
+ <entry>
+ <key>numberOfCallRetries</key>
+ <value>1</value>
+ </entry>
+ <entry>
+ <key>clientMaxPoolSize</key>
+ <value>50</value>
+ </entry>
+ <entry>
+ <key>pingFrequency</key>
+ <value>214748364</value>
+ </entry>
+ <entry>
+ <key>pingWindowFactor</key>
+ <value>10</value>
+ </entry>
+ </map>
+ </parameter>
+ </constructor>
+ </bean>
+ <bean name="DestinationDeployer" class="org.jboss.jms.server.destination.DestinationDeployer">
+ <property name="serverPeer">
+ <inject bean="ServerPeer"/>
+ </property>
+ </bean>
+
+ <bean name="ClusterNotifier" class="org.jboss.messaging.core.impl.DefaultClusterNotifier"/>
+ <bean name="topic" class="org.jboss.jms.server.destination.ManagedTopic"/>
+
+</deployment>
\ No newline at end of file
Added: 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 (rev 0)
+++ branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jbm-configuration.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,73 @@
+<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 -->
+ <defaultTopicJndiContext>/topic</defaultTopicJndiContext>
+ <!-- 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 -->
+ <defaultSecurityConfig>
+ <role name="guest" read="true" write="true" create="true"/>
+ </defaultSecurityConfig>
+ <!-- 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>
+
+ <!-- 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>
+
+ <!-- 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>
+ <clustered>true</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 -->
+
+ <group-name>MessagingPostOffice</group-name>
+
+ <!-- Max time to wait for state to arrive when the post office joins the cluster -->
+
+ <state-timeout>5000</state-timeout>
+
+ <!-- Max time to wait for a synchronous call to node members using the MessageDispatcher -->
+
+ <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>
+
+</configuration>
\ No newline at end of file
Added: branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jbm-destinations.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jbm-destinations.xml (rev 0)
+++ branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jbm-destinations.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,84 @@
+<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>
+ <expiryqueue>PrivateExpiryQueue</expiryqueue>
+ </queue>
+
+ <topic name="TopicWithOwnDLQAndExpiryQueue">
+ <dlq>PrivateDLQ</dlq>
+ <expiryqueue>PrivateExpiryQueue</expiryqueue>
+ </topic>
+
+ <!-- Queues and Topics can also specify their own redelivery delay -->
+ <queue name="QueueWithOwnRedeliveryDelay">
+ <redeliverydelay>5000</redeliverydelay>
+ </queue>
+
+ <topic name="TopicWithOwnRedeliveryDelay">
+ <redeliverydelay>5000</redeliverydelay>
+ </topic>
+
+ <!--
+ Example clustered destinations.
+ -->
+ <queue name="testDistributedQueue">
+ <clustered>true</clustered>
+ </queue>
+
+ <topic name="testDistributedTopic">
+ <clustered>true</clustered>
+ </topic>
+
+</destinations>
\ No newline at end of file
Deleted: branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jboss-beans.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jboss-beans.xml 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jboss-beans.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -1,330 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
- <bean name="ServiceLocator" class="org.jboss.jms.server.microcontainer.ServiceLocator">
- <demand>jboss.jca:name=DefaultDS,service=DataSourceBinding</demand>
- <depends>jboss:service=TransactionManager</depends>
- <!-- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>-->
- </bean>
-
- <bean name="ServerPeer" class="org.jboss.jms.server.ServerPeer">
- <depends>Remoting</depends>
- <!-- The unique id of the server peer - in a cluster each node MUST have a unique value - must be an integer -->
- <property name="serverPeerID">0</property>
- <!-- The default JNDI context to use for queues when they are deployed without specifying one -->
- <property name="defaultQueueJNDIContext">/queue</property>
- <!-- The default JNDI context to use for topics when they are deployed without specifying one -->
- <property name="defaultTopicJNDIContext">/topic</property>
- <!-- The JAAS security domain to use for JBoss Messaging -->
- <property name="securityDomain">java:/jaas/messaging</property>
- <!-- The default security configuration to apply to destinations - this can be overridden on a per destination basis -->
- <property name="defaultSecurityConfig">
- <set class="java.util.HashSet" elementClass="org.jboss.jms.server.security.Role">
- <inject bean="DefaultRole"/>
- </set>
- </property>
- <!-- The default Dead Letter Queue (DLQ) to use for destinations. This can be overridden on a per destinatin basis -->
- <property name="defaultDLQ">DLQ</property>
-
- <!-- 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 -->
- <property name="defaultMaxDeliveryAttempts">10</property>
- <!-- The default Expiry Queue to use for destinations. This can be overridden on a per destinatin basis -->
- <property name="defaultExpiryQueue">ExpiryQueue</property>
- <!-- The default redelivery delay to impose. This can be overridden on a per destination basis -->
- <property name="defaultRedeliveryDelay">0</property>
- <!-- The periodicity of the message counter manager enquiring on queues for statistics -->
- <property name="messageCounterSamplePeriod">5000</property>
- <!-- The maximum amount of time for a client to wait for failover to start on the server side after
- it has detected failure -->
- <property name="failoverStartTimeout">60000</property>
- <!-- The maximum amount of time for a client to wait for failover to complete on the server side after
- it has detected failure -->
- <property name="failoverCompleteTimeout">300000</property>
- <!-- The maximum number of days results to maintain in the message counter history -->
- <property name="defaultMessageCounterHistoryDayLimit">-1</property>
- <!-- The name of the connection factory to use for creating connections between nodes to pull messages -->
- <property name="clusterPullConnectionFactoryName">
- jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory
- </property>
- <!-- Use XA when pulling persistent messages from a remote node to this one. -->
- <property name="useXAForMessagePull">true</property>
- <!-- When redistributing messages in the cluster. Do we need to preserve the order of messages received
-by a particular consumer from a particular producer? -->
- <property name="defaultPreserveOrdering">false</property>
- <!-- Max. time to hold previously delivered messages back waiting for clients to reconnect after failover -->
- <property name="recoverDeliveriesTimeout">300000</property>
- <!-- The password used by the message sucker connections to create connections.
- THIS SHOULD ALWAYS BE CHANGED AT INSTALL TIME TO SECURE SYSTEM
- <property name="SuckerPassword"></property>
- -->
- <property name="persistenceManager">
- <inject bean="PersistenceManager"/>
- </property>
- <property name="postOffice">
- <inject bean="PostOffice"/>
- </property>
- <property name="clusterNotifier">
- <inject bean="ClusterNotifier"/>
- </property>
- <property name="jmsUserManager">
- <inject bean="JMSUserManager"/>
- </property>
- </bean>
-
- <bean name="DefaultRole" class="org.jboss.jms.server.security.Role">
- <property name="name">guest</property>
- <property name="read">true</property>
- <property name="write">true</property>
- <property name="create">true</property>
- </bean>
-
- <bean name="PersistenceManager" class="org.jboss.messaging.core.impl.JDBCPersistenceManager">
- <property name="tm">
- <inject bean="ServiceLocator" property="transactionManager"/>
- </property>
- <property name="ds">
- <inject bean="ServiceLocator" property="dataSource"/>
- </property>
- <property name="createTablesOnStartup">true</property>
- <property name="maxParams">500</property>
- <property name="reaperPeriod">5000</property>
- </bean>
-
- <bean name="JMSUserManager" class="org.jboss.jms.server.plugin.JDBCJMSUserManager">
- <property name="createTablesOnStartup">true</property>
- <property name="ds">
- <inject bean="ServiceLocator" property="dataSource"/>
- </property>
- <property name="tm">
- <inject bean="ServiceLocator" property="transactionManager"/>
- </property>
- <property name="sqlProperties">
- <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
- <entry>
- <key>POPULATE.TABLES.1</key>
- <value>INSERT INTO JBM_USER (USER_ID,PASSWD,CLIENTID) VALUES ('dilbert','dogbert','dilbert-id')
- </value>
- </entry>
- </map>
- </property>
- </bean>
-
- <bean name="PostOffice" class="org.jboss.messaging.core.impl.postoffice.MessagingPostOffice">
- <property name="nodeID">0</property>
- <property name="officeName">JMS post office</property>
- <property name="tm">
- <inject bean="ServiceLocator" property="transactionManager"/>
- </property>
- <property name="ds">
- <inject bean="ServiceLocator" property="dataSource"/>
- </property>
- <property name="pm">
- <inject bean="PersistenceManager"/>
- </property>
- <property name="clusterNotifier">
- <inject bean="ClusterNotifier"/>
- </property>
- <property name="createTablesOnStartup">true</property>
- <property name="sqlProperties">
- <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
- <entry>
- <key>CREATE_POSTOFFICE_TABLE</key>
- <value>CREATE TABLE JBM_POSTOFFICE (POSTOFFICE_NAME VARCHAR(255), NODE_ID INTEGER, QUEUE_NAME
- VARCHAR(255), COND VARCHAR(1023), SELECTOR VARCHAR(1023), CHANNEL_ID BIGINT, CLUSTERED CHAR(1),
- ALL_NODES CHAR(1), PRIMARY KEY(POSTOFFICE_NAME, NODE_ID, QUEUE_NAME)) ENGINE = INNODB
- </value>
- </entry>
- <entry>
- <key>INSERT_BINDING</key>
- <value>INSERT INTO JBM_POSTOFFICE (POSTOFFICE_NAME, NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID,
- CLUSTERED, ALL_NODES) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
- </value>
- </entry>
- <entry>
- <key>DELETE_BINDING</key>
- <value>DELETE FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=? AND QUEUE_NAME=?</value>
- </entry>
- <entry>
- <key>LOAD_BINDINGS</key>
- <value>SELECT QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED, ALL_NODES FROM JBM_POSTOFFICE WHERE
- POSTOFFICE_NAME=? AND NODE_ID=?
- </value>
- </entry>
- </map>
- </property>
- <property name="clustered">true</property>
-
- <!-- 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 -->
-
- <property name="groupName">MessagingPostOffice</property>
-
- <!-- Max time to wait for state to arrive when the post office joins the cluster -->
-
- <property name="stateTimeout">5000</property>
-
- <!-- Max time to wait for a synchronous call to node members using the MessageDispatcher -->
-
- <property name="castTimeout">50000</property>
-
- <property name="controlChannelConfig">controlchannel-config.xml</property>
- <property name="dataChannelConfig">datachannel-config.xml</property>
-
- <property name="channelFactory"><inject bean="JChannelFactory"/></property>
- <property name="controlChannelName">udp-sync</property>
- <property name="dataChannelName">udp</property>
- <property name="channelPartitionName">${jboss.partition.name:DefaultPartition}-JMS</property>
- </bean>
-
-
-
- <bean class="org.jboss.jms.server.connectionfactory.ConnectionFactory"
- name="ConnectionFactory">
- <property name="name">ConnectionFactory</property>
- <property name="serverPeer">
- <inject bean="ServerPeer"/>
- </property>
- <property name="connector">
- <inject bean="Remoting"/>
- </property>
- <property name="JNDIBindings">
- <list elementClass="java.lang.String">
- <value>/ConnectionFactory</value>
- <value>/XAConnectionFactory</value>
- <value>java:/ConnectionFactory</value>
- <value>java:/XAConnectionFactory</value>
- </list>
- </property>
- </bean>
-
- <bean class="org.jboss.jms.server.connectionfactory.ConnectionFactory"
- name="ClusteredConnectionFactory">
- <property name="name">ClusteredConnectionFactory</property>
- <property name="connector">
- <inject bean="Remoting"/>
- </property>
- <property name="serverPeer">
- <inject bean="ServerPeer"/>
- </property>
- <property name="JNDIBindings">
- <list elementClass="java.lang.String">
- <value>/ClusteredConnectionFactory</value>
- <value>/ClusteredXAConnectionFactory</value>
- <value>java:/ClusteredConnectionFactory</value>
- <value>java:/ClusteredXAConnectionFactory</value>
- </list>
- </property>
- <property name="supportsFailover">true</property>
- <property name="supportsLoadBalancing">true</property>
- </bean>
- <!--cant use the LTDS as its dependant on the jboss-jca service running does this matter-->
- <!--<bean name="DataSource" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
- <property name="jndiName">MessagingDS</property>
- <property name="driverClass">com.mysql.jdbc.Driver</property>
- <property name="connectionURL">jdbc:mysql://localhost:3306/messaging</property>
- <property name="userName">andy</property>
- <property name="transactionManager"><inject bean="ServiceLocator" property="transactionManager"/> </property>
- </bean>-->
- <!--<bean name="DataSource" class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource">
- <property name="url">jdbc:mysql://localhost:3306/messaging</property>
- <property name="user">andy</property>
- </bean>-->
-
- <bean name="Remoting" class="org.jboss.jms.server.microcontainer.factory.Connector">
- <constructor>
- <parameter>
- <inject bean="InvokerLocator" property="locatorURI"/>
- </parameter>
- <!--<parameter>
- <inject bean="RemotingConfig"/>
- </parameter>-->
- </constructor>
- <property name="invocationHandler">
- <inject bean="InvocationHandler"/>
- </property>
- </bean>
-
- <bean name="InvokerLocator" class="org.jboss.remoting.InvokerLocator">
- <constructor>
- <parameter>bisocket</parameter>
- <parameter>localhost</parameter>
- <parameter>5400</parameter>
- <parameter>
- <null/>
- </parameter>
- <parameter class="java.util.Map">
- <inject bean="RemotingConfig"/>
- </parameter>
- <!--<parameter>bisocket://localhost:5400/?marshaller=org.jboss.jms.wireformat.JMSWireFormat&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat&dataType=jms
- </parameter>-->
- </constructor>
- </bean>
-
- <bean name="InvocationHandler" class="org.jboss.jms.server.remoting.JMSServerInvocationHandler"/>
-
- <bean name="RemotingConfig" class="java.util.HashMap">
- <constructor>
- <parameter class="java.util.Map">
- <map keyClass="java.lang.String" valueClass="java.lang.String">
- <entry>
- <key>marshaller</key>
- <value>org.jboss.jms.wireformat.JMSWireFormat</value>
- </entry>
- <entry>
- <key>unmarshaller</key>
- <value>org.jboss.jms.wireformat.JMSWireFormat</value>
- </entry>
- <entry>
- <key>dataType</key>
- <value>jms</value>
- </entry>
- <entry>
- <key>socket.check_connection</key>
- <value>false</value>
- </entry>
- <entry>
- <key>timeout</key>
- <value>0</value>
- </entry>
- <entry>
- <key>leasePeriod</key>
- <value>10000</value>
- </entry>
- <entry>
- <key>clientSocketClass</key>
- <value>org.jboss.jms.client.remoting.ClientSocketWrapper</value>
- </entry>
- <entry>
- <key>serverSocketClass</key>
- <value>org.jboss.jms.server.remoting.ServerSocketWrapper</value>
- </entry>
- <entry>
- <key>numberOfRetries</key>
- <value>1</value>
- </entry>
- <entry>
- <key>numberOfCallRetries</key>
- <value>1</value>
- </entry>
- <entry>
- <key>clientMaxPoolSize</key>
- <value>50</value>
- </entry>
- </map>
- </parameter>
- </constructor>
- </bean>
- <bean name="DestinationDeployer" class="org.jboss.jms.server.microcontainer.DestinationDeployer">
- <property name="serverPeer">
- <inject bean="ServerPeer"/>
- </property>
- </bean>
-
- <bean name="ClusterNotifier" class="org.jboss.messaging.core.impl.DefaultClusterNotifier"/>
- <bean name="topic" class="org.jboss.jms.server.destination.ManagedTopic"/>
-
-</deployment>
\ No newline at end of file
Deleted: branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jboss-service.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jboss-service.xml 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/etc/server/default/deploy/jboss-service.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Bootstrap - starts the messaging server peer
-
- $Id$
- -->
-
-<server>
-
- <mbean code="org.jboss.jms.server.Bootstrap"
- name="jboss.messaging:service=Bootstrap"
- xmbean-dd="xmdesc/Bootstrap-xmbean.xml">
- <depends>jboss.messaging:service=ServerPeer</depends>
- </mbean>
-
-</server>
\ No newline at end of file
Deleted: branches/Branch_MC_Integration_New/src/etc/server/default/deploy/messaging-service.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/default/deploy/messaging-service.xml 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/etc/server/default/deploy/messaging-service.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -1,110 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- The JBoss Messaging service deployment descriptor.
-
- $Id$
- -->
-
-<server>
-
- <!-- ServerPeer MBean configuration
- ============================== -->
-
- <mbean code="org.jboss.jms.server.ServerPeer"
- name="jboss.messaging:service=ServerPeer"
- xmbean-dd="xmdesc/ServerPeer-xmbean.xml">
-
- <!-- The unique id of the server peer - in a cluster each node MUST have a unique value - must be an integer -->
-
- <attribute name="ServerPeerID">0</attribute>
-
- <!-- The default JNDI context to use for queues when they are deployed without specifying one -->
-
- <attribute name="DefaultQueueJNDIContext">/queue</attribute>
-
- <!-- The default JNDI context to use for topics when they are deployed without specifying one -->
-
- <attribute name="DefaultTopicJNDIContext">/topic</attribute>
-
- <attribute name="PostOffice">jboss.messaging:service=PostOffice</attribute>
-
- <!-- The JAAS security domain to use for JBoss Messaging -->
-
- <attribute name="SecurityDomain">java:/jaas/messaging</attribute>
-
- <!-- The default security configuration to apply to destinations - this can be overridden on a per destination basis -->
-
- <attribute name="DefaultSecurityConfig">
- <security>
- <role name="guest" read="true" write="true" create="true"/>
- </security>
- </attribute>
-
- <!-- The default Dead Letter Queue (DLQ) to use for destinations.
- This can be overridden on a per destinatin basis -->
-
- <attribute name="DefaultDLQ">jboss.messaging.destination:service=Queue,name=DLQ</attribute>
-
- <!-- 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 -->
-
- <attribute name="DefaultMaxDeliveryAttempts">10</attribute>
-
- <!-- The default Expiry Queue to use for destinations. This can be overridden on a per destinatin basis -->
-
- <attribute name="DefaultExpiryQueue">jboss.messaging.destination:service=Queue,name=ExpiryQueue</attribute>
-
- <!-- The default redelivery delay to impose. This can be overridden on a per destination basis -->
-
- <attribute name="DefaultRedeliveryDelay">0</attribute>
-
- <!-- The periodicity of the message counter manager enquiring on queues for statistics -->
-
- <attribute name="MessageCounterSamplePeriod">5000</attribute>
-
- <!-- The maximum amount of time for a client to wait for failover to start on the server side after
- it has detected failure -->
-
- <attribute name="FailoverStartTimeout">60000</attribute>
-
- <!-- The maximum amount of time for a client to wait for failover to complete on the server side after
- it has detected failure -->
-
- <attribute name="FailoverCompleteTimeout">300000</attribute>
-
- <!-- The maximum number of days results to maintain in the message counter history -->
-
- <attribute name="DefaultMessageCounterHistoryDayLimit">-1</attribute>
-
- <!-- The name of the connection factory to use for creating connections between nodes to pull messages -->
-
- <attribute name="ClusterPullConnectionFactoryName">jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory</attribute>
-
- <!-- Use XA when pulling persistent messages from a remote node to this one. -->
-
- <attribute name="UseXAForMessagePull">false</attribute>
-
- <!-- When redistributing messages in the cluster. Do we need to preserve the order of messages received
- by a particular consumer from a particular producer? -->
-
- <attribute name="DefaultPreserveOrdering">false</attribute>
-
- <!-- Max. time to hold previously delivered messages back waiting for clients to reconnect after failover -->
-
- <attribute name="RecoverDeliveriesTimeout">300000</attribute>
-
- <!-- The password used by the message sucker connections to create connections.
- THIS SHOULD ALWAYS BE CHANGED AT INSTALL TIME TO SECURE SYSTEM
- <attribute name="SuckerPassword"></attribute>
- -->
-
- <depends optional-attribute-name="PersistenceManager">jboss.messaging:service=PersistenceManager</depends>
-
- <depends optional-attribute-name="JMSUserManager">jboss.messaging:service=JMSUserManager</depends>
-
- <depends>jboss.messaging:service=Connector,transport=bisocket</depends>
-
- </mbean>
-
-</server>
Deleted: branches/Branch_MC_Integration_New/src/etc/server/default/deploy/mssql-persistence-service.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/default/deploy/mssql-persistence-service.xml 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/etc/server/default/deploy/mssql-persistence-service.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -1,261 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- MS SQL Server persistence deployment descriptor.
-
- Tested with SQL Server 2005
-
- $Id$
- -->
-
-<server>
-
- <!-- Persistence Manager MBean configuration
- ======================================== -->
-
- <mbean code="org.jboss.messaging.core.jmx.JDBCPersistenceManagerService"
- name="jboss.messaging:service=PersistenceManager"
- xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml">
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <!-- The datasource to use for the persistence manager -->
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <!-- If true will attempt to create tables and indexes on every start-up -->
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <!-- If true then will use JDBC batch updates -->
-
- <attribute name="UsingBatchUpdates">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
- CREATE_DUAL=CREATE TABLE JBM_DUAL (DUMMY INTEGER, PRIMARY KEY (DUMMY))
- CREATE_MESSAGE_REFERENCE=CREATE TABLE JBM_MSG_REF (CHANNEL_ID BIGINT, MESSAGE_ID BIGINT, TRANSACTION_ID BIGINT, STATE CHAR(1), ORD BIGINT, PAGE_ORD BIGINT, DELIVERY_COUNT INT, SCHED_DELIVERY BIGINT, PRIMARY KEY(CHANNEL_ID, MESSAGE_ID))
- CREATE_IDX_MESSAGE_REF_TX=CREATE INDEX JBM_MSG_REF_TX ON JBM_MSG_REF (TRANSACTION_ID)
- CREATE_IDX_MESSAGE_REF_ORD=CREATE INDEX JBM_MSG_REF_ORD ON JBM_MSG_REF (ORD)
- CREATE_IDX_MESSAGE_REF_PAGE_ORD=CREATE INDEX JBM_MSG_REF_PAGE_ORD ON JBM_MSG_REF (PAGE_ORD)
- CREATE_IDX_MESSAGE_REF_MESSAGE_ID=CREATE INDEX JBM_MSG_REF_MESSAGE_ID ON JBM_MSG_REF (MESSAGE_ID)
- CREATE_IDX_MESSAGE_REF_SCHED_DELIVERY=CREATE INDEX JBM_MSG_REF_SCHED_DELIVERY ON JBM_MSG_REF (SCHED_DELIVERY)
- CREATE_MESSAGE=CREATE TABLE JBM_MSG (MESSAGE_ID BIGINT, RELIABLE CHAR(1), EXPIRATION BIGINT, TIMESTAMP BIGINT, PRIORITY TINYINT, TYPE TINYINT, INS_TIME BIGINT, HEADERS IMAGE, PAYLOAD IMAGE, PRIMARY KEY (MESSAGE_ID))
- CREATE_IDX_MESSAGE_TIMESTAMP=CREATE INDEX JBM_MSG_REF_TIMESTAMP ON JBM_MSG (TIMESTAMP)
- CREATE_TRANSACTION=CREATE TABLE JBM_TX (NODE_ID INTEGER, TRANSACTION_ID BIGINT, BRANCH_QUAL VARBINARY(254), FORMAT_ID INT, GLOBAL_TXID VARBINARY(254), PRIMARY KEY (TRANSACTION_ID))
- CREATE_COUNTER=CREATE TABLE JBM_COUNTER (NAME VARCHAR(255), NEXT_ID BIGINT, PRIMARY KEY(NAME))
- INSERT_DUAL=INSERT INTO JBM_DUAL VALUES (1)
- CHECK_DUAL=SELECT 1 FROM JBM_DUAL
- INSERT_MESSAGE_REF=INSERT INTO JBM_MSG_REF (CHANNEL_ID, MESSAGE_ID, TRANSACTION_ID, STATE, ORD, PAGE_ORD, DELIVERY_COUNT, SCHED_DELIVERY) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
- DELETE_MESSAGE_REF=DELETE FROM JBM_MSG_REF WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
- UPDATE_MESSAGE_REF=UPDATE JBM_MSG_REF SET TRANSACTION_ID=?, STATE='-' WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
- UPDATE_PAGE_ORDER=UPDATE JBM_MSG_REF SET PAGE_ORD = ? WHERE MESSAGE_ID=? AND CHANNEL_ID=?
- COMMIT_MESSAGE_REF1=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='+'
- COMMIT_MESSAGE_REF2=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='-'
- ROLLBACK_MESSAGE_REF1=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='+'
- ROLLBACK_MESSAGE_REF2=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='-'
- LOAD_PAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, PAGE_ORD, SCHED_DELIVERY FROM JBM_MSG_REF WHERE CHANNEL_ID = ? AND PAGE_ORD BETWEEN ? AND ? ORDER BY PAGE_ORD
- LOAD_UNPAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? AND PAGE_ORD IS NULL ORDER BY ORD
- LOAD_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? ORDER BY ORD
- UPDATE_REFS_NOT_PAGED=UPDATE JBM_MSG_REF SET PAGE_ORD = NULL WHERE PAGE_ORD BETWEEN ? AND ? AND CHANNEL_ID=?
- SELECT_MIN_MAX_PAGE_ORD=SELECT MIN(PAGE_ORD), MAX(PAGE_ORD) FROM JBM_MSG_REF WHERE CHANNEL_ID = ?
- SELECT_EXISTS_REF_MESSAGE_ID=SELECT MESSAGE_ID FROM JBM_MSG_REF WHERE MESSAGE_ID = ?
- UPDATE_DELIVERY_COUNT=UPDATE JBM_MSG_REF SET DELIVERY_COUNT = ? WHERE CHANNEL_ID = ? AND MESSAGE_ID = ?
- UPDATE_CHANNEL_ID=UPDATE JBM_MSG_REF SET CHANNEL_ID = ? WHERE CHANNEL_ID = ?
- LOAD_MESSAGES=SELECT MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, HEADERS, PAYLOAD, TYPE FROM JBM_MSG
- INSERT_MESSAGE=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME, HEADERS, PAYLOAD) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
- INSERT_MESSAGE_CONDITIONAL=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME) SELECT ?, ?, ?, ?, ?, ?, ? FROM JBM_DUAL WHERE NOT EXISTS (SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ?)
- UPDATE_MESSAGE_4CONDITIONAL=UPDATE JBM_MSG SET HEADERS=?, PAYLOAD=? WHERE MESSAGE_ID=?
- INSERT_MESSAGE_CONDITIONAL_FULL=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME, HEADERS, PAYLOAD) SELECT ?, ?, ?, ?, ?, ?, ?, ?, ? FROM JBM_DUAL WHERE NOT EXISTS (SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ?)
- MESSAGE_ID_COLUMN=MESSAGE_ID
- REAP_MESSAGES=DELETE FROM JBM_MSG WHERE INS_TIME < ? AND NOT EXISTS (SELECT * FROM JBM_MSG_REF WHERE JBM_MSG_REF.MESSAGE_ID = JBM_MSG.MESSAGE_ID)
- DELETE_MESSAGE=DELETE FROM JBM_MSG WHERE MESSAGE_ID = ? AND NOT EXISTS (SELECT * FROM JBM_MSG_REF WHERE JBM_MSG_REF.MESSAGE_ID = ?)
- INSERT_TRANSACTION=INSERT INTO JBM_TX (NODE_ID, TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID) VALUES(?, ?, ?, ?, ?)
- DELETE_TRANSACTION=DELETE FROM JBM_TX WHERE NODE_ID = ? AND TRANSACTION_ID = ?
- SELECT_PREPARED_TRANSACTIONS=SELECT TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID FROM JBM_TX WHERE NODE_ID = ?
- SELECT_MESSAGE_ID_FOR_REF=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '+' ORDER BY ORD
- SELECT_MESSAGE_ID_FOR_ACK=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '-' ORDER BY ORD
- UPDATE_COUNTER=UPDATE JBM_COUNTER SET NEXT_ID = ? WHERE NAME=?
- SELECT_COUNTER=SELECT NEXT_ID FROM JBM_COUNTER WITH (HOLDLOCK, ROWLOCK) WHERE NAME=?
- INSERT_COUNTER=INSERT INTO JBM_COUNTER (NAME, NEXT_ID) VALUES (?, ?)
- SELECT_ALL_CHANNELS=SELECT DISTINCT(CHANNEL_ID) FROM JBM_MSG_REF
- UPDATE_TX=UPDATE JBM_TX SET NODE_ID=? WHERE NODE_ID=?
- ]]></attribute>
-
- <!-- The maximum number of parameters to include in a prepared statement -->
-
- <attribute name="MaxParams">500</attribute>
-
- </mbean>
-
- <!-- Messaging Post Office MBean configuration
- ========================================= -->
-
- <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
- name="jboss.messaging:service=PostOffice"
- xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml">
-
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <!-- The name of the post office -->
-
- <attribute name="PostOfficeName">JMS post office</attribute>
-
- <!-- The datasource used by the post office to access it's binding information -->
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <!-- If true will attempt to create tables and indexes on every start-up -->
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
-CREATE_POSTOFFICE_TABLE=CREATE TABLE JBM_POSTOFFICE (POSTOFFICE_NAME VARCHAR(255), NODE_ID SMALLINT, QUEUE_NAME VARCHAR(255), COND VARCHAR(1023), SELECTOR VARCHAR(1023), CHANNEL_ID INTEGER, CLSTERED CHAR(1), ALL_NODES CHAR(1), PRIMARY KEY(POSTOFFICE_NAME, NODE_ID, QUEUE_NAME))
-INSERT_BINDING=INSERT INTO JBM_POSTOFFICE (POSTOFFICE_NAME, NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLSTERED, ALL_NODES) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
-DELETE_BINDING=DELETE FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=? AND QUEUE_NAME=?
-LOAD_BINDINGS=SELECT QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLSTERED, ALL_NODES FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=?
- ]]></attribute>
-
- <!-- This post office is clustered. If you don't want a clustered post office then set to false -->
-
- <attribute name="Clustered">true</attribute>
-
- <!-- 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 -->
-
- <attribute name="GroupName">${jboss.messaging.groupname:MessagingPostOffice}</attribute>
-
- <!-- Max time to wait for state to arrive when the post office joins the cluster -->
-
- <attribute name="StateTimeout">5000</attribute>
-
- <!-- Max time to wait for a synchronous call to node members using the MessageDispatcher -->
-
- <attribute name="CastTimeout">5000</attribute>
-
- <!-- JGroups stack configuration for the data channel - used for sending data across the cluster -->
-
- <!-- By default we use the TCP stack for data -->
- <attribute name="DataChannelConfig">
- <config>
- <TCP start_port="7900"
- loopback="true"
- recv_buf_size="20000000"
- send_buf_size="640000"
- discard_incompatible_packets="true"
- max_bundle_size="64000"
- max_bundle_timeout="30"
- use_incoming_packet_handler="true"
- use_outgoing_packet_handler="false"
- down_thread="false" up_thread="false"
- enable_bundling="false"
- use_send_queues="false"
- sock_conn_timeout="300"
- skip_suspected_members="true"/>
- <MPING timeout="4000"
- bind_to_all_interfaces="true"
- mcast_addr="${jboss.messaging.datachanneludpaddress:228.6.6.6}"
- mcast_port="${jboss.messaging.datachanneludpport:45567}"
- ip_ttl="8"
- num_initial_members="2"
- num_ping_requests="1"/>
- <MERGE2 max_interval="100000"
- down_thread="false" up_thread="false" min_interval="20000"/>
- <FD_SOCK down_thread="false" up_thread="false"/>
- <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
- <pbcast.NAKACK max_xmit_size="60000"
- use_mcast_xmit="false" gc_lag="0"
- retransmit_timeout="300,600,1200,2400,4800"
- down_thread="false" up_thread="false"
- discard_delivered_msgs="true"/>
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
- down_thread="false" up_thread="false"
- max_bytes="400000"/>
- <pbcast.GMS print_local_addr="true" join_timeout="3000"
- down_thread="false" up_thread="false"
- join_retry_timeout="2000" shun="false"
- view_bundling="true"/>
- </config>
- </attribute>
-
- <!-- JGroups stack configuration to use for the control channel - used for control messages -->
-
- <!-- We use udp stack for the control channel -->
- <attribute name="ControlChannelConfig">
- <config>
- <UDP
- mcast_addr="${jboss.messaging.controlchanneludpaddress:228.7.7.7}"
- mcast_port="${jboss.messaging.controlchanneludpport:45568}"
- tos="8"
- ucast_recv_buf_size="20000000"
- ucast_send_buf_size="640000"
- mcast_recv_buf_size="25000000"
- mcast_send_buf_size="640000"
- loopback="false"
- discard_incompatible_packets="true"
- max_bundle_size="64000"
- max_bundle_timeout="30"
- use_incoming_packet_handler="true"
- use_outgoing_packet_handler="false"
- ip_ttl="2"
- down_thread="false" up_thread="false"
- enable_bundling="false"/>
- <PING timeout="2000"
- down_thread="false" up_thread="false" num_initial_members="3"/>
- <MERGE2 max_interval="100000"
- down_thread="false" up_thread="false" min_interval="20000"/>
- <FD_SOCK down_thread="false" up_thread="false"/>
- <FD timeout="10000" max_tries="5" down_thread="false" up_thread="false" shun="true"/>
- <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
- <pbcast.NAKACK max_xmit_size="60000"
- use_mcast_xmit="false" gc_lag="0"
- retransmit_timeout="300,600,1200,2400,4800"
- down_thread="false" up_thread="false"
- discard_delivered_msgs="true"/>
- <UNICAST timeout="300,600,1200,2400,3600"
- down_thread="false" up_thread="false"/>
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
- down_thread="false" up_thread="false"
- max_bytes="400000"/>
- <pbcast.GMS print_local_addr="true" join_timeout="3000" use_flush="true" flush_timeout="3000"
- down_thread="false" up_thread="false"
- join_retry_timeout="2000" shun="false"
- view_bundling="true"/>
- <FRAG2 frag_size="60000" down_thread="false" up_thread="false"/>
- <pbcast.STATE_TRANSFER down_thread="false" up_thread="false" use_flush="true" flush_timeout="3000"/>
- <pbcast.FLUSH down_thread="false" up_thread="false" timeout="20000" auto_flush_conf="false"/>
- </config>
- </attribute>
- </mbean>
-
- <!-- Messaging JMS User Manager MBean config
- ======================================= -->
-
- <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
- name="jboss.messaging:service=JMSUserManager"
- xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
-CREATE_USER_TABLE=CREATE TABLE JBM_USER (USER_ID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, CLIENTID VARCHAR(128), PRIMARY KEY(USER_ID))
-CREATE_ROLE_TABLE=CREATE TABLE JBM_ROLE (ROLE_ID VARCHAR(32) NOT NULL, USER_ID VARCHAR(32) NOT NULL, PRIMARY KEY(USER_ID, ROLE_ID))
-SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JBM_USER WHERE USER_ID=?
-POPULATE.TABLES.1=INSERT INTO JBM_USER (USER_ID,PASSWD,CLIENTID) VALUES ('dilbert','dogbert','dilbert-id')
- ]]></attribute>
- </mbean>
-
-</server>
Deleted: branches/Branch_MC_Integration_New/src/etc/server/default/deploy/mysql-persistence-service.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/default/deploy/mysql-persistence-service.xml 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/etc/server/default/deploy/mysql-persistence-service.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -1,257 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- MySql persistence deployment descriptor.
-
- Tested with MySQL 4.1.22
-
- $Id$
- -->
-
-<server>
-
- <!-- Persistence Manager MBean configuration
- ======================================== -->
-
- <mbean code="org.jboss.messaging.core.jmx.JDBCPersistenceManagerService"
- name="jboss.messaging:service=PersistenceManager"
- xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml">
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <!-- The datasource to use for the persistence manager -->
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <!-- If true will attempt to create tables and indexes on every start-up -->
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <!-- If true then will use JDBC batch updates -->
-
- <attribute name="UsingBatchUpdates">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
- CREATE_DUAL=CREATE TABLE JBM_DUAL (DUMMY INTEGER, PRIMARY KEY (DUMMY)) ENGINE = INNODB
- CREATE_MESSAGE_REFERENCE=CREATE TABLE JBM_MSG_REF (CHANNEL_ID BIGINT, MESSAGE_ID BIGINT, TRANSACTION_ID BIGINT, STATE CHAR(1), ORD BIGINT, PAGE_ORD BIGINT, DELIVERY_COUNT INTEGER, SCHED_DELIVERY BIGINT, PRIMARY KEY(CHANNEL_ID, MESSAGE_ID)) ENGINE = INNODB
- CREATE_IDX_MESSAGE_REF_TX=CREATE INDEX JBM_MSG_REF_TX ON JBM_MSG_REF (TRANSACTION_ID)
- CREATE_IDX_MESSAGE_REF_ORD=CREATE INDEX JBM_MSG_REF_ORD ON JBM_MSG_REF (ORD)
- CREATE_IDX_MESSAGE_REF_PAGE_ORD=CREATE INDEX JBM_MSG_REF_PAGE_ORD ON JBM_MSG_REF (PAGE_ORD)
- CREATE_IDX_MESSAGE_REF_MESSAGE_ID=CREATE INDEX JBM_MSG_REF_MESSAGE_ID ON JBM_MSG_REF (MESSAGE_ID)
- CREATE_IDX_MESSAGE_REF_SCHED_DELIVERY=CREATE INDEX JBM_MSG_REF_SCHED_DELIVERY ON JBM_MSG_REF (SCHED_DELIVERY)
- CREATE_MESSAGE=CREATE TABLE JBM_MSG (MESSAGE_ID BIGINT, RELIABLE CHAR(1), EXPIRATION BIGINT, TIMESTAMP BIGINT, PRIORITY TINYINT, TYPE TINYINT, INS_TIME BIGINT, HEADERS MEDIUMBLOB, PAYLOAD LONGBLOB, PRIMARY KEY (MESSAGE_ID)) ENGINE = INNODB
- CREATE_IDX_MESSAGE_TIMESTAMP=CREATE INDEX JBM_MSG_REF_TIMESTAMP ON JBM_MSG (TIMESTAMP)
- CREATE_TRANSACTION=CREATE TABLE JBM_TX (NODE_ID INTEGER, TRANSACTION_ID BIGINT, BRANCH_QUAL VARBINARY(254), FORMAT_ID INTEGER, GLOBAL_TXID VARBINARY(254), PRIMARY KEY (TRANSACTION_ID)) ENGINE = INNODB
- CREATE_COUNTER=CREATE TABLE JBM_COUNTER (NAME VARCHAR(255), NEXT_ID BIGINT, PRIMARY KEY(NAME)) ENGINE = INNODB
- INSERT_DUAL=INSERT INTO JBM_DUAL VALUES (1)
- CHECK_DUAL=SELECT 1 FROM JBM_DUAL
- INSERT_MESSAGE_REF=INSERT INTO JBM_MSG_REF (CHANNEL_ID, MESSAGE_ID, TRANSACTION_ID, STATE, ORD, PAGE_ORD, DELIVERY_COUNT, SCHED_DELIVERY) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
- DELETE_MESSAGE_REF=DELETE FROM JBM_MSG_REF WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
- UPDATE_MESSAGE_REF=UPDATE JBM_MSG_REF SET TRANSACTION_ID=?, STATE='-' WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
- UPDATE_PAGE_ORDER=UPDATE JBM_MSG_REF SET PAGE_ORD = ? WHERE MESSAGE_ID=? AND CHANNEL_ID=?
- COMMIT_MESSAGE_REF1=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='+'
- COMMIT_MESSAGE_REF2=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='-'
- ROLLBACK_MESSAGE_REF1=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='+'
- ROLLBACK_MESSAGE_REF2=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='-'
- LOAD_PAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, PAGE_ORD, SCHED_DELIVERY FROM JBM_MSG_REF WHERE CHANNEL_ID = ? AND PAGE_ORD BETWEEN ? AND ? ORDER BY PAGE_ORD
- LOAD_UNPAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? AND PAGE_ORD IS NULL ORDER BY ORD
- LOAD_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? ORDER BY ORD
- UPDATE_REFS_NOT_PAGED=UPDATE JBM_MSG_REF SET PAGE_ORD = NULL WHERE PAGE_ORD BETWEEN ? AND ? AND CHANNEL_ID=?
- SELECT_MIN_MAX_PAGE_ORD=SELECT MIN(PAGE_ORD), MAX(PAGE_ORD) FROM JBM_MSG_REF WHERE CHANNEL_ID = ?
- SELECT_EXISTS_REF_MESSAGE_ID=SELECT MESSAGE_ID FROM JBM_MSG_REF WHERE MESSAGE_ID = ?
- UPDATE_DELIVERY_COUNT=UPDATE JBM_MSG_REF SET DELIVERY_COUNT = ? WHERE CHANNEL_ID = ? AND MESSAGE_ID = ?
- UPDATE_CHANNEL_ID=UPDATE JBM_MSG_REF SET CHANNEL_ID = ? WHERE CHANNEL_ID = ?
- LOAD_MESSAGES=SELECT MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, HEADERS, PAYLOAD, TYPE FROM JBM_MSG
- INSERT_MESSAGE=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME, HEADERS, PAYLOAD) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
- INSERT_MESSAGE_CONDITIONAL=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME) SELECT ?, ?, ?, ?, ?, ?, ? FROM JBM_DUAL WHERE NOT EXISTS (SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ?)
- UPDATE_MESSAGE_4CONDITIONAL=UPDATE JBM_MSG SET HEADERS=?, PAYLOAD=? WHERE MESSAGE_ID=?
- INSERT_MESSAGE_CONDITIONAL_FULL=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME, HEADERS, PAYLOAD) SELECT ?, ?, ?, ?, ?, ?, ?, ?, ? FROM JBM_DUAL WHERE NOT EXISTS (SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ?)
- MESSAGE_ID_COLUMN=MESSAGE_ID
- REAP_MESSAGES=DELETE FROM JBM_MSG WHERE INS_TIME < ? AND NOT EXISTS (SELECT * FROM JBM_MSG_REF WHERE JBM_MSG_REF.MESSAGE_ID = JBM_MSG.MESSAGE_ID)
- DELETE_MESSAGE=DELETE FROM JBM_MSG WHERE MESSAGE_ID = ? AND NOT EXISTS (SELECT * FROM JBM_MSG_REF WHERE JBM_MSG_REF.MESSAGE_ID = ?)
- INSERT_TRANSACTION=INSERT INTO JBM_TX (NODE_ID, TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID) VALUES(?, ?, ?, ?, ?)
- DELETE_TRANSACTION=DELETE FROM JBM_TX WHERE NODE_ID = ? AND TRANSACTION_ID = ?
- SELECT_PREPARED_TRANSACTIONS=SELECT TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID FROM JBM_TX WHERE NODE_ID = ?
- SELECT_MESSAGE_ID_FOR_REF=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '+' ORDER BY ORD
- SELECT_MESSAGE_ID_FOR_ACK=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '-' ORDER BY ORD
- UPDATE_COUNTER=UPDATE JBM_COUNTER SET NEXT_ID = ? WHERE NAME=?
- SELECT_COUNTER=SELECT NEXT_ID FROM JBM_COUNTER WHERE NAME=? FOR UPDATE
- INSERT_COUNTER=INSERT INTO JBM_COUNTER (NAME, NEXT_ID) VALUES (?, ?)
- SELECT_ALL_CHANNELS=SELECT DISTINCT(CHANNEL_ID) FROM JBM_MSG_REF
- UPDATE_TX=UPDATE JBM_TX SET NODE_ID=? WHERE NODE_ID=?
- ]]></attribute>
-
- <!-- The maximum number of parameters to include in a prepared statement -->
-
- <attribute name="MaxParams">500</attribute>
-
- </mbean>
-
- <!-- Messaging Post Office MBean configuration
- ========================================= -->
-
- <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
- name="jboss.messaging:service=PostOffice"
- xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml">
-
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <!-- The name of the post office -->
-
- <attribute name="PostOfficeName">JMS post office</attribute>
-
- <!-- The datasource used by the post office to access it's binding information -->
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <!-- If true will attempt to create tables and indexes on every start-up -->
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
-CREATE_POSTOFFICE_TABLE=CREATE TABLE JBM_POSTOFFICE (POSTOFFICE_NAME VARCHAR(255), NODE_ID INTEGER, QUEUE_NAME VARCHAR(255), COND VARCHAR(1023), SELECTOR VARCHAR(1023), CHANNEL_ID BIGINT, CLUSTERED CHAR(1), ALL_NODES CHAR(1), PRIMARY KEY(POSTOFFICE_NAME, NODE_ID, QUEUE_NAME)) ENGINE = INNODB
-INSERT_BINDING=INSERT INTO JBM_POSTOFFICE (POSTOFFICE_NAME, NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED, ALL_NODES) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
-DELETE_BINDING=DELETE FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=? AND QUEUE_NAME=?
-LOAD_BINDINGS=SELECT QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED, ALL_NODES FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=?
- ]]></attribute>
-
- <!-- This post office is clustered. If you don't want a clustered post office then set to false -->
-
- <attribute name="Clustered">true</attribute>
-
- <!-- 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 -->
-
- <attribute name="GroupName">${jboss.messaging.groupname:MessagingPostOffice}</attribute>
-
- <!-- Max time to wait for state to arrive when the post office joins the cluster -->
-
- <attribute name="StateTimeout">5000</attribute>
-
- <!-- Max time to wait for a synchronous call to node members using the MessageDispatcher -->
-
- <attribute name="CastTimeout">50000</attribute>
-
- <!-- JGroups stack configuration for the data channel - used for sending data across the cluster -->
-
- <!-- By default we use the TCP stack for data -->
- <attribute name="DataChannelConfig">
- <config>
- <TCP start_port="7900"
- loopback="true"
- recv_buf_size="20000000"
- send_buf_size="640000"
- discard_incompatible_packets="true"
- max_bundle_size="64000"
- max_bundle_timeout="30"
- use_incoming_packet_handler="true"
- use_outgoing_packet_handler="false"
- down_thread="false" up_thread="false"
- enable_bundling="false"
- use_send_queues="false"
- sock_conn_timeout="300"
- skip_suspected_members="true"/>
- <MPING timeout="4000"
- bind_to_all_interfaces="true"
- mcast_addr="${jboss.messaging.datachanneludpaddress:228.6.6.6}"
- mcast_port="${jboss.messaging.datachanneludpport:45567}"
- ip_ttl="8"
- num_initial_members="2"
- num_ping_requests="1"/>
- <MERGE2 max_interval="100000"
- down_thread="false" up_thread="false" min_interval="20000"/>
- <FD_SOCK down_thread="false" up_thread="false"/>
- <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
- <pbcast.NAKACK max_xmit_size="60000"
- use_mcast_xmit="false" gc_lag="0"
- retransmit_timeout="300,600,1200,2400,4800"
- down_thread="false" up_thread="false"
- discard_delivered_msgs="true"/>
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
- down_thread="false" up_thread="false"
- max_bytes="400000"/>
- <pbcast.GMS print_local_addr="true" join_timeout="3000"
- down_thread="false" up_thread="false"
- join_retry_timeout="2000" shun="false"
- view_bundling="true"/>
- </config>
- </attribute>
-
- <!-- JGroups stack configuration to use for the control channel - used for control messages -->
-
- <!-- We use udp stack for the control channel -->
- <attribute name="ControlChannelConfig">
- <config>
- <UDP
- mcast_addr="${jboss.messaging.controlchanneludpaddress:228.7.7.7}"
- mcast_port="${jboss.messaging.controlchanneludpport:45568}"
- tos="8"
- ucast_recv_buf_size="20000000"
- ucast_send_buf_size="640000"
- mcast_recv_buf_size="25000000"
- mcast_send_buf_size="640000"
- loopback="false"
- discard_incompatible_packets="true"
- max_bundle_size="64000"
- max_bundle_timeout="30"
- use_incoming_packet_handler="true"
- use_outgoing_packet_handler="false"
- ip_ttl="2"
- down_thread="false" up_thread="false"
- enable_bundling="false"/>
- <PING timeout="2000"
- down_thread="false" up_thread="false" num_initial_members="3"/>
- <MERGE2 max_interval="100000"
- down_thread="false" up_thread="false" min_interval="20000"/>
- <FD_SOCK down_thread="false" up_thread="false"/>
- <FD timeout="10000" max_tries="5" down_thread="false" up_thread="false" shun="true"/>
- <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
- <pbcast.NAKACK max_xmit_size="60000"
- use_mcast_xmit="false" gc_lag="0"
- retransmit_timeout="300,600,1200,2400,4800"
- down_thread="false" up_thread="false"
- discard_delivered_msgs="true"/>
- <UNICAST timeout="300,600,1200,2400,3600"
- down_thread="false" up_thread="false"/>
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
- down_thread="false" up_thread="false"
- max_bytes="400000"/>
- <pbcast.GMS print_local_addr="true" join_timeout="3000" use_flush="true" flush_timeout="3000"
- down_thread="false" up_thread="false"
- join_retry_timeout="2000" shun="false"
- view_bundling="true"/>
- <FRAG2 frag_size="60000" down_thread="false" up_thread="false"/>
- <pbcast.STATE_TRANSFER down_thread="false" up_thread="false" use_flush="true" flush_timeout="3000"/>
- <pbcast.FLUSH down_thread="false" up_thread="false" timeout="20000" auto_flush_conf="false"/>
- </config>
- </attribute>
-
- </mbean>
-
- <!-- Messaging JMS User Manager MBean config
- ======================================= -->
-
- <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
- name="jboss.messaging:service=JMSUserManager"
- xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
- <attribute name="DataSource">java:/DefaultDS</attribute>
- <attribute name="CreateTablesOnStartup">true</attribute>
- <attribute name="SqlProperties"><![CDATA[
-CREATE_USER_TABLE=CREATE TABLE JBM_USER (USER_ID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, CLIENTID VARCHAR(128), PRIMARY KEY(USER_ID)) ENGINE = INNODB
-CREATE_ROLE_TABLE=CREATE TABLE JBM_ROLE (ROLE_ID VARCHAR(32) NOT NULL, USER_ID VARCHAR(32) NOT NULL, PRIMARY KEY(USER_ID, ROLE_ID)) ENGINE = INNODB
-SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JBM_USER WHERE USER_ID=?
-POPULATE.TABLES.1=INSERT INTO JBM_USER (USER_ID,PASSWD,CLIENTID) VALUES ('dilbert','dogbert','dilbert-id')
- ]]></attribute>
- </mbean>
-
-</server>
Deleted: branches/Branch_MC_Integration_New/src/etc/server/default/deploy/mysqlcluster-persistence-service.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/default/deploy/mysqlcluster-persistence-service.xml 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/etc/server/default/deploy/mysqlcluster-persistence-service.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -1,257 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- MySql persistence deployment descriptor.
-
- Tested with MySQL 4.1.22
-
- $Id$
- -->
-
-<server>
-
- <!-- Persistence Manager MBean configuration
- ======================================== -->
-
- <mbean code="org.jboss.messaging.core.jmx.JDBCPersistenceManagerService"
- name="jboss.messaging:service=PersistenceManager"
- xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml">
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <!-- The datasource to use for the persistence manager -->
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <!-- If true will attempt to create tables and indexes on every start-up -->
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <!-- If true then will use JDBC batch updates -->
-
- <attribute name="UsingBatchUpdates">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
- CREATE_DUAL=CREATE TABLE JBM_DUAL (DUMMY INTEGER, PRIMARY KEY (DUMMY)) ENGINE = NDBCLUSTER
- CREATE_MESSAGE_REFERENCE=CREATE TABLE JBM_MSG_REF (CHANNEL_ID BIGINT, MESSAGE_ID BIGINT, TRANSACTION_ID BIGINT, STATE CHAR(1), ORD BIGINT, PAGE_ORD BIGINT, DELIVERY_COUNT INTEGER, SCHED_DELIVERY BIGINT, PRIMARY KEY(CHANNEL_ID, MESSAGE_ID)) ENGINE = NDBCLUSTER
- CREATE_IDX_MESSAGE_REF_TX=CREATE INDEX JBM_MSG_REF_TX ON JBM_MSG_REF (TRANSACTION_ID)
- CREATE_IDX_MESSAGE_REF_ORD=CREATE INDEX JBM_MSG_REF_ORD ON JBM_MSG_REF (ORD)
- CREATE_IDX_MESSAGE_REF_PAGE_ORD=CREATE INDEX JBM_MSG_REF_PAGE_ORD ON JBM_MSG_REF (PAGE_ORD)
- CREATE_IDX_MESSAGE_REF_MESSAGE_ID=CREATE INDEX JBM_MSG_REF_MESSAGE_ID ON JBM_MSG_REF (MESSAGE_ID)
- CREATE_IDX_MESSAGE_REF_SCHED_DELIVERY=CREATE INDEX JBM_MSG_REF_SCHED_DELIVERY ON JBM_MSG_REF (SCHED_DELIVERY)
- CREATE_MESSAGE=CREATE TABLE JBM_MSG (MESSAGE_ID BIGINT, RELIABLE CHAR(1), EXPIRATION BIGINT, TIMESTAMP BIGINT, PRIORITY TINYINT, TYPE TINYINT, INS_TIME BIGINT, HEADERS MEDIUMBLOB, PAYLOAD LONGBLOB, PRIMARY KEY (MESSAGE_ID)) ENGINE = NDBCLUSTER
- CREATE_IDX_MESSAGE_TIMESTAMP=CREATE INDEX JBM_MSG_REF_TIMESTAMP ON JBM_MSG (TIMESTAMP)
- CREATE_TRANSACTION=CREATE TABLE JBM_TX (NODE_ID INTEGER, TRANSACTION_ID BIGINT, BRANCH_QUAL VARBINARY(254), FORMAT_ID INTEGER, GLOBAL_TXID VARBINARY(254), PRIMARY KEY (TRANSACTION_ID)) ENGINE = NDBCLUSTER
- CREATE_COUNTER=CREATE TABLE JBM_COUNTER (NAME VARCHAR(255), NEXT_ID BIGINT, PRIMARY KEY(NAME)) ENGINE = NDBCLUSTER
- INSERT_DUAL=INSERT INTO JBM_DUAL VALUES (1)
- CHECK_DUAL=SELECT 1 FROM JBM_DUAL
- INSERT_MESSAGE_REF=INSERT INTO JBM_MSG_REF (CHANNEL_ID, MESSAGE_ID, TRANSACTION_ID, STATE, ORD, PAGE_ORD, DELIVERY_COUNT, SCHED_DELIVERY) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
- DELETE_MESSAGE_REF=DELETE FROM JBM_MSG_REF WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
- UPDATE_MESSAGE_REF=UPDATE JBM_MSG_REF SET TRANSACTION_ID=?, STATE='-' WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
- UPDATE_PAGE_ORDER=UPDATE JBM_MSG_REF SET PAGE_ORD = ? WHERE MESSAGE_ID=? AND CHANNEL_ID=?
- COMMIT_MESSAGE_REF1=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='+'
- COMMIT_MESSAGE_REF2=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='-'
- ROLLBACK_MESSAGE_REF1=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='+'
- ROLLBACK_MESSAGE_REF2=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='-'
- LOAD_PAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, PAGE_ORD, SCHED_DELIVERY FROM JBM_MSG_REF WHERE CHANNEL_ID = ? AND PAGE_ORD BETWEEN ? AND ? ORDER BY PAGE_ORD
- LOAD_UNPAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? AND PAGE_ORD IS NULL ORDER BY ORD
- LOAD_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? ORDER BY ORD
- UPDATE_REFS_NOT_PAGED=UPDATE JBM_MSG_REF SET PAGE_ORD = NULL WHERE PAGE_ORD BETWEEN ? AND ? AND CHANNEL_ID=?
- SELECT_MIN_MAX_PAGE_ORD=SELECT MIN(PAGE_ORD), MAX(PAGE_ORD) FROM JBM_MSG_REF WHERE CHANNEL_ID = ?
- SELECT_EXISTS_REF_MESSAGE_ID=SELECT MESSAGE_ID FROM JBM_MSG_REF WHERE MESSAGE_ID = ?
- UPDATE_DELIVERY_COUNT=UPDATE JBM_MSG_REF SET DELIVERY_COUNT = ? WHERE CHANNEL_ID = ? AND MESSAGE_ID = ?
- UPDATE_CHANNEL_ID=UPDATE JBM_MSG_REF SET CHANNEL_ID = ? WHERE CHANNEL_ID = ?
- LOAD_MESSAGES=SELECT MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, HEADERS, PAYLOAD, TYPE FROM JBM_MSG
- INSERT_MESSAGE=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME, HEADERS, PAYLOAD) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
- INSERT_MESSAGE_CONDITIONAL=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INST_TIME) SELECT ?, ?, ?, ?, ?, ?, ? FROM JBM_DUAL WHERE NOT EXISTS (SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ?)
- UPDATE_MESSAGE_4CONDITIONAL=UPDATE JBM_MSG SET HEADERS=?, PAYLOAD=? WHERE MESSAGE_ID=?
- INSERT_MESSAGE_CONDITIONAL_FULL=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME, HEADERS, PAYLOAD) SELECT ?, ?, ?, ?, ?, ?, ?, ?, ? FROM JBM_DUAL WHERE NOT EXISTS (SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ?)
- MESSAGE_ID_COLUMN=MESSAGE_ID
- REAP_MESSAGES=DELETE FROM JBM_MSG WHERE INS_TIME < ? AND NOT EXISTS (SELECT * FROM JBM_MSG_REF WHERE JBM_MSG_REF.MESSAGE_ID = JBM_MSG.MESSAGE_ID)
- DELETE_MESSAGE=DELETE FROM JBM_MSG WHERE MESSAGE_ID = ? AND NOT EXISTS (SELECT * FROM JBM_MSG_REF WHERE JBM_MSG_REF.MESSAGE_ID = ?)
- INSERT_TRANSACTION=INSERT INTO JBM_TX (NODE_ID, TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID) VALUES(?, ?, ?, ?, ?)
- DELETE_TRANSACTION=DELETE FROM JBM_TX WHERE NODE_ID = ? AND TRANSACTION_ID = ?
- SELECT_PREPARED_TRANSACTIONS=SELECT TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID FROM JBM_TX WHERE NODE_ID = ?
- SELECT_MESSAGE_ID_FOR_REF=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '+' ORDER BY ORD
- SELECT_MESSAGE_ID_FOR_ACK=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '-' ORDER BY ORD
- UPDATE_COUNTER=UPDATE JBM_COUNTER SET NEXT_ID = ? WHERE NAME=?
- SELECT_COUNTER=SELECT NEXT_ID FROM JBM_COUNTER WHERE NAME=? FOR UPDATE
- INSERT_COUNTER=INSERT INTO JBM_COUNTER (NAME, NEXT_ID) VALUES (?, ?)
- SELECT_ALL_CHANNELS=SELECT DISTINCT(CHANNEL_ID) FROM JBM_MSG_REF
- UPDATE_TX=UPDATE JBM_TX SET NODE_ID=? WHERE NODE_ID=?
- ]]></attribute>
-
- <!-- The maximum number of parameters to include in a prepared statement -->
-
- <attribute name="MaxParams">500</attribute>
-
- </mbean>
-
- <!-- Messaging Post Office MBean configuration
- ========================================= -->
-
- <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
- name="jboss.messaging:service=PostOffice"
- xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml">
-
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <!-- The name of the post office -->
-
- <attribute name="PostOfficeName">JMS post office</attribute>
-
- <!-- The datasource used by the post office to access it's binding information -->
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <!-- If true will attempt to create tables and indexes on every start-up -->
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
-CREATE_POSTOFFICE_TABLE=CREATE TABLE JBM_POSTOFFICE (POSTOFFICE_NAME VARCHAR(255), NODE_ID INTEGER, QUEUE_NAME VARCHAR(255), COND VARCHAR(1023), SELECTOR VARCHAR(1023), CHANNEL_ID BIGINT, CLUSTERED CHAR(1), ALL_NODES CHAR(1), PRIMARY KEY(POSTOFFICE_NAME, NODE_ID, QUEUE_NAME)) ENGINE = NDBCLUSTER
-INSERT_BINDING=INSERT INTO JBM_POSTOFFICE (POSTOFFICE_NAME, NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED, ALL_NODES) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
-DELETE_BINDING=DELETE FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=? AND QUEUE_NAME=?
-LOAD_BINDINGS=SELECT QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED, ALL_NODES FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=?
- ]]></attribute>
-
- <!-- This post office is clustered. If you don't want a clustered post office then set to false -->
-
- <attribute name="Clustered">true</attribute>
-
- <!-- 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 -->
-
- <attribute name="GroupName">${jboss.messaging.groupname:MessagingPostOffice}</attribute>
-
- <!-- Max time to wait for state to arrive when the post office joins the cluster -->
-
- <attribute name="StateTimeout">5000</attribute>
-
- <!-- Max time to wait for a synchronous call to node members using the MessageDispatcher -->
-
- <attribute name="CastTimeout">50000</attribute>
-
- <!-- JGroups stack configuration for the data channel - used for sending data across the cluster -->
-
- <!-- By default we use the TCP stack for data -->
- <attribute name="DataChannelConfig">
- <config>
- <TCP start_port="7900"
- loopback="true"
- recv_buf_size="20000000"
- send_buf_size="640000"
- discard_incompatible_packets="true"
- max_bundle_size="64000"
- max_bundle_timeout="30"
- use_incoming_packet_handler="true"
- use_outgoing_packet_handler="false"
- down_thread="false" up_thread="false"
- enable_bundling="false"
- use_send_queues="false"
- sock_conn_timeout="300"
- skip_suspected_members="true"/>
- <MPING timeout="4000"
- bind_to_all_interfaces="true"
- mcast_addr="${jboss.messaging.datachanneludpaddress:228.6.6.6}"
- mcast_port="${jboss.messaging.datachanneludpport:45567}"
- ip_ttl="8"
- num_initial_members="2"
- num_ping_requests="1"/>
- <MERGE2 max_interval="100000"
- down_thread="false" up_thread="false" min_interval="20000"/>
- <FD_SOCK down_thread="false" up_thread="false"/>
- <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
- <pbcast.NAKACK max_xmit_size="60000"
- use_mcast_xmit="false" gc_lag="0"
- retransmit_timeout="300,600,1200,2400,4800"
- down_thread="false" up_thread="false"
- discard_delivered_msgs="true"/>
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
- down_thread="false" up_thread="false"
- max_bytes="400000"/>
- <pbcast.GMS print_local_addr="true" join_timeout="3000"
- down_thread="false" up_thread="false"
- join_retry_timeout="2000" shun="false"
- view_bundling="true"/>
- </config>
- </attribute>
-
- <!-- JGroups stack configuration to use for the control channel - used for control messages -->
-
- <!-- We use udp stack for the control channel -->
- <attribute name="ControlChannelConfig">
- <config>
- <UDP
- mcast_addr="${jboss.messaging.controlchanneludpaddress:228.7.7.7}"
- mcast_port="${jboss.messaging.controlchanneludpport:45568}"
- tos="8"
- ucast_recv_buf_size="20000000"
- ucast_send_buf_size="640000"
- mcast_recv_buf_size="25000000"
- mcast_send_buf_size="640000"
- loopback="false"
- discard_incompatible_packets="true"
- max_bundle_size="64000"
- max_bundle_timeout="30"
- use_incoming_packet_handler="true"
- use_outgoing_packet_handler="false"
- ip_ttl="2"
- down_thread="false" up_thread="false"
- enable_bundling="false"/>
- <PING timeout="2000"
- down_thread="false" up_thread="false" num_initial_members="3"/>
- <MERGE2 max_interval="100000"
- down_thread="false" up_thread="false" min_interval="20000"/>
- <FD_SOCK down_thread="false" up_thread="false"/>
- <FD timeout="10000" max_tries="5" down_thread="false" up_thread="false" shun="true"/>
- <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
- <pbcast.NAKACK max_xmit_size="60000"
- use_mcast_xmit="false" gc_lag="0"
- retransmit_timeout="300,600,1200,2400,4800"
- down_thread="false" up_thread="false"
- discard_delivered_msgs="true"/>
- <UNICAST timeout="300,600,1200,2400,3600"
- down_thread="false" up_thread="false"/>
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
- down_thread="false" up_thread="false"
- max_bytes="400000"/>
- <pbcast.GMS print_local_addr="true" join_timeout="3000" use_flush="true" flush_timeout="3000"
- down_thread="false" up_thread="false"
- join_retry_timeout="2000" shun="false"
- view_bundling="true"/>
- <FRAG2 frag_size="60000" down_thread="false" up_thread="false"/>
- <pbcast.STATE_TRANSFER down_thread="false" up_thread="false" use_flush="true" flush_timeout="3000"/>
- <pbcast.FLUSH down_thread="false" up_thread="false" timeout="20000" auto_flush_conf="false"/>
- </config>
- </attribute>
-
- </mbean>
-
- <!-- Messaging JMS User Manager MBean config
- ======================================= -->
-
- <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
- name="jboss.messaging:service=JMSUserManager"
- xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
- <attribute name="DataSource">java:/DefaultDS</attribute>
- <attribute name="CreateTablesOnStartup">true</attribute>
- <attribute name="SqlProperties"><![CDATA[
-CREATE_USER_TABLE=CREATE TABLE JBM_USER (USER_ID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, CLIENTID VARCHAR(128), PRIMARY KEY(USER_ID)) ENGINE = NDBCLUSTER
-CREATE_ROLE_TABLE=CREATE TABLE JBM_ROLE (ROLE_ID VARCHAR(32) NOT NULL, USER_ID VARCHAR(32) NOT NULL, PRIMARY KEY(USER_ID, ROLE_ID)) ENGINE = NDBCLUSTER
-SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JBM_USER WHERE USER_ID=?
-POPULATE.TABLES.1=INSERT INTO JBM_USER (USER_ID,PASSWD,CLIENTID) VALUES ('dilbert','dogbert','dilbert-id')
- ]]></attribute>
- </mbean>
-
-</server>
Deleted: branches/Branch_MC_Integration_New/src/etc/server/default/deploy/oracle-persistence-service.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/default/deploy/oracle-persistence-service.xml 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/etc/server/default/deploy/oracle-persistence-service.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -1,265 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Oracle persistence deployment descriptor.
-
- Tested with Oracle 10.1.0.3
-
- $Id$
- -->
-
-<server>
-
- <!-- Persistence Manager MBean configuration
- ======================================== -->
-
- <mbean code="org.jboss.messaging.core.jmx.JDBCPersistenceManagerService"
- name="jboss.messaging:service=PersistenceManager"
- xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml">
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <!-- The datasource to use for the persistence manager -->
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <!-- If true will attempt to create tables and indexes on every start-up -->
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <!-- If true then will use JDBC batch updates -->
-
- <attribute name="UsingBatchUpdates">true</attribute>
-
- <!-- Some databases don't support inserting blobs using INSERT INTO ... SELECT FROM -->
-
- <attribute name="SupportsBlobOnSelect">false</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
- CREATE_DUAL=CREATE TABLE JBM_DUAL (DUMMY INTEGER, PRIMARY KEY (DUMMY))
- CREATE_MESSAGE_REFERENCE=CREATE TABLE JBM_MSG_REF (CHANNEL_ID INTEGER, MESSAGE_ID INTEGER, TRANSACTION_ID INTEGER, STATE CHAR(1), ORD INTEGER, PAGE_ORD INTEGER, DELIVERY_COUNT INTEGER, SCHED_DELIVERY INTEGER, PRIMARY KEY(CHANNEL_ID, MESSAGE_ID))
- CREATE_IDX_MESSAGE_REF_TX=CREATE INDEX JBM_MSG_REF_TX ON JBM_MSG_REF (TRANSACTION_ID)
- CREATE_IDX_MESSAGE_REF_ORD=CREATE INDEX JBM_MSG_REF_ORD ON JBM_MSG_REF (ORD)
- CREATE_IDX_MESSAGE_REF_PAGE_ORD=CREATE INDEX JBM_MSG_REF_PAGE_ORD ON JBM_MSG_REF (PAGE_ORD)
- CREATE_IDX_MESSAGE_REF_MESSAGE_ID=CREATE INDEX JBM_MSG_REF_MESSAGE_ID ON JBM_MSG_REF (MESSAGE_ID)
- CREATE_IDX_MESSAGE_REF_SCHED_DELIVERY=CREATE INDEX JBM_MSG_REF_SCHED_DELIVERY ON JBM_MSG_REF (SCHED_DELIVERY)
- CREATE_MESSAGE=CREATE TABLE JBM_MSG (MESSAGE_ID INTEGER, RELIABLE CHAR(1), EXPIRATION INTEGER, TIMESTAMP INTEGER, PRIORITY INTEGER, TYPE INTEGER, INS_TIME INTEGER, HEADERS BLOB, PAYLOAD BLOB, PRIMARY KEY (MESSAGE_ID))
- CREATE_IDX_MESSAGE_TIMESTAMP=CREATE INDEX JBM_MSG_REF_TIMESTAMP ON JBM_MSG (TIMESTAMP)
- CREATE_TRANSACTION=CREATE TABLE JBM_TX (NODE_ID INTEGER, TRANSACTION_ID INTEGER, BRANCH_QUAL RAW(254), FORMAT_ID INTEGER, GLOBAL_TXID RAW(254), PRIMARY KEY (TRANSACTION_ID))
- CREATE_COUNTER=CREATE TABLE JBM_COUNTER (NAME VARCHAR2(255), NEXT_ID INTEGER, PRIMARY KEY(NAME))
- INSERT_DUAL=INSERT INTO JBM_DUAL VALUES (1)
- CHECK_DUAL=SELECT 1 FROM JBM_DUAL
- INSERT_MESSAGE_REF=INSERT INTO JBM_MSG_REF (CHANNEL_ID, MESSAGE_ID, TRANSACTION_ID, STATE, ORD, PAGE_ORD, DELIVERY_COUNT, SCHED_DELIVERY) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
- DELETE_MESSAGE_REF=DELETE FROM JBM_MSG_REF WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
- UPDATE_MESSAGE_REF=UPDATE JBM_MSG_REF SET TRANSACTION_ID=?, STATE='-' WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
- UPDATE_PAGE_ORDER=UPDATE JBM_MSG_REF SET PAGE_ORD = ? WHERE MESSAGE_ID=? AND CHANNEL_ID=?
- COMMIT_MESSAGE_REF1=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='+'
- COMMIT_MESSAGE_REF2=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='-'
- ROLLBACK_MESSAGE_REF1=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='+'
- ROLLBACK_MESSAGE_REF2=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='-'
- LOAD_PAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, PAGE_ORD, SCHED_DELIVERY FROM JBM_MSG_REF WHERE CHANNEL_ID = ? AND PAGE_ORD BETWEEN ? AND ? ORDER BY PAGE_ORD
- LOAD_UNPAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? AND PAGE_ORD IS NULL ORDER BY ORD
- LOAD_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? ORDER BY ORD
- UPDATE_REFS_NOT_PAGED=UPDATE JBM_MSG_REF SET PAGE_ORD = NULL WHERE PAGE_ORD BETWEEN ? AND ? AND CHANNEL_ID=?
- SELECT_MIN_MAX_PAGE_ORD=SELECT MIN(PAGE_ORD), MAX(PAGE_ORD) FROM JBM_MSG_REF WHERE CHANNEL_ID = ?
- SELECT_EXISTS_REF_MESSAGE_ID=SELECT MESSAGE_ID FROM JBM_MSG_REF WHERE MESSAGE_ID = ?
- UPDATE_DELIVERY_COUNT=UPDATE JBM_MSG_REF SET DELIVERY_COUNT = ? WHERE CHANNEL_ID = ? AND MESSAGE_ID = ?
- UPDATE_CHANNEL_ID=UPDATE JBM_MSG_REF SET CHANNEL_ID = ? WHERE CHANNEL_ID = ?
- LOAD_MESSAGES=SELECT MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, HEADERS, PAYLOAD, TYPE FROM JBM_MSG
- INSERT_MESSAGE=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME, HEADERS, PAYLOAD) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
- INSERT_MESSAGE_CONDITIONAL=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME) SELECT ?, ?, ?, ?, ?, ?, ? FROM JBM_DUAL WHERE NOT EXISTS (SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ?)
- UPDATE_MESSAGE_4CONDITIONAL=UPDATE JBM_MSG SET HEADERS=?, PAYLOAD=? WHERE MESSAGE_ID=?
- INSERT_MESSAGE_CONDITIONAL_FULL=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME, HEADERS, PAYLOAD) SELECT ?, ?, ?, ?, ?, ?, ?, ?, ? FROM JBM_DUAL WHERE NOT EXISTS (SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ?)
- MESSAGE_ID_COLUMN=MESSAGE_ID
- REAP_MESSAGES=DELETE FROM JBM_MSG WHERE INS_TIME < ? AND NOT EXISTS (SELECT * FROM JBM_MSG_REF WHERE JBM_MSG_REF.MESSAGE_ID = JBM_MSG.MESSAGE_ID)
- DELETE_MESSAGE=DELETE FROM JBM_MSG WHERE MESSAGE_ID = ? AND NOT EXISTS (SELECT * FROM JBM_MSG_REF WHERE JBM_MSG_REF.MESSAGE_ID = ?)
- INSERT_TRANSACTION=INSERT INTO JBM_TX (NODE_ID, TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID) VALUES(?, ?, ?, ?, ?)
- DELETE_TRANSACTION=DELETE FROM JBM_TX WHERE NODE_ID = ? AND TRANSACTION_ID = ?
- SELECT_PREPARED_TRANSACTIONS=SELECT TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID FROM JBM_TX WHERE NODE_ID = ?
- SELECT_MESSAGE_ID_FOR_REF=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '+' ORDER BY ORD
- SELECT_MESSAGE_ID_FOR_ACK=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '-' ORDER BY ORD
- UPDATE_COUNTER=UPDATE JBM_COUNTER SET NEXT_ID = ? WHERE NAME=?
- SELECT_COUNTER=SELECT NEXT_ID FROM JBM_COUNTER WHERE NAME=? FOR UPDATE
- INSERT_COUNTER=INSERT INTO JBM_COUNTER (NAME, NEXT_ID) VALUES (?, ?)
- SELECT_ALL_CHANNELS=SELECT DISTINCT(CHANNEL_ID) FROM JBM_MSG_REF
- UPDATE_TX=UPDATE JBM_TX SET NODE_ID=? WHERE NODE_ID=?
- ]]></attribute>
-
- <!-- The maximum number of parameters to include in a prepared statement -->
-
- <attribute name="MaxParams">500</attribute>
-
- </mbean>
-
- <!-- Messaging Post Office MBean configuration
- ========================================= -->
-
- <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
- name="jboss.messaging:service=PostOffice"
- xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml">
-
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <!-- The name of the post office -->
-
- <attribute name="PostOfficeName">JMS post office</attribute>
-
- <!-- The datasource used by the post office to access it's binding information -->
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <!-- If true will attempt to create tables and indexes on every start-up -->
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
-CREATE_POSTOFFICE_TABLE=CREATE TABLE JBM_POSTOFFICE (POSTOFFICE_NAME VARCHAR2(255), NODE_ID INTEGER, QUEUE_NAME VARCHAR2(255), COND VARCHAR2(1023), SELECTOR VARCHAR2(1023), CHANNEL_ID INTEGER, CLUSTERED CHAR(1), ALL_NODES CHAR(1), PRIMARY KEY(POSTOFFICE_NAME, NODE_ID, QUEUE_NAME))
-INSERT_BINDING=INSERT INTO JBM_POSTOFFICE (POSTOFFICE_NAME, NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED, ALL_NODES) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
-DELETE_BINDING=DELETE FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=? AND QUEUE_NAME=?
-LOAD_BINDINGS=SELECT QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED, ALL_NODES FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=?
- ]]></attribute>
-
- <!-- This post office is clustered. If you don't want a clustered post office then set to false -->
-
- <attribute name="Clustered">true</attribute>
-
- <!-- 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 -->
-
- <attribute name="GroupName">${jboss.messaging.groupname:MessagingPostOffice}</attribute>
-
- <!-- Max time to wait for state to arrive when the post office joins the cluster -->
-
- <attribute name="StateTimeout">5000</attribute>
-
- <!-- Max time to wait for a synchronous call to node members using the MessageDispatcher -->
-
- <attribute name="CastTimeout">5000</attribute>
-
- <!-- JGroups stack configuration for the data channel - used for sending data across the cluster -->
-
- <!-- By default we use the TCP stack for data -->
- <attribute name="DataChannelConfig">
- <config>
- <TCP start_port="7900"
- loopback="true"
- recv_buf_size="20000000"
- send_buf_size="640000"
- discard_incompatible_packets="true"
- max_bundle_size="64000"
- max_bundle_timeout="30"
- use_incoming_packet_handler="true"
- use_outgoing_packet_handler="false"
- down_thread="false" up_thread="false"
- enable_bundling="false"
- use_send_queues="false"
- sock_conn_timeout="300"
- skip_suspected_members="true"/>
- <MPING timeout="4000"
- bind_to_all_interfaces="true"
- mcast_addr="${jboss.messaging.datachanneludpaddress:228.6.6.6}"
- mcast_port="${jboss.messaging.datachanneludpport:45567}"
- ip_ttl="8"
- num_initial_members="2"
- num_ping_requests="1"/>
- <MERGE2 max_interval="100000"
- down_thread="false" up_thread="false" min_interval="20000"/>
- <FD_SOCK down_thread="false" up_thread="false"/>
- <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
- <pbcast.NAKACK max_xmit_size="60000"
- use_mcast_xmit="false" gc_lag="0"
- retransmit_timeout="300,600,1200,2400,4800"
- down_thread="false" up_thread="false"
- discard_delivered_msgs="true"/>
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
- down_thread="false" up_thread="false"
- max_bytes="400000"/>
- <pbcast.GMS print_local_addr="true" join_timeout="3000"
- down_thread="false" up_thread="false"
- join_retry_timeout="2000" shun="false"
- view_bundling="true"/>
- </config>
- </attribute>
-
- <!-- JGroups stack configuration to use for the control channel - used for control messages -->
-
- <!-- We use udp stack for the control channel -->
- <attribute name="ControlChannelConfig">
- <config>
- <UDP
- mcast_addr="${jboss.messaging.controlchanneludpaddress:228.7.7.7}"
- mcast_port="${jboss.messaging.controlchanneludpport:45568}"
- tos="8"
- ucast_recv_buf_size="20000000"
- ucast_send_buf_size="640000"
- mcast_recv_buf_size="25000000"
- mcast_send_buf_size="640000"
- loopback="false"
- discard_incompatible_packets="true"
- max_bundle_size="64000"
- max_bundle_timeout="30"
- use_incoming_packet_handler="true"
- use_outgoing_packet_handler="false"
- ip_ttl="2"
- down_thread="false" up_thread="false"
- enable_bundling="false"/>
- <PING timeout="2000"
- down_thread="false" up_thread="false" num_initial_members="3"/>
- <MERGE2 max_interval="100000"
- down_thread="false" up_thread="false" min_interval="20000"/>
- <FD_SOCK down_thread="false" up_thread="false"/>
- <FD timeout="10000" max_tries="5" down_thread="false" up_thread="false" shun="true"/>
- <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
- <pbcast.NAKACK max_xmit_size="60000"
- use_mcast_xmit="false" gc_lag="0"
- retransmit_timeout="300,600,1200,2400,4800"
- down_thread="false" up_thread="false"
- discard_delivered_msgs="true"/>
- <UNICAST timeout="300,600,1200,2400,3600"
- down_thread="false" up_thread="false"/>
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
- down_thread="false" up_thread="false"
- max_bytes="400000"/>
- <pbcast.GMS print_local_addr="true" join_timeout="3000" use_flush="true" flush_timeout="3000"
- down_thread="false" up_thread="false"
- join_retry_timeout="2000" shun="false"
- view_bundling="true"/>
- <FRAG2 frag_size="60000" down_thread="false" up_thread="false"/>
- <pbcast.STATE_TRANSFER down_thread="false" up_thread="false" use_flush="true" flush_timeout="3000"/>
- <pbcast.FLUSH down_thread="false" up_thread="false" timeout="20000" auto_flush_conf="false"/>
- </config>
- </attribute>
- </mbean>
-
- <!-- Messaging JMS User Manager MBean config
- ======================================= -->
-
- <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
- name="jboss.messaging:service=JMSUserManager"
- xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
-CREATE_USER_TABLE=CREATE TABLE JBM_USER (USER_ID VARCHAR2(32) NOT NULL, PASSWD VARCHAR2(32) NOT NULL, CLIENTID VARCHAR2(128), PRIMARY KEY(USER_ID))
-CREATE_ROLE_TABLE=CREATE TABLE JBM_ROLE (ROLE_ID VARCHAR2(32) NOT NULL, USER_ID VARCHAR2(32) NOT NULL, PRIMARY KEY(USER_ID, ROLE_ID))
-SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JBM_USER WHERE USER_ID=?
-POPULATE.TABLES.1=INSERT INTO JBM_USER (USER_ID,PASSWD,CLIENTID) VALUES ('dilbert','dogbert','dilbert-id')
- ]]></attribute>
- </mbean>
-
-</server>
Deleted: branches/Branch_MC_Integration_New/src/etc/server/default/deploy/postgresql-persistence-service.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/default/deploy/postgresql-persistence-service.xml 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/etc/server/default/deploy/postgresql-persistence-service.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -1,267 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Postgresql persistence deployment descriptor.
-
- Tested with PostgresSQL 8.1.5
-
- $Id$
- -->
-
-<server>
-
- <!-- Persistence Manager MBean configuration
- ======================================== -->
-
- <mbean code="org.jboss.messaging.core.jmx.JDBCPersistenceManagerService"
- name="jboss.messaging:service=PersistenceManager"
- xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml">
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <!-- The datasource to use for the persistence manager -->
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <!-- If true will attempt to create tables and indexes on every start-up -->
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <!-- If true then will use JDBC batch updates -->
-
- <attribute name="UsingBatchUpdates">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
- CREATE_DUAL=CREATE TABLE JBM_DUAL (DUMMY INTEGER, PRIMARY KEY (DUMMY))
- CREATE_MESSAGE_REFERENCE=CREATE TABLE JBM_MSG_REF (CHANNEL_ID BIGINT, MESSAGE_ID BIGINT, TRANSACTION_ID BIGINT, STATE CHAR(1), ORD BIGINT, PAGE_ORD BIGINT, DELIVERY_COUNT INTEGER, SCHED_DELIVERY BIGINT, PRIMARY KEY(CHANNEL_ID, MESSAGE_ID))
- CREATE_IDX_MESSAGE_REF_TX=CREATE INDEX JBM_MSG_REF_TX ON JBM_MSG_REF (TRANSACTION_ID)
- CREATE_IDX_MESSAGE_REF_ORD=CREATE INDEX JBM_MSG_REF_ORD ON JBM_MSG_REF (ORD)
- CREATE_IDX_MESSAGE_REF_PAGE_ORD=CREATE INDEX JBM_MSG_REF_PAGE_ORD ON JBM_MSG_REF (PAGE_ORD)
- CREATE_IDX_MESSAGE_REF_MESSAGE_ID=CREATE INDEX JBM_MSG_REF_MESSAGE_ID ON JBM_MSG_REF (MESSAGE_ID)
- CREATE_IDX_MESSAGE_REF_SCHED_DELIVERY=CREATE INDEX JBM_MSG_REF_SCHED_DELIVERY ON JBM_MSG_REF (SCHED_DELIVERY)
- CREATE_MESSAGE=CREATE TABLE JBM_MSG (MESSAGE_ID BIGINT, RELIABLE CHAR(1), EXPIRATION BIGINT, TIMESTAMP BIGINT, PRIORITY SMALLINT, TYPE SMALLINT, INS_TIME BIGINT, HEADERS BYTEA, PAYLOAD BYTEA, PRIMARY KEY (MESSAGE_ID))
- CREATE_IDX_MESSAGE_TIMESTAMP=CREATE INDEX JBM_MSG_REF_TIMESTAMP ON JBM_MSG (TIMESTAMP)
- CREATE_TRANSACTION=CREATE TABLE JBM_TX (NODE_ID INTEGER, TRANSACTION_ID BIGINT, BRANCH_QUAL BYTEA, FORMAT_ID INTEGER, GLOBAL_TXID BYTEA, PRIMARY KEY (TRANSACTION_ID))
- CREATE_COUNTER=CREATE TABLE JBM_COUNTER (NAME VARCHAR(255), NEXT_ID BIGINT, PRIMARY KEY(NAME))
- INSERT_DUAL=INSERT INTO JBM_DUAL VALUES (1)
- CHECK_DUAL=SELECT 1 FROM JBM_DUAL
- INSERT_MESSAGE_REF=INSERT INTO JBM_MSG_REF (CHANNEL_ID, MESSAGE_ID, TRANSACTION_ID, STATE, ORD, PAGE_ORD, DELIVERY_COUNT, SCHED_DELIVERY) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
- DELETE_MESSAGE_REF=DELETE FROM JBM_MSG_REF WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
- UPDATE_MESSAGE_REF=UPDATE JBM_MSG_REF SET TRANSACTION_ID=?, STATE='-' WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
- UPDATE_PAGE_ORDER=UPDATE JBM_MSG_REF SET PAGE_ORD = ? WHERE MESSAGE_ID=? AND CHANNEL_ID=?
- COMMIT_MESSAGE_REF1=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='+'
- COMMIT_MESSAGE_REF2=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='-'
- ROLLBACK_MESSAGE_REF1=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='+'
- ROLLBACK_MESSAGE_REF2=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='-'
- LOAD_PAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, PAGE_ORD, SCHED_DELIVERY FROM JBM_MSG_REF WHERE CHANNEL_ID = ? AND PAGE_ORD BETWEEN ? AND ? ORDER BY PAGE_ORD
- LOAD_UNPAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? AND PAGE_ORD IS NULL ORDER BY ORD
- LOAD_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? ORDER BY ORD
- UPDATE_REFS_NOT_PAGED=UPDATE JBM_MSG_REF SET PAGE_ORD = NULL WHERE PAGE_ORD BETWEEN ? AND ? AND CHANNEL_ID=?
- SELECT_MIN_MAX_PAGE_ORD=SELECT MIN(PAGE_ORD), MAX(PAGE_ORD) FROM JBM_MSG_REF WHERE CHANNEL_ID = ?
- SELECT_EXISTS_REF_MESSAGE_ID=SELECT MESSAGE_ID FROM JBM_MSG_REF WHERE MESSAGE_ID = ?
- UPDATE_DELIVERY_COUNT=UPDATE JBM_MSG_REF SET DELIVERY_COUNT = ? WHERE CHANNEL_ID = ? AND MESSAGE_ID = ?
- UPDATE_CHANNEL_ID=UPDATE JBM_MSG_REF SET CHANNEL_ID = ? WHERE CHANNEL_ID = ?
- LOAD_MESSAGES=SELECT MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, HEADERS, PAYLOAD, TYPE FROM JBM_MSG
- INSERT_MESSAGE=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME, HEADERS, PAYLOAD) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
- INSERT_MESSAGE_CONDITIONAL=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME) SELECT ?, ?, ?, ?, ?, ?, ? FROM JBM_DUAL WHERE NOT EXISTS (SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ?)
- UPDATE_MESSAGE_4CONDITIONAL=UPDATE JBM_MSG SET HEADERS=?, PAYLOAD=? WHERE MESSAGE_ID=?
- INSERT_MESSAGE_CONDITIONAL_FULL=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME, HEADERS, PAYLOAD) SELECT ?, ?, ?, ?, ?, ?, ?, ?, ? FROM JBM_DUAL WHERE NOT EXISTS (SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ?)
- MESSAGE_ID_COLUMN=MESSAGE_ID
- REAP_MESSAGES=DELETE FROM JBM_MSG WHERE INS_TIME < ? AND NOT EXISTS (SELECT * FROM JBM_MSG_REF WHERE JBM_MSG_REF.MESSAGE_ID = JBM_MSG.MESSAGE_ID)
- DELETE_MESSAGE=DELETE FROM JBM_MSG WHERE MESSAGE_ID = ? AND NOT EXISTS (SELECT * FROM JBM_MSG_REF WHERE JBM_MSG_REF.MESSAGE_ID = ?)
- INSERT_TRANSACTION=INSERT INTO JBM_TX (NODE_ID, TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID) VALUES(?, ?, ?, ?, ?)
- DELETE_TRANSACTION=DELETE FROM JBM_TX WHERE NODE_ID = ? AND TRANSACTION_ID = ?
- SELECT_PREPARED_TRANSACTIONS=SELECT TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID FROM JBM_TX WHERE NODE_ID = ?
- SELECT_MESSAGE_ID_FOR_REF=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '+' ORDER BY ORD
- SELECT_MESSAGE_ID_FOR_ACK=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '-' ORDER BY ORD
- UPDATE_COUNTER=UPDATE JBM_COUNTER SET NEXT_ID = ? WHERE NAME=?
- SELECT_COUNTER=SELECT NEXT_ID FROM JBM_COUNTER WHERE NAME=? FOR UPDATE
- INSERT_COUNTER=INSERT INTO JBM_COUNTER (NAME, NEXT_ID) VALUES (?, ?)
- SELECT_ALL_CHANNELS=SELECT DISTINCT(CHANNEL_ID) FROM JBM_MSG_REF
- UPDATE_TX=UPDATE JBM_TX SET NODE_ID=? WHERE NODE_ID=?
- ]]></attribute>
-
- <!-- The maximum number of parameters to include in a prepared statement -->
-
- <attribute name="MaxParams">500</attribute>
-
- </mbean>
-
- <!-- Messaging Post Office MBean configuration
- ========================================= -->
-
- <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
- name="jboss.messaging:service=PostOffice"
- xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml">
-
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <!-- The name of the post office -->
-
- <attribute name="PostOfficeName">JMS post office</attribute>
-
- <!-- The datasource used by the post office to access it's binding information -->
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <!-- If true will attempt to create tables and indexes on every start-up -->
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
-CREATE_POSTOFFICE_TABLE=CREATE TABLE JBM_POSTOFFICE (POSTOFFICE_NAME VARCHAR(255), NODE_ID INTEGER, QUEUE_NAME VARCHAR(255), COND VARCHAR(1023), SELECTOR VARCHAR(1023), CHANNEL_ID BIGINT, CLUSTERED CHAR(1), ALL_NODES CHAR(1), PRIMARY KEY(POSTOFFICE_NAME, NODE_ID, QUEUE_NAME))
-INSERT_BINDING=INSERT INTO JBM_POSTOFFICE (POSTOFFICE_NAME, NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED, ALL_NODES) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
-DELETE_BINDING=DELETE FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=? AND QUEUE_NAME=?
-LOAD_BINDINGS=SELECT QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED, ALL_NODES FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=?
- ]]></attribute>
-
- <!-- This post office is clustered. If you don't want a clustered post office then set to false -->
-
- <attribute name="Clustered">true</attribute>
-
- <!-- 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 -->
-
- <attribute name="GroupName">${jboss.messaging.groupname:MessagingPostOffice}</attribute>
-
- <!-- Max time to wait for state to arrive when the post office joins the cluster -->
-
- <attribute name="StateTimeout">5000</attribute>
-
- <!-- Max time to wait for a synchronous call to node members using the MessageDispatcher -->
-
- <attribute name="CastTimeout">5000</attribute>
-
- <!-- Max number of concurrent replications -->
-
- <attribute name="MaxConcurrentReplications">50</attribute>
-
- <!--
- <attribute name="ChannelFactoryName">jgroups.mux:name=Multiplexer</attribute>
- <attribute name="ControlChannelName">udp-sync</attribute>
- <attribute name="DataChannelName">udp</attribute>
- <attribute name="ChannelPartitionName">${jboss.partition.name:DefaultPartition}-JMS</attribute>
- -->
-
- <!-- JGroups stack configuration for the data channel - used for sending data across the cluster -->
-
- <!-- By default we use the TCP stack for data -->
- <attribute name="DataChannelConfig">
- <config>
- <TCP start_port="7900"
- loopback="true"
- recv_buf_size="20000000"
- send_buf_size="640000"
- discard_incompatible_packets="true"
- max_bundle_size="64000"
- max_bundle_timeout="30"
- use_incoming_packet_handler="true"
- use_outgoing_packet_handler="false"
- down_thread="false" up_thread="false"
- enable_bundling="false"
- use_send_queues="false"
- sock_conn_timeout="300"
- skip_suspected_members="true"/>
- <MPING timeout="4000"
- bind_to_all_interfaces="true"
- mcast_addr="${jboss.messaging.datachanneludpaddress:228.6.6.6}"
- mcast_port="${jboss.messaging.datachanneludpport:45567}"
- ip_ttl="8"
- num_initial_members="2"
- num_ping_requests="1"/>
- <MERGE2 max_interval="100000"
- down_thread="false" up_thread="false" min_interval="20000"/>
- <FD_SOCK down_thread="false" up_thread="false"/>
- <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
- <pbcast.NAKACK max_xmit_size="60000"
- use_mcast_xmit="false" gc_lag="0"
- retransmit_timeout="300,600,1200,2400,4800"
- down_thread="false" up_thread="false"
- discard_delivered_msgs="true"/>
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
- down_thread="false" up_thread="false"
- max_bytes="400000"/>
- <pbcast.GMS print_local_addr="true" join_timeout="3000"
- down_thread="false" up_thread="false"
- join_retry_timeout="2000" shun="false"
- view_bundling="true"/>
- </config>
- </attribute>
-
- <!-- JGroups stack configuration to use for the control channel - used for control messages -->
-
- <!-- We use udp stack for the control channel -->
- <attribute name="ControlChannelConfig">
- <config>
- <UDP
- mcast_addr="${jboss.messaging.controlchanneludpaddress:228.7.7.7}"
- mcast_port="${jboss.messaging.controlchanneludpport:45568}"
- tos="8"
- ucast_recv_buf_size="20000000"
- ucast_send_buf_size="640000"
- mcast_recv_buf_size="25000000"
- mcast_send_buf_size="640000"
- loopback="false"
- discard_incompatible_packets="true"
- max_bundle_size="64000"
- max_bundle_timeout="30"
- use_incoming_packet_handler="true"
- use_outgoing_packet_handler="false"
- ip_ttl="2"
- down_thread="false" up_thread="false"
- enable_bundling="false"/>
- <PING timeout="2000"
- down_thread="false" up_thread="false" num_initial_members="3"/>
- <MERGE2 max_interval="100000"
- down_thread="false" up_thread="false" min_interval="20000"/>
- <FD_SOCK down_thread="false" up_thread="false"/>
- <FD timeout="10000" max_tries="5" down_thread="false" up_thread="false" shun="true"/>
- <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
- <pbcast.NAKACK max_xmit_size="60000"
- use_mcast_xmit="false" gc_lag="0"
- retransmit_timeout="300,600,1200,2400,4800"
- down_thread="false" up_thread="false"
- discard_delivered_msgs="true"/>
- <UNICAST timeout="300,600,1200,2400,3600"
- down_thread="false" up_thread="false"/>
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
- down_thread="false" up_thread="false"
- max_bytes="400000"/>
- <pbcast.GMS print_local_addr="true" join_timeout="3000" use_flush="true" flush_timeout="3000"
- down_thread="false" up_thread="false"
- join_retry_timeout="2000" shun="false"
- view_bundling="true"/>
- <FRAG2 frag_size="60000" down_thread="false" up_thread="false"/>
- <pbcast.STATE_TRANSFER down_thread="false" up_thread="false" use_flush="true" flush_timeout="3000"/>
- <pbcast.FLUSH down_thread="false" up_thread="false" timeout="20000" auto_flush_conf="false"/>
- </config>
- </attribute>
- </mbean>
-
- <!-- Messaging JMS User Manager MBean config
- ======================================= -->
-
- <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
- name="jboss.messaging:service=JMSUserManager"
- xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
- <attribute name="DataSource">java:/DefaultDS</attribute>
- <attribute name="CreateTablesOnStartup">true</attribute>
- <attribute name="SqlProperties"><![CDATA[
-CREATE_USER_TABLE=CREATE TABLE JBM_USER (USER_ID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, CLIENTID VARCHAR(128), PRIMARY KEY(USER_ID))
-CREATE_ROLE_TABLE=CREATE TABLE JBM_ROLE (ROLE_ID VARCHAR(32) NOT NULL, USER_ID VARCHAR(32) NOT NULL, PRIMARY KEY(USER_ID, ROLE_ID))
-SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JBM_USER WHERE USER_ID=?
-POPULATE.TABLES.1=INSERT INTO JBM_USER (USER_ID,PASSWD,CLIENTID) VALUES ('dilbert','dogbert','dilbert-id')
- ]]></attribute>
- </mbean>
-
-</server>
\ No newline at end of file
Deleted: branches/Branch_MC_Integration_New/src/etc/server/default/deploy/sybase-persistence-service.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/default/deploy/sybase-persistence-service.xml 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/etc/server/default/deploy/sybase-persistence-service.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -1,261 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Sybase persistence deployment descriptor.
-
- Tested with Sybase Adaptive Server Enterprise 12.5.2
-
- $Id$
- -->
-
-<server>
-
- <!-- Persistence Manager MBean configuration
- ======================================== -->
-
- <mbean code="org.jboss.messaging.core.jmx.JDBCPersistenceManagerService"
- name="jboss.messaging:service=PersistenceManager"
- xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml">
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <!-- The datasource to use for the persistence manager -->
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <!-- If true will attempt to create tables and indexes on every start-up -->
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <!-- If true then will use JDBC batch updates -->
-
- <attribute name="UsingBatchUpdates">true</attribute>
-
- <!-- If true then will add a trailing byte to all byte arrays otherwise Sybase truncates them
- Only known to be necessary for Sybase -->
-
- <attribute name="UsingTrailingByte">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
- CREATE_DUAL=CREATE TABLE JBM_DUAL (DUAL_DUMMY INTEGER, PRIMARY KEY (DUAL_DUMMY))
- CREATE_MESSAGE_REFERENCE=CREATE TABLE JBM_MSG_REF (CHANNEL_ID DECIMAL(19, 0), MESSAGE_ID DECIMAL(19, 0), TRANSACTION_ID DECIMAL(19, 0) NULL, STATE CHAR(1), ORD DECIMAL(19, 0), PAGE_ORD DECIMAL(19, 0) NULL, DELIVERY_COUNT INTEGER, SCHED_DELIVERY DECIMAL(19, 0), PRIMARY KEY(CHANNEL_ID, MESSAGE_ID))
- CREATE_IDX_MESSAGE_REF_TX=CREATE INDEX JBM_MSG_REF_TX ON JBM_MSG_REF (TRANSACTION_ID)
- CREATE_IDX_MESSAGE_REF_ORD=CREATE INDEX JBM_MSG_REF_ORD ON JBM_MSG_REF (ORD)
- CREATE_IDX_MESSAGE_REF_PAGE_ORD=CREATE INDEX JBM_MSG_REF_PAGE_ORD ON JBM_MSG_REF (PAGE_ORD)
- CREATE_IDX_MESSAGE_REF_MESSAGE_ID=CREATE INDEX JBM_MSG_REF_MESSAGE_ID ON JBM_MSG_REF (MESSAGE_ID)
- CREATE_IDX_MESSAGE_REF_SCHED_DELIVERY=CREATE INDEX JBM_MSG_REF_SCHED_DELIVERY ON JBM_MSG_REF (SCHED_DELIVERY)
- CREATE_MESSAGE=CREATE TABLE JBM_MSG (MESSAGE_ID DECIMAL(19, 0), RELIABLE CHAR(1), EXPIRATION DECIMAL(19, 0), TIMESTAMP DECIMAL(19, 0), PRIORITY TINYINT, TYPE TINYINT, INS_TIME DECIMAL(19, 0), HEADERS IMAGE NULL, PAYLOAD IMAGE NULL, PRIMARY KEY (MESSAGE_ID))
- CREATE_IDX_MESSAGE_TIMESTAMP=CREATE INDEX JBM_MSG_REF_TIMESTAMP ON JBM_MSG (TIMESTAMP)
- CREATE_TRANSACTION=CREATE TABLE JBM_TX (NODE_ID INTEGER, TRANSACTION_ID DECIMAL(19, 0), BRANCH_QUAL VARBINARY(254) NULL, FORMAT_ID INTEGER NULL, GLOBAL_TXID VARBINARY(254) NULL, PRIMARY KEY (TRANSACTION_ID))
- CREATE_COUNTER=CREATE TABLE JBM_COUNTER (NAME VARCHAR(255), NEXT_ID DECIMAL(19, 0), PRIMARY KEY(NAME))
- INSERT_DUAL=INSERT INTO JBM_DUAL VALUES (1)
- CHECK_DUAL=SELECT 1 FROM JBM_DUAL
- INSERT_MESSAGE_REF=INSERT INTO JBM_MSG_REF (CHANNEL_ID, MESSAGE_ID, TRANSACTION_ID, STATE, ORD, PAGE_ORD, DELIVERY_COUNT, SCHED_DELIVERY) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
- DELETE_MESSAGE_REF=DELETE FROM JBM_MSG_REF WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
- UPDATE_MESSAGE_REF=UPDATE JBM_MSG_REF SET TRANSACTION_ID=?, STATE='-' WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
- UPDATE_PAGE_ORDER=UPDATE JBM_MSG_REF SET PAGE_ORD = ? WHERE MESSAGE_ID=? AND CHANNEL_ID=?
- COMMIT_MESSAGE_REF1=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='+'
- COMMIT_MESSAGE_REF2=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='-'
- ROLLBACK_MESSAGE_REF1=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='+'
- ROLLBACK_MESSAGE_REF2=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='-'
- LOAD_PAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, PAGE_ORD, SCHED_DELIVERY FROM JBM_MSG_REF WHERE CHANNEL_ID = ? AND PAGE_ORD BETWEEN ? AND ? ORDER BY PAGE_ORD
- LOAD_UNPAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? AND PAGE_ORD IS NULL ORDER BY ORD
- LOAD_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? ORDER BY ORD
- UPDATE_REFS_NOT_PAGED=UPDATE JBM_MSG_REF SET PAGE_ORD = NULL WHERE PAGE_ORD BETWEEN ? AND ? AND CHANNEL_ID=?
- SELECT_MIN_MAX_PAGE_ORD=SELECT MIN(PAGE_ORD), MAX(PAGE_ORD) FROM JBM_MSG_REF WHERE CHANNEL_ID = ?
- SELECT_EXISTS_REF_MESSAGE_ID=SELECT MESSAGE_ID FROM JBM_MSG_REF WHERE MESSAGE_ID = ?
- UPDATE_DELIVERY_COUNT=UPDATE JBM_MSG_REF SET DELIVERY_COUNT = ? WHERE CHANNEL_ID = ? AND MESSAGE_ID = ?
- UPDATE_CHANNEL_ID=UPDATE JBM_MSG_REF SET CHANNEL_ID = ? WHERE CHANNEL_ID = ?
- LOAD_MESSAGES=SELECT MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, HEADERS, PAYLOAD, TYPE FROM JBM_MSG
- INSERT_MESSAGE=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME, HEADERS, PAYLOAD) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
- INSERT_MESSAGE_CONDITIONAL=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME) SELECT ?, ?, ?, ?, ?, ?, ? FROM JBM_DUAL WHERE NOT EXISTS (SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ?)
- UPDATE_MESSAGE_4CONDITIONAL=UPDATE JBM_MSG SET HEADERS=?, PAYLOAD=? WHERE MESSAGE_ID=?
- INSERT_MESSAGE_CONDITIONAL_FULL=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, INS_TIME, HEADERS, PAYLOAD) SELECT ?, ?, ?, ?, ?, ?, ?, ?, ? FROM JBM_DUAL WHERE NOT EXISTS (SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ?)
- MESSAGE_ID_COLUMN=MESSAGE_ID
- REAP_MESSAGES=DELETE FROM JBM_MSG WHERE INS_TIME < ? AND NOT EXISTS (SELECT * FROM JBM_MSG_REF WHERE JBM_MSG_REF.MESSAGE_ID = JBM_MSG.MESSAGE_ID)
- DELETE_MESSAGE=DELETE FROM JBM_MSG WHERE MESSAGE_ID = ? AND NOT EXISTS (SELECT * FROM JBM_MSG_REF WHERE JBM_MSG_REF.MESSAGE_ID = ?)
- INSERT_TRANSACTION=INSERT INTO JBM_TX (NODE_ID, TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID) VALUES(?, ?, ?, ?, ?)
- DELETE_TRANSACTION=DELETE FROM JBM_TX WHERE NODE_ID = ? AND TRANSACTION_ID = ?
- SELECT_PREPARED_TRANSACTIONS=SELECT TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID FROM JBM_TX WHERE NODE_ID = ?
- SELECT_MESSAGE_ID_FOR_REF=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '+' ORDER BY ORD
- SELECT_MESSAGE_ID_FOR_ACK=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '-' ORDER BY ORD
- UPDATE_COUNTER=UPDATE JBM_COUNTER SET NEXT_ID = ? WHERE NAME=?
- SELECT_COUNTER=SELECT NEXT_ID FROM JBM_COUNTER HOLDLOCK WHERE NAME=?
- INSERT_COUNTER=INSERT INTO JBM_COUNTER (NAME, NEXT_ID) VALUES (?, ?)
- SELECT_ALL_CHANNELS=SELECT DISTINCT(CHANNEL_ID) FROM JBM_MSG_REF
- UPDATE_TX=UPDATE JBM_TX SET NODE_ID=? WHERE NODE_ID=?
- ]]></attribute>
-
- <!-- The maximum number of parameters to include in a prepared statement -->
-
- <attribute name="MaxParams">500</attribute>
-
- </mbean>
-
- <!-- Messaging Post Office MBean configuration
- ========================================= -->
-
- <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
- name="jboss.messaging:service=PostOffice"
- xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml">
-
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-
- <!-- The name of the post office -->
-
- <attribute name="PostOfficeName">JMS post office</attribute>
-
- <!-- The datasource used by the post office to access it's binding information -->
-
- <attribute name="DataSource">java:/DefaultDS</attribute>
-
- <!-- If true will attempt to create tables and indexes on every start-up -->
-
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
-CREATE_POSTOFFICE_TABLE=CREATE TABLE JBM_POSTOFFICE (POSTOFFICE_NAME VARCHAR(255), NODE_ID SMALLINT, QUEUE_NAME VARCHAR(255), COND VARCHAR(1023), SELECTOR VARCHAR(1023) NULL, CHANNEL_ID INTEGER, CLSTERED CHAR(1), ALL_NODES CHAR(1), PRIMARY KEY(POSTOFFICE_NAME, NODE_ID, QUEUE_NAME))
-INSERT_BINDING=INSERT INTO JBM_POSTOFFICE (POSTOFFICE_NAME, NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLSTERED, ALL_NODES) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
-DELETE_BINDING=DELETE FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=? AND QUEUE_NAME=?
-LOAD_BINDINGS=SELECT QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLSTERED, ALL_NODES FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=?
- ]]></attribute>
-
- <!-- This post office is clustered. If you don't want a clustered post office then set to false -->
-
- <attribute name="Clustered">true</attribute>
-
- <!-- 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 -->
-
- <attribute name="GroupName">${jboss.messaging.groupname:MessagingPostOffice}</attribute>
-
- <!-- Max time to wait for state to arrive when the post office joins the cluster -->
-
- <attribute name="StateTimeout">5000</attribute>
-
- <!-- Max time to wait for a synchronous call to node members using the MessageDispatcher -->
-
- <attribute name="CastTimeout">5000</attribute>
-
- <!-- JGroups stack configuration for the data channel - used for sending data across the cluster -->
-
- <!-- By default we use the TCP stack for data -->
- <attribute name="DataChannelConfig">
- <config>
- <TCP start_port="7900"
- loopback="true"
- recv_buf_size="20000000"
- send_buf_size="640000"
- discard_incompatible_packets="true"
- max_bundle_size="64000"
- max_bundle_timeout="30"
- use_incoming_packet_handler="true"
- use_outgoing_packet_handler="false"
- down_thread="false" up_thread="false"
- enable_bundling="false"
- use_send_queues="false"
- sock_conn_timeout="300"
- skip_suspected_members="true"/>
- <MPING timeout="4000"
- bind_to_all_interfaces="true"
- mcast_addr="${jboss.messaging.datachanneludpaddress:228.6.6.6}"
- mcast_port="${jboss.messaging.datachanneludpport:45567}"
- ip_ttl="8"
- num_initial_members="2"
- num_ping_requests="1"/>
- <MERGE2 max_interval="100000"
- down_thread="false" up_thread="false" min_interval="20000"/>
- <FD_SOCK down_thread="false" up_thread="false"/>
- <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
- <pbcast.NAKACK max_xmit_size="60000"
- use_mcast_xmit="false" gc_lag="0"
- retransmit_timeout="300,600,1200,2400,4800"
- down_thread="false" up_thread="false"
- discard_delivered_msgs="true"/>
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
- down_thread="false" up_thread="false"
- max_bytes="400000"/>
- <pbcast.GMS print_local_addr="true" join_timeout="3000"
- down_thread="false" up_thread="false"
- join_retry_timeout="2000" shun="false"
- view_bundling="true"/>
- </config>
- </attribute>
-
- <!-- JGroups stack configuration to use for the control channel - used for control messages -->
-
- <!-- We use udp stack for the control channel -->
- <attribute name="ControlChannelConfig">
- <config>
- <UDP
- mcast_addr="${jboss.messaging.controlchanneludpaddress:228.7.7.7}"
- mcast_port="${jboss.messaging.controlchanneludpport:45568}"
- tos="8"
- ucast_recv_buf_size="20000000"
- ucast_send_buf_size="640000"
- mcast_recv_buf_size="25000000"
- mcast_send_buf_size="640000"
- loopback="false"
- discard_incompatible_packets="true"
- max_bundle_size="64000"
- max_bundle_timeout="30"
- use_incoming_packet_handler="true"
- use_outgoing_packet_handler="false"
- ip_ttl="2"
- down_thread="false" up_thread="false"
- enable_bundling="false"/>
- <PING timeout="2000"
- down_thread="false" up_thread="false" num_initial_members="3"/>
- <MERGE2 max_interval="100000"
- down_thread="false" up_thread="false" min_interval="20000"/>
- <FD_SOCK down_thread="false" up_thread="false"/>
- <FD timeout="10000" max_tries="5" down_thread="false" up_thread="false" shun="true"/>
- <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
- <pbcast.NAKACK max_xmit_size="60000"
- use_mcast_xmit="false" gc_lag="0"
- retransmit_timeout="300,600,1200,2400,4800"
- down_thread="false" up_thread="false"
- discard_delivered_msgs="true"/>
- <UNICAST timeout="300,600,1200,2400,3600"
- down_thread="false" up_thread="false"/>
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
- down_thread="false" up_thread="false"
- max_bytes="400000"/>
- <pbcast.GMS print_local_addr="true" join_timeout="3000" use_flush="true" flush_timeout="3000"
- down_thread="false" up_thread="false"
- join_retry_timeout="2000" shun="false"
- view_bundling="true"/>
- <FRAG2 frag_size="60000" down_thread="false" up_thread="false"/>
- <pbcast.STATE_TRANSFER down_thread="false" up_thread="false" use_flush="true" flush_timeout="3000"/>
- <pbcast.FLUSH down_thread="false" up_thread="false" timeout="20000" auto_flush_conf="false"/>
- </config>
- </attribute>
- </mbean>
-
- <!-- Messaging JMS User Manager MBean config
- ======================================= -->
-
- <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
- name="jboss.messaging:service=JMSUserManager"
- xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
- <attribute name="DataSource">java:/DefaultDS</attribute>
- <attribute name="CreateTablesOnStartup">true</attribute>
- <attribute name="SqlProperties"><![CDATA[
-CREATE_USER_TABLE=CREATE TABLE JBM_USER (USER_ID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, CLIENTID VARCHAR(128), PRIMARY KEY(USER_ID))
-CREATE_ROLE_TABLE=CREATE TABLE JBM_ROLE (ROLE_ID VARCHAR(32) NOT NULL, USER_ID VARCHAR(32) NOT NULL, PRIMARY KEY(USER_ID, ROLE_ID))
-SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JBM_USER WHERE USER_ID=?
-POPULATE.TABLES.1=INSERT INTO JBM_USER (USER_ID,PASSWD,CLIENTID) VALUES ('dilbert','dogbert','dilbert-id')
- ]]></attribute>
- </mbean>
-
-</server>
Added: branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/bindings.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/bindings.xml (rev 0)
+++ branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/bindings.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <!--<bean name="Naming" class="org.jnp.server.SingletonNamingServer"/>-->
+
+
+
+ <bean name="topicBinding" class="org.jboss.jms.server.microcontainer.JndiBinder">
+ <property name="jndiProperties"><inject bean="InitialContextProperties"/></property>
+ <property name="target"><inject bean="topic"/></property>
+ <property name="bindTo">topic</property>
+ <property name="serializable">false</property>
+ </bean>
+</deployment>
\ No newline at end of file
Added: branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/mbeansupport.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/mbeansupport.xml (rev 0)
+++ branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/mbeansupport.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="MBeanServer" class="java.lang.Object">
+ <constructor factoryClass="org.jboss.jms.server.microcontainer.factory.mBeanServerCreator"
+ factoryMethod="createMBeanServer"/>
+ </bean>
+
+ <aop:lifecycle-configure xmlns:aop="urn:jboss:aop-beans:1.0"
+ name="DependencyAdvice"
+ class="org.jboss.aop.microcontainer.aspects.jmx.JMXLifecycleCallback"
+ classes="@org.jboss.aop.microcontainer.aspects.jmx.JMX">
+ <property name="mbeanServer">
+ <inject bean="MBeanServer"/>
+ </property>
+ </aop:lifecycle-configure>
+
+ <bean class="com.arjuna.ats.jbossatx.jta.TransactionManagerService"
+ name="TransactionManager">
+ <property name="transactionTimeout">300</property>
+ <property name="objectStoreDir">tx-object-store</property>
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=TransactionManager",exposedInterface=com.arjuna.ats.jbossatx.jta.TransactionManagerServiceMBean.class)
+ </annotation>
+ </bean>
+ <!-- <bean name="Repository" class="org.jboss.metadata.plugins.repository.basic.BasicMetaDataRepository"/>
+ -->
+ <!--<bean name="AspectManager" class="org.jboss.aop.AspectManager">
+ <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+ </bean>-->
+
+</deployment>
\ No newline at end of file
Added: branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/mysql-beans.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/mysql-beans.xml (rev 0)
+++ branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/mysql-beans.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="DataSource" class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource">
+ <property name="url">jdbc:mysql://localhost:3306/messaging</property>
+ <property name="user">andy</property>
+ </bean>
+
+</deployment>
Added: branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/naming.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/naming.xml (rev 0)
+++ branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/naming.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <bean name="Naming" class="org.jnp.server.SingletonNamingServer"/>
+
+ <bean name="InitialContextProperties" class="java.util.Hashtable">
+ <constructor>
+ <parameter class="java.util.Map">
+ <map keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.LocalOnlyContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming:org.jnp.interfaces</value>
+ </entry>
+ </map>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <bean name="JaasBinding" class="org.jboss.jms.server.microcontainer.JndiBinder">
+ <property name="jndiProperties"><inject bean="InitialContextProperties"/></property>
+ <property name="target"><inject bean="Jaas"/></property>
+ <property name="bindTo">java:/jaas/messaging</property>
+ <property name="serializable">false</property>
+ </bean>
+
+ <bean name="Jaas" class="org.jboss.jms.server.microcontainer.AuthenticationManager"/>
+
+</deployment>
\ No newline at end of file
Added: branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/tm-beans.xml
===================================================================
--- branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/tm-beans.xml (rev 0)
+++ branches/Branch_MC_Integration_New/src/etc/server/standalone/deploy/tm-beans.xml 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="jboss:service=TransactionManager" class="com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple"/>
+
+</deployment>
\ No newline at end of file
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/client/container/ClusteringAspect.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/client/container/ClusteringAspect.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/client/container/ClusteringAspect.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -6,12 +6,6 @@
*/
package org.jboss.jms.client.container;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.jms.JMSException;
-
import org.jboss.aop.joinpoint.Invocation;
import org.jboss.aop.joinpoint.MethodInvocation;
import org.jboss.jms.client.FailoverCommandCenter;
@@ -25,6 +19,11 @@
import org.jboss.jms.exception.MessagingNetworkFailureException;
import org.jboss.logging.Logger;
+import javax.jms.JMSException;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Map;
+
/**
* This aspect is part of a clustered ConnectionFactory aspect stack.
* Some of its responsibilities are:
@@ -70,7 +69,7 @@
// Public ---------------------------------------------------------------------------------------
- public CreateConnectionResult handleCreateConnectionDelegate(Invocation invocation)
+ public Object handleCreateConnectionDelegate(Invocation invocation)
throws Throwable
{
if (trace)
Added: 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 (rev 0)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/Configuration.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,510 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss 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.jms.server;
+
+import org.jboss.jms.server.security.Role;
+import org.jboss.messaging.util.XMLUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.net.URL;
+import java.util.HashSet;
+
+/**
+ * @author <a href="ataylor at redhat.com">Andy Taylor</a>
+ */
+public class Configuration
+{
+ private static PropertyChangeSupport propertyChangeSupport;
+ private static Integer _serverPeerID = -1;
+ private static String _defaultQueueJNDIContext = "";
+ private static String _defaultTopicJNDIContext = "";
+ private static String _securityDomain;
+ private static HashSet<Role> _securityConfig;
+ private static String _defaultDLQ;
+ // The default maximum number of delivery attempts before sending to DLQ - can be overridden on
+ // the destination
+ private static Integer _defaultMaxDeliveryAttempts = 10;
+ protected static String _defaultExpiryQueue;
+
+ private static Long _defaultRedeliveryDelay = (long)0;
+
+ private static Long _messageCounterSamplePeriod = (long)10000;// Default is 1 minute
+ private static Long _failoverStartTimeout = (long)(60 * 1000);
+ // Default is 5 minutes
+ private static Long _failoverCompleteTimeout = (long)(5 * 60 * 1000);
+
+ private static Integer _defaultMessageCounterHistoryDayLimit = 1;
+
+ private static String _clusterPullConnectionFactoryName;
+
+
+ private static Boolean _useXAForMessagePull = false;
+
+ private static Boolean _defaultPreserveOrdering = false;
+
+ private static Long _recoverDeliveriesTimeout = (long)(5 * 60 * 1000);
+
+
+ private static String _suckerPassword;
+
+ //Global override for strict behaviour
+ private static Boolean _strictTck = false;
+
+ //From a system property - this overrides
+ private static Boolean _strictTckProperty = false;
+
+ private static String _postOfficeName;
+
+ private static Boolean _clustered = false;
+
+ private static Long _stateTimeout = (long) 5000;
+
+ private static Long _castTimeout = (long)5000;
+
+ private static String _groupName;
+
+ private static String _controlChannelName;
+
+ private static String _dataChannelName;
+
+ private static String _channelPartitionName;
+
+ private static Integer _maxConcurrentReplications = 25;
+
+ private static Boolean _useJGroupsWorkaround = false;
+
+ public void start() throws Exception
+ {
+ propertyChangeSupport = new PropertyChangeSupport(this);
+
+ _strictTckProperty = "true".equalsIgnoreCase(System.getProperty("jboss.messaging.stricttck"));
+ _useJGroupsWorkaround = "true".equals(System.getProperty("jboss.messaging.usejgroupsworkaround"));
+
+ URL url = getClass().getClassLoader().getResource("jbm-configuration.xml");
+ Element e = XMLUtil.urlToElement(url);
+ _serverPeerID = getInteger(e, "server-peer-id", _serverPeerID);
+ _defaultQueueJNDIContext = getString(e, "default-queue-jndi-context", _defaultQueueJNDIContext);
+ _defaultTopicJNDIContext = getString(e, "default-topic-jndi-context", _defaultTopicJNDIContext);
+ _securityDomain = getString(e, "security-domain", _securityDomain);
+ _defaultDLQ = getString(e, "default-dlq", _defaultDLQ);
+ _defaultMaxDeliveryAttempts = getInteger(e, "default-max-delivery-attempts", _defaultMaxDeliveryAttempts);
+ _defaultExpiryQueue = getString(e,"default-expiry-queue", _defaultExpiryQueue);
+ _defaultRedeliveryDelay = getLong(e, "default-redelivery-delay", _defaultRedeliveryDelay);
+ _messageCounterSamplePeriod = getLong(e, "message-counter-sample-period", _messageCounterSamplePeriod);
+ _failoverStartTimeout = getLong(e, "failover-start-timeout", _failoverStartTimeout);
+ _failoverCompleteTimeout = getLong(e, "failover-complete-timeout", _failoverCompleteTimeout);
+ _defaultMessageCounterHistoryDayLimit = getInteger(e, "default-message-counter-history-day-limit", _defaultMessageCounterHistoryDayLimit);
+ _clusterPullConnectionFactoryName = getString(e, "cluster-pull-connection-factory-name", _clusterPullConnectionFactoryName);
+ _useXAForMessagePull = getBoolean(e, "use-xa-for-message-pull", _useXAForMessagePull);
+ _defaultPreserveOrdering = getBoolean(e, "default-preserve-ordering", _defaultPreserveOrdering);
+ _recoverDeliveriesTimeout = getLong(e, "recover-deliveries-timeout", _recoverDeliveriesTimeout);
+ _suckerPassword = getString(e, "sucker-password", _suckerPassword);
+ _strictTck = getBoolean(e, "strict-tck", _strictTck);
+ _postOfficeName = getString(e, "post-office-name", _postOfficeName);
+ _clustered = getBoolean(e, "clustered", _clustered);
+ _stateTimeout = getLong(e, "state-timeout", _stateTimeout);
+ _castTimeout = getLong(e, "cast-timeout", _castTimeout);
+ _groupName = getString(e, "group-name", _groupName);
+ _controlChannelName = getString(e, "control-channel-name", _controlChannelName);
+ _dataChannelName = getString(e, "data-channel-name", _dataChannelName);
+ _channelPartitionName = getString(e, "channel-partition-name", _channelPartitionName);
+ _maxConcurrentReplications = getInteger(e, "max-concurrent-replications", _maxConcurrentReplications);
+
+
+ }
+
+ private static Boolean getBoolean(Element e, String name, Boolean def)
+ {
+ NodeList nl = e.getElementsByTagName(name);
+ if(nl.getLength() > 0)
+ {
+ return Boolean.valueOf(nl.item(0).getTextContent().trim());
+ }
+ return def;
+ }
+
+
+ private static Integer getInteger(Element e, String name, Integer def)
+ {
+ NodeList nl = e.getElementsByTagName(name);
+ if(nl.getLength() > 0)
+ {
+ return Integer.valueOf(nl.item(0).getTextContent().trim());
+ }
+ return def;
+ }
+
+ private static Long getLong(Element e, String name, Long def)
+ {
+ NodeList nl = e.getElementsByTagName(name);
+ if(nl.getLength() > 0)
+ {
+ return Long.valueOf(nl.item(0).getTextContent().trim());
+ }
+ return def;
+ }
+
+ private static String getString(Element e, String name, String def)
+ {
+ NodeList nl = e.getElementsByTagName(name);
+ if(nl.getLength() > 0)
+ {
+ return nl.item(0).getTextContent().trim();
+ }
+ return def;
+ }
+
+ public static void addPropertyChangeListener(
+ PropertyChangeListener listener)
+ {
+ propertyChangeSupport.addPropertyChangeListener(listener);
+ }
+
+ public static int getServerPeerID()
+ {
+ return _serverPeerID;
+ }
+
+ public static void setServerPeerID(int serverPeerID)
+ {
+ _serverPeerID = serverPeerID;
+ }
+
+
+ public static String getDefaultQueueJNDIContext()
+ {
+ return _defaultQueueJNDIContext;
+ }
+
+ public static void setDefaultQueueJNDIContext(String defaultQueueJNDIContext)
+ {
+ _defaultQueueJNDIContext = defaultQueueJNDIContext;
+ }
+
+
+ public static String getDefaultTopicJNDIContext()
+ {
+ return _defaultTopicJNDIContext;
+ }
+
+ public static void setDefaultTopicJNDIContext(String defaultTopicJNDIContext)
+ {
+ _defaultTopicJNDIContext = defaultTopicJNDIContext;
+ }
+
+ public static void setSecurityDomain(String securityDomain) throws Exception
+ {
+ _securityDomain = securityDomain;
+ }
+
+ public static String getSecurityDomain()
+ {
+ return _securityDomain;
+ }
+
+
+ public static HashSet<Role> getSecurityConfig()
+ {
+ return _securityConfig;
+ }
+
+ public static void setSecurityConfig(HashSet<Role> securityConfig)
+ {
+ _securityConfig = securityConfig;
+ }
+
+
+ public static String getDefaultDLQ()
+ {
+ return _defaultDLQ;
+ }
+
+ public static void setDefaultDLQ(String defaultDLQ)
+ {
+ _defaultDLQ = defaultDLQ;
+ }
+
+
+ public static int getDefaultMaxDeliveryAttempts()
+ {
+ return _defaultMaxDeliveryAttempts;
+ }
+
+ public static void setDefaultMaxDeliveryAttempts(int defaultMaxDeliveryAttempts)
+ {
+ _defaultMaxDeliveryAttempts = defaultMaxDeliveryAttempts;
+ }
+
+
+ public static String getDefaultExpiryQueue()
+ {
+ return _defaultExpiryQueue;
+ }
+
+ public static void setDefaultExpiryQueue(String defaultExpiryQueue)
+ {
+ _defaultExpiryQueue = defaultExpiryQueue;
+ }
+
+
+ public static long getDefaultRedeliveryDelay()
+ {
+ return _defaultRedeliveryDelay;
+ }
+
+ public static void setDefaultRedeliveryDelay(long defaultRedeliveryDelay)
+ {
+ _defaultRedeliveryDelay = defaultRedeliveryDelay;
+ }
+
+
+ public static long getMessageCounterSamplePeriod()
+ {
+ return _messageCounterSamplePeriod;
+ }
+
+ public static void setMessageCounterSamplePeriod(long messageCounterSamplePeriod)
+ {
+ if (messageCounterSamplePeriod < 1000)
+ {
+ throw new IllegalArgumentException("Cannot set MessageCounterSamplePeriod < 1000 ms");
+ }
+ propertyChangeSupport.firePropertyChange("messageCounterSamplePeriod", _messageCounterSamplePeriod, messageCounterSamplePeriod);
+ _messageCounterSamplePeriod = messageCounterSamplePeriod;
+ }
+
+
+ public static long getFailoverStartTimeout()
+ {
+ return _failoverStartTimeout;
+ }
+
+ public static void setFailoverStartTimeout(long failoverStartTimeout)
+ {
+ _failoverStartTimeout = failoverStartTimeout;
+ }
+
+
+ public static long getFailoverCompleteTimeout()
+ {
+ return _failoverCompleteTimeout;
+ }
+
+ public static void setFailoverCompleteTimeout(long failoverCompleteTimeout)
+ {
+ _failoverCompleteTimeout = failoverCompleteTimeout;
+ }
+
+
+ public static int getDefaultMessageCounterHistoryDayLimit()
+ {
+ return _defaultMessageCounterHistoryDayLimit;
+ }
+
+ public static void setDefaultMessageCounterHistoryDayLimit(int defaultMessageCounterHistoryDayLimit)
+ {
+ if (defaultMessageCounterHistoryDayLimit < -1)
+ {
+ defaultMessageCounterHistoryDayLimit = -1;
+ }
+ _defaultMessageCounterHistoryDayLimit = defaultMessageCounterHistoryDayLimit;
+ }
+
+
+ public static String getClusterPullConnectionFactoryName()
+ {
+ return _clusterPullConnectionFactoryName;
+ }
+
+ public static void setClusterPullConnectionFactoryName(String clusterPullConnectionFactoryName)
+ {
+ _clusterPullConnectionFactoryName = clusterPullConnectionFactoryName;
+ }
+
+
+ public static boolean isUseXAForMessagePull()
+ {
+ return _useXAForMessagePull;
+ }
+
+ public static void setUseXAForMessagePull(boolean useXAForMessagePull)
+ {
+ _useXAForMessagePull = useXAForMessagePull;
+ }
+
+
+ public static boolean isDefaultPreserveOrdering()
+ {
+ return _defaultPreserveOrdering;
+ }
+
+ public static void setDefaultPreserveOrdering(boolean defaultPreserveOrdering)
+ {
+ _defaultPreserveOrdering = defaultPreserveOrdering;
+ }
+
+
+ public static long getRecoverDeliveriesTimeout()
+ {
+ return _recoverDeliveriesTimeout;
+ }
+
+ public static void setRecoverDeliveriesTimeout(long recoverDeliveriesTimeout)
+ {
+ _recoverDeliveriesTimeout = recoverDeliveriesTimeout;
+ }
+
+
+ public static String getSuckerPassword()
+ {
+ return _suckerPassword;
+ }
+
+ public static void setSuckerPassword(String suckerPassword)
+ {
+ _suckerPassword = suckerPassword;
+ }
+
+
+ public static boolean isStrictTck()
+ {
+ return _strictTck || _strictTckProperty;
+ }
+
+ public static void setStrictTck(boolean strictTck)
+ {
+ _strictTck = strictTck || _strictTckProperty;
+ }
+
+
+ public static String getPostOfficeName()
+ {
+ return _postOfficeName;
+ }
+
+ public static void setPostOfficeName(String postOfficeName)
+ {
+ _postOfficeName = postOfficeName;
+ }
+
+
+ public static boolean isClustered()
+ {
+ return _clustered;
+ }
+
+ public static void setClustered(boolean clustered)
+ {
+ _clustered = clustered;
+ }
+
+
+ public static long getStateTimeout()
+ {
+ return _stateTimeout;
+ }
+
+ public static void setStateTimeout(long stateTimeout)
+ {
+ _stateTimeout = stateTimeout;
+ }
+
+
+ public static long getCastTimeout()
+ {
+ return _castTimeout;
+ }
+
+ public static void setCastTimeout(long castTimeout)
+ {
+ _castTimeout = castTimeout;
+ }
+
+
+ public static String getGroupName()
+ {
+ return _groupName;
+ }
+
+ public static void setGroupName(String groupName)
+ {
+ _groupName = groupName;
+ }
+
+
+ public static String getControlChannelName()
+ {
+ return _controlChannelName;
+ }
+
+ public static void setControlChannelName(String controlChannelName)
+ {
+ _controlChannelName = controlChannelName;
+ }
+
+
+ public static String getDataChannelName()
+ {
+ return _dataChannelName;
+ }
+
+ public static void setDataChannelName(String dataChannelName)
+ {
+ _dataChannelName = dataChannelName;
+ }
+
+
+ public static String getChannelPartitionName()
+ {
+ return _channelPartitionName;
+ }
+
+ public static void setChannelPartitionName(String channelPartitionName)
+ {
+ _channelPartitionName = channelPartitionName;
+ }
+
+
+ public static int getMaxConcurrentReplications()
+ {
+ return _maxConcurrentReplications;
+ }
+
+ public static void setMaxConcurrentReplications(int maxConcurrentReplications)
+ {
+ _maxConcurrentReplications = maxConcurrentReplications;
+ }
+
+
+ public static boolean isUseJGroupsWorkaround()
+ {
+ return _useJGroupsWorkaround;
+ }
+
+ public static void setUseJGroupsWorkaround(boolean useJGroupsWorkaround)
+ {
+ _useJGroupsWorkaround = useJGroupsWorkaround;
+ }
+}
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/ConnectionFactoryManager.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/ConnectionFactoryManager.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/ConnectionFactoryManager.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -22,9 +22,10 @@
package org.jboss.jms.server;
import org.jboss.jms.client.plugin.LoadBalancingFactory;
-import org.jboss.jms.server.connectionfactory.JNDIBindings;
import org.jboss.messaging.core.contract.MessagingComponent;
+import java.util.List;
+
/**
* @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
* @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
@@ -38,7 +39,7 @@
* @param jndiBindings - if null, the connection factory will be created and registered with the
* AOP subsystem, but not bound in JNDI.
*/
- void registerConnectionFactory(String uniqueName, String clientID, JNDIBindings jndiBindings,
+ void registerConnectionFactory(String uniqueName, String clientID, List<String> jndiBindings,
String locatorURI, boolean clientPing,
int prefetchSize,
boolean slowConsumers,
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/DestinationJNDIMapper.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/DestinationJNDIMapper.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/DestinationJNDIMapper.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,27 +21,18 @@
*/
package org.jboss.jms.server;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
+import org.jboss.jms.destination.*;
+import org.jboss.jms.exception.MessagingJMSException;
+import org.jboss.jms.server.destination.ManagedDestination;
+import org.jboss.logging.Logger;
+import org.jboss.messaging.util.JNDIUtil;
import javax.jms.InvalidDestinationException;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NameNotFoundException;
+import java.util.*;
-import org.jboss.jms.destination.JBossDestination;
-import org.jboss.jms.destination.JBossQueue;
-import org.jboss.jms.destination.JBossTemporaryQueue;
-import org.jboss.jms.destination.JBossTemporaryTopic;
-import org.jboss.jms.destination.JBossTopic;
-import org.jboss.jms.exception.MessagingJMSException;
-import org.jboss.jms.server.destination.ManagedDestination;
-import org.jboss.logging.Logger;
-import org.jboss.messaging.util.JNDIUtil;
-
/**
* Keeps track of destinations - including temporary destinations
* Also manages the mapping of non temporary destinations to JNDI context
@@ -94,7 +85,7 @@
if (jndiName == null)
{
parentContext = destination.isQueue() ?
- serverPeer.getDefaultQueueJNDIContext() : serverPeer.getDefaultTopicJNDIContext();
+ Configuration.getDefaultQueueJNDIContext() : Configuration.getDefaultTopicJNDIContext();
jndiNameInContext = destination.getName();
jndiName = parentContext + "/" + jndiNameInContext;
@@ -240,8 +231,8 @@
initialContext = new InitialContext();
// see if the default queue/topic contexts are there, and if they're not, create them
- createContext(serverPeer.getDefaultQueueJNDIContext());
- createContext(serverPeer.getDefaultTopicJNDIContext());
+ createContext(Configuration.getDefaultQueueJNDIContext());
+ createContext(Configuration.getDefaultTopicJNDIContext());
}
public void stop() throws Exception
@@ -261,8 +252,8 @@
unregisterDestination((ManagedDestination)i.next());
}
- initialContext.unbind(serverPeer.getDefaultQueueJNDIContext());
- initialContext.unbind(serverPeer.getDefaultTopicJNDIContext());
+ initialContext.unbind(Configuration.getDefaultQueueJNDIContext());
+ initialContext.unbind(Configuration.getDefaultTopicJNDIContext());
initialContext.close();
}
Added: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/JmsServer.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/JmsServer.java (rev 0)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/JmsServer.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,55 @@
+package org.jboss.jms.server;
+
+import java.util.List;
+
+/**
+ * @author <a href="ataylor at redhat.com">Andy Taylor</a>
+ */
+public interface JmsServer
+{
+ String getJMSVersion();
+
+ int getJMSMajorVersion();
+
+ int getJMSMinorVersion();
+
+ String getJMSProviderName();
+
+ String getProviderVersion();
+
+ int getProviderMajorVersion();
+
+ int getProviderMinorVersion();
+
+ void enableMessageCounters();
+
+ void disableMessageCounters();
+
+ String deployQueue(String name, String jndiName) throws Exception;
+
+ String deployQueue(String name, String jndiName, int fullSize, int pageSize, int downCacheSize) throws Exception;
+
+ boolean destroyQueue(String name) throws Exception;
+
+ boolean undeployQueue(String name) throws Exception;
+
+ String deployTopic(String name, String jndiName) throws Exception;
+
+ String deployTopic(String name, String jndiName, int fullSize, int pageSize, int downCacheSize) throws Exception;
+
+ boolean destroyTopic(String name) throws Exception;
+
+ boolean undeployTopic(String name) throws Exception;
+
+ String listMessageCountersAsHTML() throws Exception;
+
+ void resetAllMessageCounters();
+
+ void resetAllMessageCounterHistories();
+
+ List retrievePreparedTransactions();
+
+ String showPreparedTransactionsAsHTML();
+
+ String showActiveClientsAsHTML() throws Exception;
+}
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/SecurityStore.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/SecurityStore.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/SecurityStore.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,15 +21,15 @@
*/
package org.jboss.jms.server;
-import java.util.Set;
+import org.jboss.jms.server.security.CheckType;
+import org.jboss.jms.server.security.Role;
+import org.jboss.jms.server.security.SecurityMetadata;
import javax.jms.JMSSecurityException;
import javax.security.auth.Subject;
+import java.util.HashSet;
+import java.util.Set;
-import org.jboss.jms.server.security.CheckType;
-import org.jboss.jms.server.security.SecurityMetadata;
-import org.w3c.dom.Element;
-
/**
* @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
* @version <tt>$Revision$</tt>
@@ -43,7 +43,7 @@
*/
SecurityMetadata getSecurityMetadata(boolean isQueue, String destName);
- void setSecurityConfig(boolean isQueue, String destName, Element conf) throws Exception;
+ void setSecurityConfig(boolean isQueue, String destName, HashSet<Role> conf) throws Exception;
void clearSecurityConfig(boolean isQueue, String name) throws Exception;
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/ServerPeer.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/ServerPeer.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/ServerPeer.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,31 +21,13 @@
*/
package org.jboss.jms.server;
-import java.io.ByteArrayOutputStream;
-import java.io.CharArrayWriter;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import javax.management.Attribute;
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.transaction.xa.Xid;
-
+import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
import org.jboss.aop.AspectXmlLoader;
+import org.jboss.aop.microcontainer.aspects.jmx.JMX;
import org.jboss.jms.server.connectionfactory.ConnectionFactoryJNDIMapper;
import org.jboss.jms.server.connectionmanager.SimpleConnectionManager;
import org.jboss.jms.server.connectormanager.SimpleConnectorManager;
+import org.jboss.jms.server.destination.DestinationDeployer;
import org.jboss.jms.server.destination.ManagedQueue;
import org.jboss.jms.server.endpoint.ServerConnectionEndpoint;
import org.jboss.jms.server.endpoint.ServerSessionEndpoint;
@@ -56,15 +38,8 @@
import org.jboss.jms.server.security.SecurityMetadataStore;
import org.jboss.jms.wireformat.JMSWireFormat;
import org.jboss.logging.Logger;
-import org.jboss.messaging.core.contract.Binding;
-import org.jboss.messaging.core.contract.ClusterNotifier;
-import org.jboss.messaging.core.contract.MemoryManager;
-import org.jboss.messaging.core.contract.MessageStore;
-import org.jboss.messaging.core.contract.PersistenceManager;
-import org.jboss.messaging.core.contract.PostOffice;
+import org.jboss.messaging.core.contract.*;
import org.jboss.messaging.core.contract.Queue;
-import org.jboss.messaging.core.contract.Replicator;
-import org.jboss.messaging.core.impl.DefaultClusterNotifier;
import org.jboss.messaging.core.impl.FailoverWaiter;
import org.jboss.messaging.core.impl.IDManager;
import org.jboss.messaging.core.impl.JDBCPersistenceManager;
@@ -74,17 +49,19 @@
import org.jboss.messaging.core.impl.postoffice.MessagingPostOffice;
import org.jboss.messaging.core.impl.tx.TransactionRepository;
import org.jboss.messaging.util.ExceptionUtil;
-import org.jboss.messaging.util.JMXAccessor;
-import org.jboss.messaging.util.Util;
import org.jboss.messaging.util.Version;
-import org.jboss.mx.loading.UnifiedClassLoader3;
import org.jboss.remoting.marshal.MarshalFactory;
-import org.jboss.system.ServiceCreator;
-import org.jboss.system.ServiceMBeanSupport;
import org.jboss.util.JBossStringBuilder;
-import org.w3c.dom.Element;
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
+import javax.transaction.xa.Xid;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.ByteArrayOutputStream;
+import java.io.CharArrayWriter;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.net.URL;
+import java.util.*;
/**
* A JMS server peer.
@@ -93,12 +70,13 @@
* @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
* @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>
* @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
- *
+ * @author <a href="mailto:ataylor at redhat.com>Andy Taylor</a>
* @version <tt>$Revision$</tt>
- *
- * $Id$
+ * <p/>
+ * $Id$
*/
-public class ServerPeer extends ServiceMBeanSupport
+ at JMX(name = "jboss.messaging:service=Server", exposedInterface = JmsServer.class)
+public class ServerPeer implements JmsServer
{
// Constants ------------------------------------------------------------------------------------
@@ -112,51 +90,20 @@
// Attributes -----------------------------------------------------------------------------------
- private int serverPeerID = -1;
private byte[] clientAOPStack;
private Version version;
- private String defaultQueueJNDIContext = "";
- private String defaultTopicJNDIContext = "";
private boolean started;
private boolean supportsFailover = true;
- // The default maximum number of delivery attempts before sending to DLQ - can be overridden on
- // the destination
- private int defaultMaxDeliveryAttempts = 10;
-
- // Default is 1 minute
- private long failoverStartTimeout = 60 * 1000;
-
- // Default is 5 minutes
- private long failoverCompleteTimeout = 5 * 60 * 1000;
-
private Map sessions;
-
- private long defaultRedeliveryDelay;
-
- private long messageCounterSamplePeriod = 10000;
-
- private int defaultMessageCounterHistoryDayLimit;
-
- private String clusterPullConnectionFactoryName;
-
- private boolean useXAForMessagePull;
-
- private boolean defaultPreserveOrdering;
-
- private long recoverDeliveriesTimeout = 5 * 60 * 1000;
-
- private String suckerPassword;
-
- //Global override for strict behaviour
- private boolean strictTck;
-
- //From a system property - this overrides
- private boolean strictTckProperty;
-
+
+
+
+
+
// wired components
private DestinationJNDIMapper destinationJNDIMapper;
@@ -168,30 +115,25 @@
private IDManager messageIDManager;
private IDManager channelIDManager;
private IDManager transactionIDManager;
- private MemoryManager memoryManager;
+ private MemoryManager memoryManager;
private MessageStore messageStore;
private MessageCounterManager messageCounterManager;
private ClusterConnectionManager clusterConnectionManager;
private ClusterNotifier clusterNotifier;
- private FailoverWaiter failoverWaiter;
+ private FailoverWaiter failoverWaiter;
// plugins
- protected ObjectName persistenceManagerObjectName;
protected PersistenceManager persistenceManager;
- protected ObjectName postOfficeObjectName;
protected PostOffice postOffice;
- protected ObjectName jmsUserManagerObjectName;
protected JMSUserManager jmsUserManager;
-
- protected ObjectName defaultDLQObjectName;
- protected Queue defaultDLQ;
-
- protected ObjectName defaultExpiryQueueObjectName;
- protected Queue defaultExpiryQueue;
+
+ private DestinationDeployer destinationDeployer;
+
+
// Constructors ---------------------------------------------------------------------------------
public ServerPeer() throws Exception
{
@@ -199,15 +141,15 @@
securityStore = new SecurityMetadataStore();
version = Version.instance();
-
+
sessions = new ConcurrentReaderHashMap();
started = false;
}
- // ServiceMBeanSupport overrides ----------------------------------------------------------------
+ // lifecycle methods ----------------------------------------------------------------
- public synchronized void startService() throws Exception
+ public synchronized void start() throws Exception
{
try
{
@@ -217,8 +159,8 @@
{
return;
}
-
- if (serverPeerID < 0)
+
+ if (Configuration.getServerPeerID() < 0)
{
throw new IllegalStateException("ServerPeerID not set");
}
@@ -226,22 +168,10 @@
log.debug(this + " starting");
loadClientAOPConfig();
-
loadServerAOPConfig();
- MBeanServer mbeanServer = getServer();
+ ((JDBCPersistenceManager) persistenceManager).injectNodeID(Configuration.getServerPeerID());
- // Acquire references to plugins. Each plug-in will be accessed directly via a reference
- // circumventing the MBeanServer. However, they are installed as services to take advantage
- // of their automatically-creating management interface.
-
- persistenceManager = (PersistenceManager)JMXAccessor.getJMXAttributeOverSecurity(mbeanServer, persistenceManagerObjectName, "Instance");
- ((JDBCPersistenceManager)persistenceManager).injectNodeID(serverPeerID);
-
- jmsUserManager = (JMSUserManager)JMXAccessor.getJMXAttributeOverSecurity(mbeanServer, jmsUserManagerObjectName, "Instance");
-
- strictTckProperty = "true".equalsIgnoreCase(System.getProperty("jboss.messaging.stricttck"));
-
// We get references to some plugins lazily to avoid problems with circular MBean
// dependencies
@@ -251,32 +181,40 @@
transactionIDManager = new IDManager("TRANSACTION_ID", 1024, persistenceManager);
destinationJNDIMapper = new DestinationJNDIMapper(this);
connFactoryJNDIMapper = new ConnectionFactoryJNDIMapper(this);
- connectionManager = new SimpleConnectionManager();
+ connectionManager = new SimpleConnectionManager();
connectorManager = new SimpleConnectorManager();
memoryManager = new SimpleMemoryManager();
messageStore = new SimpleMessageStore();
txRepository =
- new TransactionRepository(persistenceManager, messageStore, transactionIDManager);
- messageCounterManager = new MessageCounterManager(messageCounterSamplePeriod);
-
- clusterNotifier = new DefaultClusterNotifier();
+ new TransactionRepository(persistenceManager, messageStore, transactionIDManager);
+ messageCounterManager = new MessageCounterManager(Configuration.getMessageCounterSamplePeriod());
+ Configuration.addPropertyChangeListener(new PropertyChangeListener()
+ {
+ public void propertyChange(PropertyChangeEvent evt)
+ {
+ messageCounterManager.reschedule(Configuration.getMessageCounterSamplePeriod());
+ }
+ });
+ //inverted dependancy, post office will now inject this
+ //clusterNotifier = new DefaultClusterNotifier();
+
clusterNotifier.registerListener(connectionManager);
clusterNotifier.registerListener(connFactoryJNDIMapper);
- failoverWaiter = new FailoverWaiter(serverPeerID, failoverStartTimeout, failoverCompleteTimeout, txRepository);
- clusterNotifier.registerListener(failoverWaiter);
-
- if (suckerPassword == null)
- {
- suckerPassword = SecurityMetadataStore.DEFAULT_SUCKER_USER_PASSWORD;
- }
- if (clusterPullConnectionFactoryName != null)
- {
- clusterConnectionManager = new ClusterConnectionManager(useXAForMessagePull, serverPeerID,
- clusterPullConnectionFactoryName, defaultPreserveOrdering,
- SecurityMetadataStore.SUCKER_USER, suckerPassword);
- clusterNotifier.registerListener(clusterConnectionManager);
+ failoverWaiter = new FailoverWaiter(Configuration.getServerPeerID(), Configuration.getFailoverStartTimeout(), Configuration.getFailoverCompleteTimeout(), txRepository);
+ clusterNotifier.registerListener(failoverWaiter);
+
+ if (Configuration.getSuckerPassword() == null)
+ {
+ Configuration.setSuckerPassword(SecurityMetadataStore.DEFAULT_SUCKER_USER_PASSWORD);
}
-
+ if (Configuration.getClusterPullConnectionFactoryName() != null)
+ {
+ clusterConnectionManager = new ClusterConnectionManager(Configuration.isUseXAForMessagePull(), Configuration.getServerPeerID(),
+ Configuration.getClusterPullConnectionFactoryName(), Configuration.isDefaultPreserveOrdering(),
+ SecurityMetadataStore.SUCKER_USER, Configuration.getSuckerPassword());
+ clusterNotifier.registerListener(clusterConnectionManager);
+ }
+
// Start the wired components
messageIDManager.start();
@@ -287,30 +225,49 @@
connectionManager.start();
connectorManager.start();
memoryManager.start();
- messageStore.start();
- securityStore.setSuckerPassword(suckerPassword);
+ messageStore.start();
+ securityStore.setSuckerPassword(Configuration.getSuckerPassword());
securityStore.start();
txRepository.start();
clusterConnectionManager.start();
-
+
// Note we do not start the message counter manager by default. This must be done
// explicitly by the user by calling enableMessageCounters(). This is because message
// counter history takes up growing memory to store the stats and could theoretically
// eventually cause the server to run out of RAM
-
+
txRepository.loadPreparedTransactions();
-
- JMSWireFormat wf = new JMSWireFormat();
- MarshalFactory.addMarshaller("jms", wf, wf);
-
+
+ JMSWireFormat wf = new JMSWireFormat();
+ MarshalFactory.addMarshaller("jms", wf, wf);
+
//Now everything is started we can tell the invocation handler to start handling invocations
//We do this right at the end otherwise it can start handling invocations before we are properly started
JMSServerInvocationHandler.setClosed(false);
+ if (Configuration.isClustered())
+ {
+ Replicator rep = (Replicator) postOffice;
+
+ connFactoryJNDIMapper.injectReplicator(rep);
+
+ // Also inject into the cluster connection manager
+
+ this.clusterConnectionManager.injectPostOffice(postOffice);
+
+ this.clusterConnectionManager.injectReplicator((Replicator) postOffice);
+
+ this.connectionManager.injectReplicator((Replicator) postOffice);
+
+ ((MessagingPostOffice) postOffice).injectServerPeer(this);
+ }
+
+ // Also need to inject into txRepository
+ txRepository.injectPostOffice(postOffice);
+
started = true;
-
log.info("JBoss Messaging " + getVersion().getProviderVersion() + " server [" +
- getServerPeerID()+ "] started");
+ Configuration.getServerPeerID() + "] started");
}
catch (Throwable t)
{
@@ -318,7 +275,7 @@
}
}
- public synchronized void stopService() throws Exception
+ public synchronized void stop() throws Exception
{
try
{
@@ -328,9 +285,9 @@
}
log.info(this + " is Stopping. NOTE! Stopping the server peer cleanly will NOT cause failover to occur");
-
+
started = false;
-
+
//Tell the invocation handler we are closed - this is so we don't attempt to handle
//any invocations when we are in a partial closing down state - which can give strange
//"object not found with id" exceptions and stuff like that
@@ -365,7 +322,7 @@
clusterConnectionManager.stop();
clusterConnectionManager = null;
postOffice = null;
-
+
unloadServerAOPConfig();
// TODO unloadClientAOPConfig();
@@ -382,80 +339,6 @@
// JMX Attributes -------------------------------------------------------------------------------
- // Plugins
-
- public synchronized ObjectName getPersistenceManager()
- {
- return persistenceManagerObjectName;
- }
-
- public synchronized void setPersistenceManager(ObjectName on)
- {
- if (started)
- {
- log.warn("Cannot set persistence manager on server peer when server peer is started");
- return;
- }
- persistenceManagerObjectName = on;
- }
-
- public synchronized ObjectName getPostOffice()
- {
- return postOfficeObjectName;
- }
-
- public synchronized void setPostOffice(ObjectName on)
- {
- if (started)
- {
- log.warn("Cannot set post office on server peer when server peer is started");
- return;
- }
- postOfficeObjectName = on;
- }
-
- public synchronized ObjectName getJmsUserManager()
- {
- return jmsUserManagerObjectName;
- }
-
- public synchronized void setJMSUserManager(ObjectName on)
- {
- if (started)
- {
- log.warn("Cannot set jms user manager on server peer when server peer is started");
- return;
- }
- jmsUserManagerObjectName = on;
- }
-
- public synchronized ObjectName getDefaultDLQ()
- {
- return defaultDLQObjectName;
- }
-
- public synchronized void setDefaultDLQ(ObjectName on)
- {
- defaultDLQObjectName = on;
- }
-
- public synchronized ObjectName getDefaultExpiryQueue()
- {
- return defaultExpiryQueueObjectName;
- }
-
- public synchronized void setDefaultExpiryQueue(ObjectName on)
- {
- this.defaultExpiryQueueObjectName = on;
- }
-
- // Instance access
-
- public Object getInstance()
- {
- return this;
- }
-
//read only JMX attributes
public String getJMSVersion()
@@ -492,348 +375,77 @@
{
return version.getProviderMinorVersion();
}
-
+
//Read - write attributes
- public synchronized void setSecurityDomain(String securityDomain) throws Exception
- {
- try
- {
- securityStore.setSecurityDomain(securityDomain);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " setSecurityDomain");
- }
- }
-
- public synchronized String getSecurityDomain()
- {
- return securityStore.getSecurityDomain();
- }
-
- public synchronized void setDefaultSecurityConfig(Element conf) throws Exception
- {
- securityStore.setDefaultSecurityConfig(conf);
- }
-
- public synchronized Element getDefaultSecurityConfig()
- {
- return securityStore.getDefaultSecurityConfig();
- }
-
- public synchronized long getFailoverStartTimeout()
- {
- return this.failoverStartTimeout;
- }
-
- public synchronized void setFailoverStartTimeout(long timeout)
- {
- this.failoverStartTimeout = timeout;
- }
-
- public synchronized long getFailoverCompleteTimeout()
- {
- return this.failoverCompleteTimeout;
- }
-
- public synchronized void setFailoverCompleteTimeout(long timeout)
- {
- this.failoverCompleteTimeout = timeout;
- }
-
- public synchronized int getDefaultMaxDeliveryAttempts()
- {
- return defaultMaxDeliveryAttempts;
- }
-
- public synchronized void setDefaultMaxDeliveryAttempts(int attempts)
- {
- this.defaultMaxDeliveryAttempts = attempts;
- }
-
- public synchronized long getMessageCounterSamplePeriod()
- {
- return messageCounterSamplePeriod;
- }
-
- public synchronized void setMessageCounterSamplePeriod(long newPeriod)
- {
- if (newPeriod < 1000)
- {
- throw new IllegalArgumentException("Cannot set MessageCounterSamplePeriod < 1000 ms");
- }
-
- if (messageCounterManager != null && newPeriod != messageCounterSamplePeriod)
- {
- messageCounterManager.reschedule(newPeriod);
- }
-
- this.messageCounterSamplePeriod = newPeriod;
- }
-
- public synchronized long getDefaultRedeliveryDelay()
- {
- return defaultRedeliveryDelay;
- }
-
- public synchronized void setDefaultRedeliveryDelay(long delay)
- {
- this.defaultRedeliveryDelay = delay;
- }
-
- public synchronized int getDefaultMessageCounterHistoryDayLimit()
- {
- return defaultMessageCounterHistoryDayLimit;
- }
-
- public void setDefaultMessageCounterHistoryDayLimit(int limit)
- {
- if (limit < -1)
- {
- limit = -1;
- }
-
- this.defaultMessageCounterHistoryDayLimit = limit;
- }
-
- public String getClusterPullConnectionFactoryName()
- {
- return clusterPullConnectionFactoryName;
- }
-
- public void setClusterPullConnectionFactoryName(String name)
- {
- if (started)
- {
- throw new IllegalStateException("Cannot set ClusterPullConnectionFactoryName while the service is running");
- }
- this.clusterPullConnectionFactoryName = name;
- }
-
- public boolean isUseXAForMessagePull()
- {
- return useXAForMessagePull;
- }
-
- public void setUseXAForMessagePull(boolean useXA) throws Exception
- {
- if (started)
- {
- throw new IllegalStateException("Cannot set UseXAForMessagePull while the service is running");
- }
-
- this.useXAForMessagePull = useXA;
- }
-
- public boolean isDefaultPreserveOrdering()
- {
- return defaultPreserveOrdering;
- }
-
- public void setDefaultPreserveOrdering(boolean preserve) throws Exception
- {
- if (started)
- {
- throw new IllegalStateException("Cannot set DefaultPreserveOrdering while the service is running");
- }
-
- this.defaultPreserveOrdering = preserve;
- }
-
- public long getRecoverDeliveriesTimeout()
- {
- return this.recoverDeliveriesTimeout;
- }
-
- public void setRecoverDeliveriesTimeout(long timeout)
- {
- this.recoverDeliveriesTimeout = timeout;
- }
-
- public synchronized void setServerPeerID(int serverPeerID)
- {
- if (started)
- {
- throw new IllegalStateException("Cannot set ServerPeerID while the service is running");
- }
- if (serverPeerID < 0)
- {
- throw new IllegalArgumentException("Attempt to set negative ServerPeerID: " + serverPeerID);
- }
- this.serverPeerID = serverPeerID;
- }
-
- public int getServerPeerID()
- {
- return serverPeerID;
- }
-
- public String getDefaultQueueJNDIContext()
- {
- return defaultQueueJNDIContext;
- }
-
- public synchronized void setDefaultQueueJNDIContext(String defaultQueueJNDIContext)
- {
- if (started)
- {
- throw new IllegalStateException("Cannot set DefaultQueueJNDIContext while the service is running");
- }
-
- this.defaultQueueJNDIContext = defaultQueueJNDIContext;
- }
-
- public String getDefaultTopicJNDIContext()
- {
- return defaultTopicJNDIContext;
- }
-
- public synchronized void setDefaultTopicJNDIContext(String defaultTopicJNDIContext)
- {
- if (started)
- {
- throw new IllegalStateException("Cannot set DefaultTopicJNDIContext while the service is running");
- }
-
- this.defaultTopicJNDIContext = defaultTopicJNDIContext;
- }
-
- public synchronized void setSuckerPassword(String password)
- {
- if (started)
- {
- throw new IllegalStateException("Cannot set SuckerPassword while the service is running");
- }
-
- if (password == null)
- {
- throw new IllegalArgumentException("SuckerPassword cannot be null");
- }
-
- this.suckerPassword = password;
- }
-
- public void setStrictTck(boolean strictTck)
- {
- this.strictTck = strictTck || strictTckProperty;
- }
-
- public boolean isStrictTck()
- {
- return strictTck || strictTckProperty;
- }
-
public void enableMessageCounters()
- {
+ {
messageCounterManager.start();
}
-
+
public void disableMessageCounters()
{
messageCounterManager.stop();
-
+
messageCounterManager.resetAllCounters();
-
+
messageCounterManager.resetAllCounterHistories();
}
-
+
// JMX Operations -------------------------------------------------------------------------------
public String deployQueue(String name, String jndiName) throws Exception
{
- try
- {
- return deployDestinationDefault(true, name, jndiName);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " createQueue");
- }
+ return destinationDeployer.deployQueue(name, jndiName, -1, -1, -1);
}
public String deployQueue(String name, String jndiName, int fullSize, int pageSize, int downCacheSize) throws Exception
{
- try
- {
- return deployDestination(true, name, jndiName, fullSize, pageSize, downCacheSize);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " createQueue(2)");
- }
+ return destinationDeployer.deployQueue(name, jndiName, fullSize, pageSize, downCacheSize);
}
public boolean destroyQueue(String name) throws Exception
{
try
{
- return destroyDestination(true, name);
+ return destinationDeployer.destroyQueue(name);
}
- catch (Throwable t)
+ catch (Throwable throwable)
{
- throw ExceptionUtil.handleJMXInvocation(t, this + " destroyQueue");
+ throw new Exception(throwable);
}
}
-
+
public boolean undeployQueue(String name) throws Exception
{
- try
- {
- return undeployDestination(true, name);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " destroyQueue");
- }
+ return destinationDeployer.undeployQueue(name);
}
public String deployTopic(String name, String jndiName) throws Exception
{
- try
- {
- return deployDestinationDefault(false, name, jndiName);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " createTopic");
- }
+ return destinationDeployer.deployTopic(name, jndiName, -1, -1, -1);
}
public String deployTopic(String name, String jndiName, int fullSize, int pageSize, int downCacheSize) throws Exception
{
- try
- {
- return deployDestination(false, name, jndiName, fullSize, pageSize, downCacheSize);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " createTopic(2)");
- }
+ return destinationDeployer.deployTopic(name, jndiName, fullSize, pageSize, downCacheSize);
}
public boolean destroyTopic(String name) throws Exception
{
try
{
- return destroyDestination(false, name);
+ return destinationDeployer.destroyTopic(name);
}
- catch (Throwable t)
+ catch (Throwable throwable)
{
- throw ExceptionUtil.handleJMXInvocation(t, this + " destroyTopic");
+ throw new Exception(throwable);
}
}
-
+
public boolean undeployTopic(String name) throws Exception
{
- try
- {
- return undeployDestination(false, name);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " destroyTopic");
- }
+ return destinationDeployer.undeployTopic(name);
}
public Set getDestinations() throws Exception
@@ -847,11 +459,11 @@
throw ExceptionUtil.handleJMXInvocation(t, this + " getDestinations");
}
}
-
+
public List getMessageCounters() throws Exception
{
Collection counters = messageCounterManager.getMessageCounters();
-
+
return new ArrayList(counters);
}
@@ -864,27 +476,29 @@
{
List counters = getMessageCounters();
- Collections.sort(counters, new Comparator() {
- public int compare(Object o1, Object o2) {
- MessageCounter m1 = (MessageCounter)o1;
- MessageCounter m2 = (MessageCounter)o2;
- return m1.getDestinationName().compareTo(m2.getDestinationName());
- }
+ Collections.sort(counters, new Comparator()
+ {
+ public int compare(Object o1, Object o2)
+ {
+ MessageCounter m1 = (MessageCounter) o1;
+ MessageCounter m2 = (MessageCounter) o2;
+ return m1.getDestinationName().compareTo(m2.getDestinationName());
+ }
});
String ret =
- "<table width=\"100%\" border=\"1\" cellpadding=\"1\" cellspacing=\"1\">"
- + "<tr>"
- + "<th>Type</th>"
- + "<th>Name</th>"
- + "<th>Subscription</th>"
- + "<th>Durable</th>"
- + "<th>Count</th>"
- + "<th>CountDelta</th>"
- + "<th>Depth</th>"
- + "<th>DepthDelta</th>"
- + "<th>Last Add</th>"
- + "</tr>";
+ "<table width=\"100%\" border=\"1\" cellpadding=\"1\" cellspacing=\"1\">"
+ + "<tr>"
+ + "<th>Type</th>"
+ + "<th>Name</th>"
+ + "<th>Subscription</th>"
+ + "<th>Durable</th>"
+ + "<th>Count</th>"
+ + "<th>CountDelta</th>"
+ + "<th>Depth</th>"
+ + "<th>DepthDelta</th>"
+ + "<th>Last Add</th>"
+ + "</tr>";
String strNameLast = null;
String strTypeLast = null;
@@ -903,11 +517,11 @@
// needed during output of last module data string
Iterator iter = counters.iterator();
-
+
while (iter.hasNext())
{
- MessageCounter counter = (MessageCounter)iter.next();
-
+ MessageCounter counter = (MessageCounter) iter.next();
+
// get counter data
StringTokenizer tokens = new StringTokenizer(counter.getCounterAsString(), ",");
@@ -953,17 +567,17 @@
{
// store last destination data string
ret += "<tr bgcolor=\"#"
- + ((i % 2) == 0 ? "FFFFFF" : "F0F0F0")
- + "\"><td rowspan=\""
- + destCount
- + "\">"
- + strTypeLast
- + "</td><td rowspan=\""
- + destCount
- + "\">"
- + strNameLast
- + "</td>"
- + destData;
+ + ((i % 2) == 0 ? "FFFFFF" : "F0F0F0")
+ + "\"><td rowspan=\""
+ + destCount
+ + "\">"
+ + strTypeLast
+ + "</td><td rowspan=\""
+ + destCount
+ + "\">"
+ + strNameLast
+ + "</td>"
+ + destData;
destData = "";
}
@@ -973,26 +587,26 @@
// counter data row
destData += "<td>"
- + strSub
- + "</td>"
- + "<td>"
- + strDurable
- + "</td>"
- + "<td>"
- + strCount
- + "</td>"
- + "<td>"
- + strCountDelta
- + "</td>"
- + "<td>"
- + strDepth
- + "</td>"
- + "<td>"
- + strDepthDelta
- + "</td>"
- + "<td>"
- + strDate
- + "</td>";
+ + strSub
+ + "</td>"
+ + "<td>"
+ + strDurable
+ + "</td>"
+ + "<td>"
+ + strCount
+ + "</td>"
+ + "<td>"
+ + strCountDelta
+ + "</td>"
+ + "<td>"
+ + strDepth
+ + "</td>"
+ + "<td>"
+ + strDepthDelta
+ + "</td>"
+ + "<td>"
+ + strDate
+ + "</td>";
// store current destination data for change detection
strTypeLast = strType;
@@ -1004,31 +618,31 @@
{
// store last module data string
ret += "<tr bgcolor=\"#"
- + ((i % 2) == 0 ? "FFFFFF" : "F0F0F0")
- + "\"><td rowspan=\""
- + destCount
- + "\">"
- + strTypeLast
- + "</td><td rowspan=\""
- + destCount
- + "\">"
- + strNameLast
- + "</td>"
- + destData;
+ + ((i % 2) == 0 ? "FFFFFF" : "F0F0F0")
+ + "\"><td rowspan=\""
+ + destCount
+ + "\">"
+ + strTypeLast
+ + "</td><td rowspan=\""
+ + destCount
+ + "\">"
+ + strNameLast
+ + "</td>"
+ + destData;
}
// append summation info
ret += "<tr>"
- + "<td><![CDATA[ ]]></td><td><![CDATA[ ]]></td>"
- + "<td><![CDATA[ ]]></td><td><![CDATA[ ]]></td><td>"
- + countTotal
- + "</td><td>"
- + (countDeltaTotal == 0 ? "-" : Integer.toString(countDeltaTotal))
- + "</td><td>"
- + depthTotal
- + "</td><td>"
- + (depthDeltaTotal == 0 ? "-" : Integer.toString(depthDeltaTotal))
- + "</td><td>Total</td></tr></table>";
+ + "<td><![CDATA[ ]]></td><td><![CDATA[ ]]></td>"
+ + "<td><![CDATA[ ]]></td><td><![CDATA[ ]]></td><td>"
+ + countTotal
+ + "</td><td>"
+ + (countDeltaTotal == 0 ? "-" : Integer.toString(countDeltaTotal))
+ + "</td><td>"
+ + depthTotal
+ + "</td><td>"
+ + (depthDeltaTotal == 0 ? "-" : Integer.toString(depthDeltaTotal))
+ + "</td><td>Total</td></tr></table>";
return ret;
}
@@ -1037,12 +651,12 @@
{
messageCounterManager.resetAllCounters();
}
-
+
public void resetAllMessageCounterHistories()
{
messageCounterManager.resetAllCounterHistories();
}
-
+
public List retrievePreparedTransactions()
{
return txRepository.getPreparedTransactions();
@@ -1056,7 +670,7 @@
buffer.append("<tr><th>Xid</th></tr>");
for (Iterator i = txs.iterator(); i.hasNext();)
{
- Xid xid = (Xid)i.next();
+ Xid xid = (Xid) i.next();
if (xid != null)
{
buffer.append("<tr><td>");
@@ -1095,22 +709,22 @@
}
// Public ---------------------------------------------------------------------------------------
-
+
public void resetAllSuckers()
{
- clusterConnectionManager.resetAllSuckers();
+ clusterConnectionManager.resetAllSuckers();
}
-
+
public byte[] getClientAOPStack()
{
return clientAOPStack;
}
-
+
public MessageCounterManager getMessageCounterManager()
{
return messageCounterManager;
}
-
+
public IDManager getMessageIDManager()
{
return messageIDManager;
@@ -1120,22 +734,22 @@
{
return channelIDManager;
}
-
+
public ServerSessionEndpoint getSession(String sessionID)
{
- return (ServerSessionEndpoint)sessions.get(sessionID);
+ return (ServerSessionEndpoint) sessions.get(sessionID);
}
-
+
public Collection getSessions()
{
- return sessions.values();
+ return sessions.values();
}
-
+
public void addSession(String id, ServerSessionEndpoint session)
{
- sessions.put(id, session);
+ sessions.put(id, session);
}
-
+
public void removeSession(String id)
{
if (sessions.remove(id) == null)
@@ -1147,74 +761,56 @@
public synchronized Queue getDefaultDLQInstance() throws Exception
{
Queue dlq = null;
-
- if (defaultDLQObjectName != null)
- {
- ManagedQueue dest = null;
- // This can be null... JMXAccessor will return null if InstanceNotFoundException is caught
- dest = (ManagedQueue) JMXAccessor.getJMXAttributeOverSecurity(getServer(), defaultDLQObjectName, "Instance");
+ if (Configuration.getDefaultDLQ() != null)
+ {
- if (dest != null && dest.getName() != null)
- {
- Binding binding = postOffice.getBindingForQueueName(dest.getName());
-
- if (binding == null)
- {
- throw new IllegalStateException("Cannot find binding for queue " + dest.getName());
- }
-
- Queue queue = binding.queue;
-
- if (queue.isActive())
- {
- dlq = queue;
- }
+ Binding binding = postOffice.getBindingForQueueName(Configuration.getDefaultDLQ());
+
+ if (binding == null)
+ {
+ throw new IllegalStateException("Cannot find binding for queue " + Configuration.getDefaultDLQ());
}
+
+ Queue queue = binding.queue;
+
+ if (queue.isActive())
+ {
+ dlq = queue;
+ }
}
-
+
return dlq;
}
-
+
public synchronized Queue getDefaultExpiryQueueInstance() throws Exception
{
Queue expiryQueue = null;
-
- if (defaultExpiryQueueObjectName != null)
+
+ if (Configuration.getDefaultExpiryQueue() != null)
{
- ManagedQueue dest = null;
-
- try
- {
- dest = (ManagedQueue)JMXAccessor.getJMXAttributeOverSecurity(getServer(), defaultExpiryQueueObjectName, "Instance");
- }
- catch (InstanceNotFoundException e)
+ if (Configuration.getDefaultDLQ() != null)
{
- //Ok
- }
+ Binding binding = postOffice.getBindingForQueueName(Configuration.getDefaultExpiryQueue());
- if (dest != null && dest.getName() != null)
- {
- Binding binding = postOffice.getBindingForQueueName(dest.getName());
-
if (binding == null)
{
- throw new IllegalStateException("Cannot find binding for queue " + dest.getName());
+ throw new IllegalStateException("Cannot find binding for queue " + Configuration.getDefaultExpiryQueue());
}
-
- Queue queue = binding.queue;
-
+
+ Queue queue = binding.queue;
+
if (queue.isActive())
{
- expiryQueue = queue;
+ expiryQueue = queue;
}
}
}
-
+
return expiryQueue;
}
-
+
public TransactionRepository getTxRepository()
{
return txRepository;
@@ -1274,52 +870,45 @@
return persistenceManager;
}
+ public void setPersistenceManager(PersistenceManager persistenceManager)
+ {
+ this.persistenceManager = persistenceManager;
+ }
+
public JMSUserManager getJmsUserManagerInstance()
{
return jmsUserManager;
}
- public PostOffice getPostOfficeInstance() throws Exception
+
+ public void setJmsUserManager(JMSUserManager jmsUserManager)
{
- // We get the reference lazily to avoid problems with MBean circular dependencies
- if (postOffice == null)
- {
- postOffice = (PostOffice)JMXAccessor.getJMXAttributeOverSecurity(getServer(), postOfficeObjectName, "Instance");
- // We also inject the replicator dependency into the ConnectionFactoryJNDIMapper. This is
- // a bit messy but we have a circular dependency POJOContainer should be able to help us
- // here. Yes, this is nasty.
+ this.jmsUserManager = jmsUserManager;
+ }
- if (postOffice.isClustered())
- {
- Replicator rep = (Replicator)postOffice;
-
- connFactoryJNDIMapper.injectReplicator(rep);
-
- // Also inject into the cluster connection manager
-
- this.clusterConnectionManager.injectPostOffice(postOffice);
-
- this.clusterConnectionManager.injectReplicator((Replicator)postOffice);
-
- this.connectionManager.injectReplicator((Replicator)postOffice);
-
- ((MessagingPostOffice)postOffice).injectServerPeer(this);
- }
-
- // Also need to inject into txRepository
- txRepository.injectPostOffice(postOffice);
- }
+ public PostOffice getPostOffice() throws Exception
+ {
return postOffice;
}
+ public void setPostOffice(PostOffice postOffice)
+ {
+ this.postOffice = postOffice;
+ }
+
public ClusterNotifier getClusterNotifier()
{
- return clusterNotifier;
+ return clusterNotifier;
}
-
+
+ public void setClusterNotifier(ClusterNotifier clusterNotifier)
+ {
+ this.clusterNotifier = clusterNotifier;
+ }
+
public FailoverWaiter getFailoverWaiter()
{
- return failoverWaiter;
+ return failoverWaiter;
}
public boolean isSupportsFailover()
@@ -1332,14 +921,14 @@
if (started)
{
throw new IllegalAccessException("supportsFailover can only be changed when " +
- "server peer is stopped");
+ "server peer is stopped");
}
this.supportsFailover = supportsFailover;
}
public String toString()
{
- return "ServerPeer[" + getServerPeerID() + "]";
+ return "ServerPeer[" + Configuration.getServerPeerID() + "]";
}
// Package protected ----------------------------------------------------------------------------
@@ -1347,7 +936,7 @@
// Protected ------------------------------------------------------------------------------------
// Private --------------------------------------------------------------------------------------
-
+
private void loadServerAOPConfig() throws Exception
{
URL url = this.getClass().getClassLoader().getResource("aop-messaging-server.xml");
@@ -1393,189 +982,20 @@
}
}
- private String deployDestinationDefault(boolean isQueue, String name, String jndiName)
- throws Exception
+ public List listAllMessages(String queueName) throws Exception
{
- //
- // TODO - THIS IS A TEMPORARY IMPLEMENTATION; WILL BE REPLACED WITH INTEGRATION-CONSISTENT ONE
- // TODO - if I find a way not using UnifiedClassLoader3 directly, then get rid of
- // <path refid="jboss.jmx.classpath"/> from jms/build.xml dependentmodule.classpath
- //
+ return ((ManagedQueue) getDestinationManager().getDestination(queueName, true)).listAllMessages(null);
+ }
- //TODO - Yes this is super-ugly - there must be an easier way of doing it
- //also in LocalTestServer is doing the same thing in a slightly different way
- //this should be combined
- String destType = isQueue ? "Queue" : "Topic";
- String className = "org.jboss.jms.server.destination." + destType + "Service";
- String ons ="jboss.messaging.destination:service="+ destType + ",name=" + name;
- ObjectName on = new ObjectName(ons);
-
- String destinationMBeanConfig =
- "<mbean code=\"" + className + "\" " +
- " name=\"" + ons + "\" " +
- " xmbean-dd=\"xmdesc/" + destType + "-xmbean.xml\">\n" +
- " <constructor>" +
- " <arg type=\"boolean\" value=\"true\"/>" +
- " </constructor>" +
- "</mbean>";
-
- return deployDestinationInternal(destinationMBeanConfig, on, jndiName, false, -1, -1, -1);
- }
-
- private String deployDestination(boolean isQueue, String name, String jndiName, int fullSize,
- int pageSize, int downCacheSize) throws Exception
+ public DestinationDeployer getDestinationDeployer()
{
- //
- // TODO - THIS IS A TEMPORARY IMPLEMENTATION; WILL BE REPLACED WITH INTEGRATION-CONSISTENT ONE
- // TODO - if I find a way not using UnifiedClassLoader3 directly, then get rid of
- // <path refid="jboss.jmx.classpath"/> from jms/build.xml dependentmodule.classpath
- //
-
- String destType = isQueue ? "Queue" : "Topic";
- String className = "org.jboss.jms.server.destination." + destType + "Service";
-
- String ons ="jboss.messaging.destination:service="+ destType + ",name=" + name;
- ObjectName on = new ObjectName(ons);
-
- String destinationMBeanConfig =
- "<mbean code=\"" + className + "\" " +
- " name=\"" + ons + "\" " +
- " xmbean-dd=\"xmdesc/" + destType + "-xmbean.xml\">\n" +
- " <constructor>" +
- " <arg type=\"boolean\" value=\"true\"/>" +
- " </constructor>" +
- " <attribute name=\"FullSize\">" + fullSize + "</attribute>" +
- " <attribute name=\"PageSize\">" + pageSize + "</attribute>" +
- " <attribute name=\"DownCacheSize\">" + downCacheSize + "</attribute>" +
- "</mbean>";
-
- return deployDestinationInternal(destinationMBeanConfig, on, jndiName, true, fullSize,
- pageSize, downCacheSize);
+ return destinationDeployer;
}
- private String deployDestinationInternal(String destinationMBeanConfig, ObjectName on,
- String jndiName, boolean params, int fullSize,
- int pageSize, int downCacheSize) throws Exception
+ public void setDestinationDeployer(DestinationDeployer destinationDeployer)
{
- log.trace("Deploying destination" + destinationMBeanConfig + " jndiName: " + jndiName +
- "fullSize: " + fullSize + " pageSize: " + pageSize + " downCacheSize: " + downCacheSize);
-
- MBeanServer mbeanServer = getServer();
-
- Element element = Util.stringToElement(destinationMBeanConfig);
-
- ServiceCreator sc = new ServiceCreator(mbeanServer);
-
- ClassLoader cl = this.getClass().getClassLoader();
- ObjectName loaderObjectName = null;
- if (cl instanceof UnifiedClassLoader3)
- {
- loaderObjectName = ((UnifiedClassLoader3)cl).getObjectName();
- }
-
- sc.install(on, loaderObjectName, element);
-
- // inject dependencies
- mbeanServer.setAttribute(on, new Attribute("ServerPeer", getServiceName()));
- mbeanServer.setAttribute(on, new Attribute("JNDIName", jndiName));
- if (params)
- {
- mbeanServer.setAttribute(on, new Attribute("FullSize", new Integer(fullSize)));
- mbeanServer.setAttribute(on, new Attribute("PageSize", new Integer(pageSize)));
- mbeanServer.setAttribute(on, new Attribute("DownCacheSize", new Integer(downCacheSize)));
- }
- mbeanServer.invoke(on, "create", new Object[0], new String[0]);
- mbeanServer.invoke(on, "start", new Object[0], new String[0]);
-
- return (String)JMXAccessor.getJMXAttributeOverSecurity(mbeanServer, on, "JNDIName");
+ this.destinationDeployer = destinationDeployer;
}
-
-
- /*
- * Undeploy the MBean but don't delete the underlying data
- */
- private boolean undeployDestination(boolean isQueue, String name) throws Exception
- {
- String destType = isQueue ? "Queue" : "Topic";
- String ons ="jboss.messaging.destination:service=" + destType + ",name=" + name;
- ObjectName on = new ObjectName(ons);
-
- MBeanServer mbeanServer = getServer();
-
- // we can only undeploy destinations that exist AND that have been created programatically
- if (!mbeanServer.isRegistered(on))
- {
- return false;
- }
- Boolean b = (Boolean)JMXAccessor.getJMXAttributeOverSecurity(mbeanServer, on, "CreatedProgrammatically");
- if (!b.booleanValue())
- {
- log.warn("Cannot undeploy a destination that has not been created programatically");
- return false;
- }
- mbeanServer.invoke(on, "stop", new Object[0], new String[0]);
- mbeanServer.invoke(on, "destroy", new Object[0], new String[0]);
- mbeanServer.unregisterMBean(on);
- return true;
- }
-
- /*
- * Undeploy the MBean and delete the underlying data
- */
- private boolean destroyDestination(boolean isQueue, String name) throws Throwable
- {
- String destType = isQueue ? "Queue" : "Topic";
- String ons ="jboss.messaging.destination:service=" + destType + ",name=" + name;
- ObjectName on = new ObjectName(ons);
-
- MBeanServer mbeanServer = getServer();
-
- // we can only destroy destinations that exist AND that have been created programatically
- if (!mbeanServer.isRegistered(on))
- {
- return false;
- }
-
- JMSCondition condition = new JMSCondition(isQueue, name);
-
- Collection queues = postOffice.getQueuesForCondition(condition, true);
-
- Iterator iter = queues.iterator();
-
- while (iter.hasNext())
- {
- Queue queue = (Queue)iter.next();
-
- queue.removeAllReferences();
- }
-
- //undeploy the mbean
- if (!undeployDestination(isQueue, name))
- {
- return false;
- }
-
- //Unbind the destination's queues
-
- while (iter.hasNext())
- {
- Queue queue = (Queue)iter.next();
-
- queue.removeAllReferences();
-
- //Durable subs need to be removed on all nodes
- boolean all = !isQueue && queue.isRecoverable();
-
- postOffice.removeBinding(queue.getName(), all);
- }
-
- return true;
- }
-
-
- // Inner classes --------------------------------------------------------------------------------
-
-
}
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -6,21 +6,20 @@
*/
package org.jboss.jms.server.connectionfactory;
-import java.util.Map;
-
-import javax.management.ObjectName;
-
import org.jboss.jms.client.plugin.LoadBalancingFactory;
import org.jboss.jms.server.ConnectionFactoryManager;
import org.jboss.jms.server.ConnectionManager;
import org.jboss.jms.server.ConnectorManager;
import org.jboss.jms.server.ServerPeer;
+import org.jboss.logging.Logger;
import org.jboss.messaging.util.ExceptionUtil;
-import org.jboss.messaging.util.JMXAccessor;
+import org.jboss.remoting.ConnectionListener;
import org.jboss.remoting.InvokerLocator;
-import org.jboss.system.ServiceMBeanSupport;
-import org.w3c.dom.Element;
+import org.jboss.remoting.transport.Connector;
+import java.util.List;
+import java.util.Map;
+
/**
* A deployable JBoss Messaging connection factory.
*
@@ -34,17 +33,17 @@
*
* $Id$
*/
-public class ConnectionFactory extends ServiceMBeanSupport
+public class ConnectionFactory
{
// Constants ------------------------------------------------------------------------------------
// Static ---------------------------------------------------------------------------------------
-
+ private static final Logger log = Logger.getLogger(ConnectionFactory.class);
// Attributes -----------------------------------------------------------------------------------
private String clientID;
- private JNDIBindings jndiBindings;
+ private List<String> jndiBindings;
private int prefetchSize = 150;
@@ -64,7 +63,7 @@
private int dupsOKBatchSize = 1000;
- private ObjectName serverPeerObjectName;
+ private ServerPeer serverPeer;
private ConnectionFactoryManager connectionFactoryManager;
@@ -72,7 +71,7 @@
private ConnectionManager connectionManager;
- private ObjectName connectorObjectName;
+ private Connector connector;
private boolean started;
@@ -80,6 +79,7 @@
private boolean disableRemotingChecks;
+ private String name;
// Constructors ---------------------------------------------------------------------------------
public ConnectionFactory()
@@ -97,7 +97,7 @@
// ServiceMBeanSupport overrides ----------------------------------------------------------------
- public synchronized void startService() throws Exception
+ public synchronized void start() throws Exception
{
try
{
@@ -105,22 +105,20 @@
started = true;
- if (connectorObjectName == null)
+ if (connector == null)
{
throw new IllegalArgumentException("A Connector must be specified for " +
"each Connection Factory");
}
- if (serverPeerObjectName == null)
+ if (serverPeer == null)
{
throw new IllegalArgumentException("ServerPeer must be specified for " +
"each Connection Factory");
}
- String locatorURI = (String)JMXAccessor.getJMXAttributeOverSecurity(server, connectorObjectName, "InvokerLocator");
+ String locatorURI = connector.getInvokerLocator();
- ServerPeer serverPeer = (ServerPeer)JMXAccessor.getJMXAttributeOverSecurity(server, serverPeerObjectName, "Instance");
-
if (!serverPeer.isSupportsFailover())
{
this.supportsFailover = false;
@@ -180,10 +178,9 @@
connectorManager = serverPeer.getConnectorManager();
connectionManager = serverPeer.getConnectionManager();
- int refCount = connectorManager.registerConnector(connectorObjectName.getCanonicalName());
+ int refCount = connectorManager.registerConnector(getName());
- long leasePeriod = (Long)JMXAccessor.getJMXAttributeOverSecurity(server, connectorObjectName, "LeasePeriod");
-
+ long leasePeriod = connector.getLeasePeriod();
// if leasePeriod <= 0, disable pinging altogether
boolean enablePing = leasePeriod > 0;
@@ -195,15 +192,13 @@
// calback fails
// install the connection listener that listens for failed connections
- server.invoke(connectorObjectName, "addConnectionListener",
- new Object[] {connectionManager},
- new String[] {"org.jboss.remoting.ConnectionListener"});
+ connector.addConnectionListener((ConnectionListener) connectionManager);
}
// We use the MBean service name to uniquely identify the connection factory
connectionFactoryManager.
- registerConnectionFactory(getServiceName().getCanonicalName(), clientID, jndiBindings,
+ registerConnectionFactory(getName(), clientID, jndiBindings,
locatorURI, enablePing, prefetchSize, slowConsumers,
defaultTempQueueFullSize, defaultTempQueuePageSize,
defaultTempQueueDownCacheSize, dupsOKBatchSize, supportsFailover, supportsLoadBalancing,
@@ -237,8 +232,8 @@
started = false;
connectionFactoryManager.
- unregisterConnectionFactory(getServiceName().getCanonicalName(), supportsFailover, supportsLoadBalancing);
- connectorManager.unregisterConnector(connectorObjectName.getCanonicalName());
+ unregisterConnectionFactory(getName(), supportsFailover, supportsLoadBalancing);
+ connectorManager.unregisterConnector(getName());
log.info(this + " undeployed");
}
@@ -305,56 +300,42 @@
return clientID;
}
- public void setJNDIBindings(Element e) throws Exception
+ public void setJNDIBindings(List<String> bindings) throws Exception
{
- jndiBindings = new JNDIBindings(e);
+ jndiBindings = bindings;
}
- public Element getJNDIBindings()
+ public List<String> getJNDIBindings()
{
if (jndiBindings == null)
{
return null;
}
- return jndiBindings.getDelegate();
+ return jndiBindings;
}
- public void setServerPeer(ObjectName on)
- {
- if (started)
- {
- log.warn("Cannot change the value of associated " +
- "server ObjectName after initialization!");
- return;
- }
+ public ServerPeer getServerPeer()
+ {
+ return serverPeer;
+ }
- serverPeerObjectName = on;
- }
+ public void setServerPeer(ServerPeer serverPeer)
+ {
+ this.serverPeer = serverPeer;
+ }
- public ObjectName getServerPeer()
- {
- return serverPeerObjectName;
- }
-
- public void setConnector(ObjectName on)
- {
- if (started)
- {
- log.warn("Cannot change the value of associated " +
- "connector ObjectName after initialization!");
- return;
- }
+ public Connector getConnector()
+ {
+ return connector;
+ }
- connectorObjectName = on;
- }
+ public void setConnector(Connector connector)
+ {
+ this.connector = connector;
+ }
- public ObjectName getConnector()
+ public boolean isSupportsFailover()
{
- return connectorObjectName;
- }
-
- public boolean isSupportsFailover()
- {
return supportsFailover;
}
@@ -450,6 +431,16 @@
this.disableRemotingChecks = disable;
}
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
// JMX managed operations -----------------------------------------------------------------------
// Public ---------------------------------------------------------------------------------------
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryJNDIMapper.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryJNDIMapper.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryJNDIMapper.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,19 +21,6 @@
*/
package org.jboss.jms.server.connectionfactory;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
import org.jboss.aop.AspectManager;
import org.jboss.jms.client.JBossConnectionFactory;
import org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate;
@@ -42,6 +29,7 @@
import org.jboss.jms.client.plugin.LoadBalancingPolicy;
import org.jboss.jms.client.plugin.NoLoadBalancingLoadBalancingFactory;
import org.jboss.jms.delegate.ConnectionFactoryDelegate;
+import org.jboss.jms.server.Configuration;
import org.jboss.jms.server.ConnectionFactoryManager;
import org.jboss.jms.server.ServerPeer;
import org.jboss.jms.server.endpoint.ServerConnectionFactoryEndpoint;
@@ -55,6 +43,11 @@
import org.jboss.messaging.util.Version;
import org.jboss.remoting.InvokerLocator;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.*;
+
/**
* @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
* @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
@@ -103,7 +96,7 @@
*/
public synchronized void registerConnectionFactory(String uniqueName,
String clientID,
- JNDIBindings jndiBindings,
+ List<String> jndiBindings,
String locatorURI,
boolean clientPing,
int prefetchSize,
@@ -165,10 +158,10 @@
boolean creatingClustered = (supportsFailover || supportsLoadBalancing) && replicator != null;
//The server peer strict setting overrides the connection factory
- boolean useStrict = serverPeer.isStrictTck() || strictTck;
+ boolean useStrict = Configuration.isStrictTck() || strictTck;
ClientConnectionFactoryDelegate localDelegate =
- new ClientConnectionFactoryDelegate(uniqueName, id, serverPeer.getServerPeerID(),
+ new ClientConnectionFactoryDelegate(uniqueName, id, Configuration.getServerPeerID(),
locatorURI, version, clientPing, useStrict);
log.debug(this + " created local delegate " + localDelegate);
@@ -245,12 +238,11 @@
throw new IllegalArgumentException("Cannot find endpoint with name " + uniqueName);
}
- JNDIBindings jndiBindings = endpoint.getJNDIBindings();
+ List<String> jndiBindings = endpoint.getJNDIBindings();
if (jndiBindings != null)
{
- List jndiNames = jndiBindings.getNames();
- for(Iterator i = jndiNames.iterator(); i.hasNext(); )
+ for(Iterator i = jndiBindings.iterator(); i.hasNext(); )
{
String jndiName = (String)i.next();
initialContext.unbind(jndiName);
@@ -258,7 +250,7 @@
}
}
- if (trace) { log.trace("Removing delegate from delegates list with key=" + uniqueName + " at serverPeerID=" + this.serverPeer.getServerPeerID()); }
+ if (trace) { log.trace("Removing delegate from delegates list with key=" + uniqueName + " at serverPeerID=" + Configuration.getServerPeerID()); }
ConnectionFactoryDelegate delegate = (ConnectionFactoryDelegate)delegates.remove(uniqueName);
@@ -308,7 +300,7 @@
// We respond to changes in the node-address mapping. This will be replicated whan a
// node joins / leaves the group. When this happens we need to rebind all connection factories with the new mapping.
- Map failoverMap = serverPeer.getPostOfficeInstance().getFailoverMap();
+ Map failoverMap = serverPeer.getPostOffice().getFailoverMap();
// Rebind
@@ -376,7 +368,7 @@
(ClientConnectionFactoryDelegate[])newDels.
toArray(new ClientConnectionFactoryDelegate[newDels.size()]);
- Map failoverMap = serverPeer.getPostOfficeInstance().getFailoverMap();
+ Map failoverMap = serverPeer.getPostOffice().getFailoverMap();
del.setDelegates(delArr);
del.setFailoverMap(failoverMap);
@@ -411,7 +403,7 @@
public String toString()
{
- return "Server[" + serverPeer.getServerPeerID() + "].ConnFactoryJNDIMapper";
+ return "Server[" + Configuration.getServerPeerID() + "].ConnFactoryJNDIMapper";
}
// Package protected ----------------------------------------------------------------------------
@@ -422,7 +414,7 @@
private void setupReplicator() throws Exception
{
- serverPeer.getPostOfficeInstance();
+ serverPeer.getPostOffice();
}
/**
@@ -442,7 +434,7 @@
(ClientConnectionFactoryDelegate[])sortedLocalDelegates.
toArray(new ClientConnectionFactoryDelegate[sortedLocalDelegates.size()]);
- Map failoverMap = serverPeer.getPostOfficeInstance().getFailoverMap();
+ Map failoverMap = serverPeer.getPostOffice().getFailoverMap();
LoadBalancingPolicy lbp = loadBalancingFactory.createLoadBalancingPolicy(delegates);
@@ -451,7 +443,7 @@
return new ClientClusteredConnectionFactoryDelegate(uniqueName, delegates, failoverMap, lbp, supportsFailover);
}
- private void rebindConnectionFactory(Context ic, JNDIBindings jndiBindings,
+ private void rebindConnectionFactory(Context ic, List<String> jndiBindings,
ConnectionFactoryDelegate delegate)
throws NamingException
{
@@ -459,8 +451,7 @@
if (jndiBindings != null)
{
- List jndiNames = jndiBindings.getNames();
- for(Iterator i = jndiNames.iterator(); i.hasNext(); )
+ for(Iterator i = jndiBindings.iterator(); i.hasNext(); )
{
String jndiName = (String)i.next();
log.debug(this + " rebinding " + cf + " as " + jndiName);
Added: 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 (rev 0)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/DestinationDeployer.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,470 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss 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.jms.server.destination;
+
+import org.jboss.jms.server.Configuration;
+import org.jboss.jms.server.JMSCondition;
+import org.jboss.jms.server.ServerPeer;
+import org.jboss.jms.server.messagecounter.MessageCounter;
+import org.jboss.jms.server.security.Role;
+import org.jboss.logging.Logger;
+import org.jboss.messaging.core.contract.Binding;
+import org.jboss.messaging.core.contract.PostOffice;
+import org.jboss.messaging.core.contract.Queue;
+import org.jboss.messaging.core.impl.MessagingQueue;
+import org.jboss.messaging.util.MessageQueueNameHelper;
+import org.jboss.messaging.util.XMLUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import java.net.URL;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+
+/**
+ * @author <a href="ataylor at redhat.com">Andy Taylor</a>
+ */
+public class DestinationDeployer
+{
+ private static final Logger log = Logger.getLogger(DestinationDeployer.class);
+ public static final String SUBSCRIPTION_MESSAGECOUNTER_PREFIX = "Subscription.";
+ private static final String QUEUE_MESSAGECOUNTER_PREFIX = "Queue.";
+
+ private ServerPeer serverPeer;
+
+ public void start() throws Exception
+ {
+ URL url = getClass().getClassLoader().getResource("jbm-destinations.xml");
+ Element e = XMLUtil.urlToElement(url);
+ NodeList children = e.getElementsByTagName("queue");
+ for (int i = 0; i < children.getLength(); i++)
+ {
+ String name = children.item(i).getAttributes().getNamedItem("name").getNodeValue();
+ String dlq = null;
+ String expq = null;
+ long delay = -1;
+ boolean clustered = false;
+ HashSet<Role> securityConfig = null;
+ NodeList attributes = children.item(i).getChildNodes();
+ for (int j = 0; j < attributes.getLength(); j++)
+ {
+ if ("dlq".equalsIgnoreCase(attributes.item(j).getNodeName()))
+ {
+ dlq = attributes.item(j).getTextContent();
+ }
+ else if ("expiryqueue".equalsIgnoreCase(attributes.item(j).getNodeName()))
+ {
+ expq = attributes.item(j).getTextContent();
+ }
+ else if ("redeliverydelay".equalsIgnoreCase(attributes.item(j).getNodeName()))
+ {
+ delay = Long.valueOf(attributes.item(j).getTextContent());
+ }
+ else if ("clustered".equalsIgnoreCase(attributes.item(j).getNodeName()))
+ {
+ clustered = Boolean.valueOf(attributes.item(j).getTextContent());
+ }
+ else if ("security".equalsIgnoreCase(attributes.item(j).getNodeName()))
+ {
+ securityConfig = getSecurity(attributes, j);
+ }
+ }
+ createQueue(name, clustered, delay, dlq, expq, securityConfig);
+ }
+ children = e.getElementsByTagName("topic");
+ for (int i = 0; i < children.getLength(); i++)
+ {
+ String name = children.item(i).getAttributes().getNamedItem("name").getNodeValue();
+ String dlq = null;
+ String expq = null;
+ long delay = -1;
+ boolean clustered = false;
+ NodeList attributes = children.item(i).getChildNodes();
+ HashSet<Role> securityConfig = null;
+ for (int j = 0; j < attributes.getLength(); j++)
+ {
+ if ("dlq".equalsIgnoreCase(attributes.item(j).getNodeName()))
+ {
+ dlq = attributes.item(j).getTextContent();
+ }
+ else if ("expiryqueue".equalsIgnoreCase(attributes.item(j).getNodeName()))
+ {
+ expq = attributes.item(j).getTextContent();
+ }
+ else if ("redeliverydelay".equalsIgnoreCase(attributes.item(j).getNodeName()))
+ {
+ delay = Long.valueOf(attributes.item(j).getTextContent());
+ }
+ else if ("clustered".equalsIgnoreCase(attributes.item(j).getNodeName()))
+ {
+ clustered = Boolean.valueOf(attributes.item(j).getTextContent());
+ }
+ else if ("security".equalsIgnoreCase(attributes.item(j).getNodeName()))
+ {
+ securityConfig = getSecurity(attributes, j);
+ }
+ }
+ createTopic(name, clustered, delay, dlq, expq, securityConfig);
+ }
+ }
+
+ private HashSet<Role> getSecurity(NodeList attributes, int j)
+ {
+ HashSet<Role> securityConfig;
+ securityConfig = new HashSet<Role>();
+ NodeList roles = attributes.item(j).getChildNodes();
+ for (int k = 0; k < roles.getLength(); k++)
+ {
+ if ("roles".equalsIgnoreCase(roles.item(k).getNodeName()))
+ {
+ Boolean read = roles.item(k).getAttributes().getNamedItem("read") != null && Boolean.valueOf(roles.item(k).getAttributes().getNamedItem("read").getNodeValue());
+ Boolean write = roles.item(k).getAttributes().getNamedItem("write") != null && Boolean.valueOf(roles.item(k).getAttributes().getNamedItem("write").getNodeValue());
+ Boolean create = roles.item(k).getAttributes().getNamedItem("create") != null && Boolean.valueOf(roles.item(k).getAttributes().getNamedItem("create").getNodeValue());
+ Role role = new Role(roles.item(k).getAttributes().getNamedItem("name").getNodeValue(),
+ read,
+ write,
+ create);
+ securityConfig.add(role);
+ }
+ }
+ return securityConfig;
+ }
+
+ private void createQueue(String name, boolean clustered, long delay, String dlq, String expq, HashSet<Role> securityConfig) throws Exception
+ {
+ JMSCondition queueCond = new JMSCondition(true, name);
+ ManagedQueue destination = new ManagedQueue();
+ destination.setRedeliveryDelay(delay);
+ destination.setClustered(clustered);
+ destination.setName(name);
+ destination.setDLQ(dlq);
+ destination.setExpiryQueue(expq);
+ destination.setSecurityConfig(securityConfig);
+ MessagingQueue queue = new MessagingQueue(Configuration.getServerPeerID(), destination.getName(),
+ serverPeer.getChannelIDManager().getID(),
+ serverPeer.getMessageStore(), serverPeer.getPersistenceManagerInstance(),
+ true,
+ destination.getMaxSize(), null,
+ destination.getFullSize(), destination.getPageSize(),
+ destination.getDownCacheSize(), destination.isClustered(),
+ Configuration.getRecoverDeliveriesTimeout());
+ boolean added = getServerPeer().getPostOffice().addBinding(new Binding(queueCond, queue, false), false);
+
+ if (added)
+ {
+ queue.activate();
+ }
+ else
+ {
+ getServerPeer().getPostOffice().getBindingForQueueName(name).queue.activate();
+ }
+ destination.setQueue(queue);
+ getServerPeer().getDestinationManager().registerDestination(destination);
+ }
+
+ private void createTopic(String name, boolean clustered, long delay, String dlq, String expq, HashSet<Role> securityConfig) throws Exception
+ {
+ ManagedTopic destination = new ManagedTopic();
+ destination.setName(name);
+ destination.setClustered(clustered);
+ destination.setRedeliveryDelay(delay);
+ destination.setDLQ(dlq);
+ destination.setExpiryQueue(expq);
+ destination.setSecurityConfig(securityConfig);
+ PostOffice po = serverPeer.getPostOffice();
+
+ // We deploy any queues corresponding to pre-existing durable subscriptions
+
+ Collection queues = po.getQueuesForCondition(new JMSCondition(false, destination.getName()), true);
+
+ Iterator iter = queues.iterator();
+ while (iter.hasNext())
+ {
+ Queue queue = (Queue) iter.next();
+
+ //TODO We need to set the paging params this way since the post office doesn't store them
+ //instead we should never create queues inside the postoffice - only do it at deploy time
+ queue.setPagingParams(destination.getFullSize(), destination.getPageSize(), destination.getDownCacheSize());
+
+ queue.load();
+
+ queue.activate();
+
+ //Must be done after load
+ 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 = Configuration.getDefaultMessageCounterHistoryDayLimit();
+ }
+
+ MessageCounter counter =
+ new MessageCounter(counterName, subName, queue, true, true,
+ dayLimitToUse);
+
+ serverPeer.getMessageCounterManager().registerMessageCounter(counterName, counter);
+ }
+
+ serverPeer.getDestinationManager().registerDestination(destination);
+
+
+ }
+
+ public String deployQueue(String name, String jndiName) throws Exception
+ {
+ return deployQueue(name, jndiName, -1, -1, -1);
+ }
+
+ public String deployQueue(String name, String jndiName, int fullSize, int pageSize, int downCacheSize) throws Exception
+ {
+ JMSCondition queueCond = new JMSCondition(true, name);
+ ManagedQueue destination = new ManagedQueue();
+ destination.setName(name);
+ destination.setDownCacheSize(downCacheSize);
+ destination.setPageSize(pageSize);
+ destination.setFullSize(fullSize);
+ destination.setJndiName(jndiName);
+ MessagingQueue queue = new MessagingQueue(Configuration.getServerPeerID(), destination.getName(),
+ serverPeer.getChannelIDManager().getID(),
+ serverPeer.getMessageStore(), serverPeer.getPersistenceManagerInstance(),
+ true,
+ destination.getMaxSize(), null,
+ destination.getFullSize(), destination.getPageSize(),
+ destination.getDownCacheSize(), destination.isClustered(),
+ Configuration.getRecoverDeliveriesTimeout());
+ boolean added = serverPeer.getPostOffice().addBinding(new Binding(queueCond, queue, false), false);
+
+ if (added)
+ {
+ queue.activate();
+ }
+ else
+ {
+ serverPeer.getPostOffice().getBindingForQueueName(name).queue.activate();
+ }
+ destination.setQueue(queue);
+ serverPeer.getDestinationManager().registerDestination(destination);
+ return destination.getJndiName();
+ }
+
+ public String deployTopic(String name, String jndiName) throws Exception
+ {
+ return deployTopic(name, jndiName, -1, -1, -1);
+ }
+
+ public String deployTopic(String name, String jndiName, int fullSize, int pageSize, int downCacheSize) throws Exception
+ {
+ ManagedTopic destination = new ManagedTopic();
+ destination.setName(name);
+ PostOffice po = serverPeer.getPostOffice();
+
+ // We deploy any queues corresponding to pre-existing durable subscriptions
+
+ Collection queues = po.getQueuesForCondition(new JMSCondition(false, destination.getName()), true);
+
+ Iterator iter = queues.iterator();
+ while (iter.hasNext())
+ {
+ Queue queue = (Queue) iter.next();
+
+ //TODO We need to set the paging params this way since the post office doesn't store them
+ //instead we should never create queues inside the postoffice - only do it at deploy time
+ queue.setPagingParams(destination.getFullSize(), destination.getPageSize(), destination.getDownCacheSize());
+
+ queue.load();
+
+ queue.activate();
+
+ //Must be done after load
+ 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 = Configuration.getDefaultMessageCounterHistoryDayLimit();
+ }
+
+ MessageCounter counter =
+ new MessageCounter(counterName, subName, queue, true, true,
+ dayLimitToUse);
+
+ serverPeer.getMessageCounterManager().registerMessageCounter(counterName, counter);
+ }
+
+ serverPeer.getDestinationManager().registerDestination(destination);
+ return destination.getJndiName();
+ }
+
+ public boolean undeployQueue(String name) throws Exception
+ {
+ ManagedDestination destination = serverPeer.getDestinationManager().getDestination(name, true);
+
+ serverPeer.getDestinationManager().unregisterDestination(destination);
+
+ Queue queue = ((ManagedQueue) destination).getQueue();
+
+ String counterName = QUEUE_MESSAGECOUNTER_PREFIX + destination.getName();
+
+ MessageCounter counter = serverPeer.getMessageCounterManager().unregisterMessageCounter(counterName);
+
+ if (counter == null)
+ {
+ throw new javax.jms.IllegalStateException("Cannot find counter to unregister " + counterName);
+ }
+
+ queue.deactivate();
+
+ queue.unload();
+
+ log.info(this + " stopped");
+
+ return true;
+ }
+
+ public boolean undeployTopic(String name) throws Exception
+ {
+ ManagedDestination destination = serverPeer.getDestinationManager().getDestination(name, false);
+
+ serverPeer.getDestinationManager().unregisterDestination(destination);
+
+ //When undeploying a topic, any non durable subscriptions will be removed
+ //Any durable subscriptions will survive in persistent storage, but be removed
+ //from memory
+
+ //First we remove any data for a non durable sub - a non durable sub might have data in the
+ //database since it might have paged
+
+ PostOffice po = serverPeer.getPostOffice();
+
+ Collection queues = serverPeer.getPostOffice().getQueuesForCondition(new JMSCondition(false, destination.getName()), true);
+
+ Iterator iter = queues.iterator();
+
+ while (iter.hasNext())
+ {
+ Queue queue = (Queue) iter.next();
+
+ if (!queue.isRecoverable())
+ {
+ // Unbind
+ try
+ {
+ po.removeBinding(queue.getName(), false);
+ }
+ catch (Throwable throwable)
+ {
+ throw new Exception(throwable);
+ }
+ }
+
+ queue.deactivate();
+
+ queue.unload();
+
+ //unregister counter
+ String counterName = SUBSCRIPTION_MESSAGECOUNTER_PREFIX + queue.getName();
+
+ serverPeer.getMessageCounterManager().unregisterMessageCounter(counterName);
+ }
+
+ log.info(this + " stopped");
+
+ return true;
+ }
+
+ public boolean destroyQueue(String name) throws Throwable
+ {
+ return destroyDestination(true, name);
+ }
+
+ public boolean destroyTopic(String name) throws Throwable
+ {
+ return destroyDestination(true, name);
+ }
+
+ private boolean destroyDestination(boolean isQueue, String name) throws Throwable
+ {
+ JMSCondition condition = new JMSCondition(isQueue, name);
+
+ Collection queues = serverPeer.getPostOffice().getQueuesForCondition(condition, true);
+
+ Iterator iter = queues.iterator();
+
+ while (iter.hasNext())
+ {
+ Queue queue = (Queue)iter.next();
+
+ queue.removeAllReferences();
+ }
+
+ //undeploy the mbean
+ if (!undeployQueue(name))
+ {
+ return false;
+ }
+
+ //Unbind the destination's queues
+
+ while (iter.hasNext())
+ {
+ Queue queue = (Queue)iter.next();
+
+ queue.removeAllReferences();
+
+ //Durable subs need to be removed on all nodes
+ boolean all = !isQueue && queue.isRecoverable();
+
+ serverPeer.getPostOffice().removeBinding(queue.getName(), all);
+ }
+ return true;
+ }
+
+ public void stop()
+ {
+
+ }
+
+
+ public ServerPeer getServerPeer()
+ {
+ return serverPeer;
+ }
+
+ public void setServerPeer(ServerPeer serverPeer)
+ {
+ this.serverPeer = serverPeer;
+ }
+}
Deleted: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -1,622 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.jms.server.destination;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.StringTokenizer;
-
-import javax.management.InstanceNotFoundException;
-import javax.management.ObjectName;
-
-import org.jboss.jms.server.JMSCondition;
-import org.jboss.jms.server.ServerPeer;
-import org.jboss.jms.server.messagecounter.MessageCounter;
-import org.jboss.messaging.core.contract.Condition;
-import org.jboss.messaging.core.contract.MessagingComponent;
-import org.jboss.messaging.core.contract.PostOffice;
-import org.jboss.messaging.core.contract.Queue;
-import org.jboss.messaging.util.ExceptionUtil;
-import org.jboss.messaging.util.JMXAccessor;
-import org.jboss.system.ServiceMBeanSupport;
-import org.w3c.dom.Element;
-
-/**
- * The base of a JBoss Messaging destination service. Both deployed or programatically created
- * destinations will eventually get one of these.
- *
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * @author <a href="mailto:alex.fu at novell.com">Alex Fu</a>
- *
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public abstract class DestinationServiceSupport extends ServiceMBeanSupport implements DestinationMBean
-{
- // Constants -----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private ObjectName serverPeerObjectName;
-
- private ObjectName dlqObjectName;
-
- private ObjectName expiryQueueObjectName;
-
- protected boolean started = false;
-
- protected ManagedDestination destination;
-
- protected ServerPeer serverPeer;
-
- protected int nodeId;
-
- private boolean createdProgrammatically;
-
-
- // Constructors --------------------------------------------------
-
- public DestinationServiceSupport(boolean createdProgrammatically)
- {
- this.createdProgrammatically = createdProgrammatically;
- }
-
- public DestinationServiceSupport()
- {
- }
-
- // ServerPlugin implementation ------------------------------------------
-
- public MessagingComponent getInstance()
- {
- return destination;
- }
-
- // ServiceMBeanSupport overrides -----------------------------------
-
- public synchronized void startService() throws Exception
- {
- super.startService();
-
- try
- {
- serverPeer = (ServerPeer)JMXAccessor.getJMXAttributeOverSecurity(server, serverPeerObjectName, "Instance");
-
- destination.setServerPeer(serverPeer);
-
- nodeId = serverPeer.getServerPeerID();
-
-
-
-
- String name = null;
-
- if (serviceName != null)
- {
- name = serviceName.getKeyProperty("name");
- }
-
- if (name == null || name.length() == 0)
- {
- throw new IllegalStateException( "The " + (isQueue() ? "queue" : "topic") + " " +
- "name was not properly set in the service's" +
- "ObjectName");
- }
-
- destination.setName(name);
- //must be set after the peer is set on the destination.
- //setMaxSizeForQueues must be called always when setting
- //max Size
- //http://jira.jboss.com/jira/browse/JBMESSAGING-1075
- this.setMaxSizeForQueues();
- // http://jira.jboss.com/jira/browse/JBMESSAGING-976
- if (destination.getSecurityConfig() != null)
- {
- serverPeer.getSecurityManager().setSecurityConfig(isQueue(), destination.getName(), destination.getSecurityConfig());
- }
- }
- catch (Throwable t)
- {
- ExceptionUtil.handleJMXInvocation(t, this + " startService");
- }
- }
-
- public synchronized void stopService() throws Exception
- {
- super.stopService();
- }
-
- // JMX managed attributes ----------------------------------------
-
- public String getName()
- {
- return destination.getName();
- }
-
- public String getJNDIName()
- {
- return destination.getJndiName();
- }
-
- public void setJNDIName(String jndiName) throws Exception
- {
- try
- {
- if (started)
- {
- log.warn("Cannot change the value of the JNDI name after initialization!");
- return;
- }
-
- destination.setJndiName(jndiName);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " setJNDIName");
- }
- }
-
- public void setServerPeer(ObjectName on)
- {
- if (started)
- {
- log.warn("Cannot change the value of associated " +
- "server's ObjectName after initialization!");
- return;
- }
-
- serverPeerObjectName = on;
- }
-
- public ObjectName getServerPeer()
- {
- return serverPeerObjectName;
- }
-
- public void setDLQ(ObjectName on) throws Exception
- {
- dlqObjectName = on;
-
- ManagedQueue dest = null;
-
- try
- {
-
- try
- {
- dest = (ManagedQueue)JMXAccessor.getJMXAttributeOverSecurity(server,dlqObjectName, "Instance" );
-
- }
- catch (InstanceNotFoundException e)
- {
- //Ok
- }
-
- destination.setDLQ(dest);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, " setDLQ");
- }
- }
-
- public ObjectName getDLQ()
- {
- return dlqObjectName;
- }
-
- public void setExpiryQueue(ObjectName on) throws Exception
- {
- expiryQueueObjectName = on;
-
- ManagedQueue dest = null;
-
- try
- {
- try
- {
- dest = (ManagedQueue)JMXAccessor.getJMXAttributeOverSecurity(server,expiryQueueObjectName, "Instance" );
- }
- catch (InstanceNotFoundException e)
- {
- //Ok
- }
-
- destination.setExpiryQueue(dest);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " setExpiryQueue");
- }
- }
-
- public ObjectName getExpiryQueue()
- {
- return expiryQueueObjectName;
- }
-
- public long getRedeliveryDelay()
- {
- return destination.getRedeliveryDelay();
- }
-
- public void setRedeliveryDelay(long delay)
- {
- destination.setRedeliveryDelay(delay);
- }
-
- public int getMaxSize()
- {
- return destination.getMaxSize();
- }
-
- /**
- * This is post startup processing for MaxSize for Queues. This can also be set during runtime,
- * given that the destination service is started. Setting max size requires
- * that the peer be setup. http://jira.jboss.com/jira/browse/JBMESSAGING-1075
- * @throws Exception if the post office can't be reached.
- */
- private void setMaxSizeForQueues() throws Exception
- {
- Condition cond = new JMSCondition(isQueue(), this.getName());
- PostOffice postOffice = serverPeer.getPostOfficeInstance();
- Collection subs = postOffice.getQueuesForCondition(cond, true);
- Iterator iter = subs.iterator();
- while (iter.hasNext())
- {
- Queue queue = (Queue)iter.next();
- queue.setMaxSize(this.getMaxSize());
- }
- }
-
- public void setMaxSize(int maxSize) throws Exception
- {
- destination.setMaxSize(maxSize);
- //added so that max size can be changed on the fly
- //http://jira.jboss.com/jira/browse/JBMESSAGING-1075
- if(started)
- {
- this.setMaxSizeForQueues();
- }
- }
-
- public Element getSecurityConfig()
- {
- return destination.getSecurityConfig();
- }
-
- public void setSecurityConfig(Element securityConfig) throws Exception
- {
- try
- {
- if (started)
- {
- // push security update to the server
- serverPeer.getSecurityManager().setSecurityConfig(isQueue(), destination.getName(), securityConfig);
- }
-
- destination.setSecurityConfig(securityConfig);
- }
- catch (Throwable t)
- {
- ExceptionUtil.handleJMXInvocation(t, this + " setSecurityConfig");
- }
- }
-
- /**
- * Get in-memory message limit
- * @return message limit
- */
- public int getFullSize()
- {
- return destination.getFullSize();
- }
-
- /**
- * Set in-memory message limit when destination is stopped.
- * @param fullSize the message limit
- */
- public void setFullSize(int fullSize)
- {
- if (started)
- {
- log.warn("FullSize can only be changed when destination is stopped");
- return;
- }
- destination.setFullSize(fullSize);
- }
-
- /**
- * Get paging size
- * @return paging size
- */
- public int getPageSize()
- {
- return destination.getPageSize();
- }
-
- /**
- * Set paging size when destination is stopped.
- * @param pageSize the paging size
- */
- public void setPageSize(int pageSize)
- {
- if (started)
- {
- log.warn("PageSize can only be changed when destination is stopped");
- return;
- }
- destination.setPageSize(pageSize);
- }
-
- /**
- * Get write-cache size
- * @return cache size
- */
- public int getDownCacheSize()
- {
- return destination.getDownCacheSize();
- }
-
- /**
- * Set write-cache size when destination is stopped.
- * @param downCacheSize the cache size
- */
- public void setDownCacheSize(int downCacheSize)
- {
- if (started)
- {
- log.warn("DownCacheSize can only be changed when destination is stopped");
- return;
- }
- destination.setDownCacheSize(downCacheSize);
- }
-
- public boolean isClustered()
- {
- return destination.isClustered();
- }
-
- public void setClustered(boolean clustered)
- {
- if (started)
- {
- log.warn("Clustered can only be changed when destination is stopped");
- return;
- }
- destination.setClustered(clustered);
- }
-
- public boolean isCreatedProgrammatically()
- {
- return createdProgrammatically;
- }
-
- public int getMessageCounterHistoryDayLimit()
- {
- return destination.getMessageCounterHistoryDayLimit();
- }
-
- public void setMessageCounterHistoryDayLimit(int limit) throws Exception
- {
- destination.setMessageCounterHistoryDayLimit(limit);
- }
-
- public int getMaxDeliveryAttempts()
- {
- return destination.getMaxDeliveryAttempts();
- }
-
- public void setMaxDeliveryAttempts(int maxDeliveryAttempts)
- {
- destination.setMaxDeliveryAttempts(maxDeliveryAttempts);
- }
-
- // JMX managed operations ----------------------------------------
-
- public abstract void removeAllMessages() throws Exception;
-
-
- // Public --------------------------------------------------------
-
- public String toString()
- {
- String nameFromJNDI = destination.getJndiName();
- int idx = -1;
- if (nameFromJNDI != null)
- {
- idx = nameFromJNDI.lastIndexOf('/');
- }
- if (idx != -1)
- {
- nameFromJNDI = nameFromJNDI.substring(idx + 1);
- }
- StringBuffer sb = new StringBuffer();
- if (isQueue())
- {
- sb.append("Queue");
- }
- else
- {
- sb.append("Topic");
- }
- sb.append('[');
- if (destination == null)
- {
- sb.append("(NULL Destination)");
- }
- else if (destination.getName() == null)
- {
- sb.append("(destination.getName() == NULL)");
- }
- else
- {
- if (destination.getName().equals(nameFromJNDI))
- {
- sb.append(destination.getJndiName());
- }
- else
- {
- sb.append(destination.getJndiName()).append(", name=").append(destination.getName());
- }
- }
- sb.append(']');
- return sb.toString();
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- /**
- * List message counters as HTML table
- *
- * @return String
- */
- protected String listMessageCounterAsHTML(MessageCounter[] counters)
- {
- if (counters == null)
- return null;
-
- String ret = "<table width=\"100%\" border=\"1\" cellpadding=\"1\" cellspacing=\"1\">" +
- "<tr>" +
- "<th>Type</th>" +
- "<th>Name</th>" +
- "<th>Subscription</th>" +
- "<th>Durable</th>" +
- "<th>Count</th>" +
- "<th>CountDelta</th>" +
- "<th>Depth</th>" +
- "<th>DepthDelta</th>" +
- "<th>Last Add</th>" +
- "</tr>";
-
- for( int i=0; i<counters.length; i++ )
- {
- String data = counters[i].getCounterAsString();
- StringTokenizer token = new StringTokenizer( data, ",");
- String value;
-
- ret += "<tr bgcolor=\"#" + ( (i%2)==0 ? "FFFFFF" : "F0F0F0") + "\">";
-
- ret += "<td>" + token.nextToken() + "</td>"; // type
- ret += "<td>" + token.nextToken() + "</td>"; // name
- ret += "<td>" + token.nextToken() + "</td>"; // subscription
- ret += "<td>" + token.nextToken() + "</td>"; // durable
-
- ret += "<td>" + token.nextToken() + "</td>"; // count
-
- value = token.nextToken(); // countDelta
-
- if( value.equalsIgnoreCase("0") )
- value = "-";
-
- ret += "<td>" + value + "</td>";
-
- ret += "<td>" + token.nextToken() + "</td>"; // depth
-
- value = token.nextToken(); // depthDelta
-
- if( value.equalsIgnoreCase("0") )
- value = "-";
-
- ret += "<td>" + value + "</td>";
-
- ret += "<td>" + token.nextToken() + "</td>"; // date last add
-
- ret += "</tr>";
- }
-
- ret += "</table>";
-
- return ret;
- }
-
- /**
- * List destination message counter history as HTML table
- *
- * @return String
- */
- protected String listMessageCounterHistoryAsHTML(MessageCounter[] counters)
- {
- if (counters == null)
- return null;
-
- String ret = "";
-
- for( int i=0; i<counters.length; i++ )
- {
- // destination name
- ret += ( counters[i].getDestinationTopic() ? "Topic '" : "Queue '" );
- ret += counters[i].getDestinationName() + "'";
-
- if( counters[i].getDestinationSubscription() != null )
- ret += "Subscription '" + counters[i].getDestinationSubscription() + "'";
-
-
- // table header
- ret += "<table width=\"100%\" border=\"1\" cellpadding=\"1\" cellspacing=\"1\">" +
- "<tr>" +
- "<th>Date</th>";
-
- for( int j = 0; j < 24; j++ )
- ret += "<th width=\"4%\">" + j + "</th>";
-
- ret += "<th>Total</th></tr>";
-
- // get history data as CSV string
- StringTokenizer tokens = new StringTokenizer( counters[i].getHistoryAsString(), ",\n");
-
- // get history day count
- int days = Integer.parseInt( tokens.nextToken() );
-
- for( int j=0; j<days; j++ )
- {
- // next day counter row
- ret += "<tr bgcolor=\"#" + ((j%2)==0 ? "FFFFFF" : "F0F0F0") + "\">";
-
- // date
- ret += "<td>" + tokens.nextToken() + "</td>";
-
- // 24 hour counters
- int total = 0;
-
- for( int k=0; k<24; k++ )
- {
- int value = Integer.parseInt( tokens.nextToken().trim() );
-
- if( value == -1 )
- {
- ret += "<td></td>";
- }
- else
- {
- ret += "<td>" + value + "</td>";
-
- total += value;
- }
- }
-
- ret += "<td>" + total + "</td></tr>";
- }
-
- ret += "</table><br><br>";
- }
-
- return ret;
- }
-
- protected abstract boolean isQueue();
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/ManagedDestination.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/ManagedDestination.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/ManagedDestination.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,18 +21,14 @@
*/
package org.jboss.jms.server.destination;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.jboss.jms.server.JMSCondition;
import org.jboss.jms.server.ServerPeer;
+import org.jboss.jms.server.security.Role;
import org.jboss.messaging.core.contract.Binding;
-import org.jboss.messaging.core.contract.Condition;
import org.jboss.messaging.core.contract.MessagingComponent;
-import org.jboss.messaging.core.contract.PostOffice;
import org.jboss.messaging.core.contract.Queue;
-import org.w3c.dom.Element;
+import java.util.HashSet;
+
/**
* A Destination
*
@@ -45,27 +41,27 @@
public abstract class ManagedDestination implements MessagingComponent
{
protected static final int ALL = 0;
-
+
protected static final int DURABLE = 1;
-
+
protected static final int NON_DURABLE = 2;
-
-
+
+
private static final int DEFAULT_FULL_SIZE = 200000;
-
+
private static final int DEFAULT_PAGE_SIZE = 2000;
-
+
private static final int DEFAULT_DOWN_CACHE_SIZE = 2000;
-
-
+
+
protected String name;
-
+
protected String jndiName;
-
+
protected boolean clustered;
protected boolean temporary;
-
+
// Default in memory message number limit
protected int fullSize = DEFAULT_FULL_SIZE;
@@ -74,27 +70,28 @@
// Default down-cache size
protected int downCacheSize = DEFAULT_DOWN_CACHE_SIZE;
-
- protected Element securityConfig;
-
+
+ protected HashSet<Role> securityConfig;
+
protected ServerPeer serverPeer;
-
- protected ManagedQueue dlq;
-
- protected ManagedQueue expiryQueue;
-
+
+ protected String dlq;
+
+ protected String expiryQueue;
+
protected long redeliveryDelay = -1;
-
+
protected int maxSize = -1;
-
+
protected int messageCounterHistoryDayLimit = -1;
-
+
protected int maxDeliveryAttempts = -1;
-
+ public static final String SUBSCRIPTION_MESSAGECOUNTER_PREFIX = "Subscription.";
+
public ManagedDestination()
- {
+ {
}
-
+
/*
* Constructor for temporary destinations
*/
@@ -167,16 +164,16 @@
this.pageSize = pageSize;
}
- public Element getSecurityConfig()
+ public HashSet<Role> getSecurityConfig()
{
return securityConfig;
}
- public void setSecurityConfig(Element securityConfig)
+ public void setSecurityConfig(HashSet<Role> securityConfig)
{
this.securityConfig = securityConfig;
}
-
+
public ServerPeer getServerPeer()
{
return serverPeer;
@@ -196,117 +193,117 @@
{
this.temporary = temporary;
}
-
+
//Need to get lazily because of crappy dependencies
public Queue getDLQ() throws Exception
{
Queue theQueue = null;
-
+
if (dlq != null)
- {
- Binding binding = serverPeer.getPostOfficeInstance().getBindingForQueueName(dlq.getName());
-
+ {
+ Binding binding = serverPeer.getPostOffice().getBindingForQueueName(dlq);
+
if (binding == null)
{
- throw new IllegalStateException("Cannot find binding for queue " + dlq.getName());
+ throw new IllegalStateException("Cannot find binding for queue " + dlq);
}
-
+
Queue queue = binding.queue;
-
+
if (queue.isActive())
{
theQueue = queue;
}
}
-
+
return theQueue;
}
-
- public void setDLQ(ManagedQueue dlq)
+
+ public void setDLQ(String dlq)
{
this.dlq = dlq;
}
-
+
//Need to get lazily because of crappy dependencies
public Queue getExpiryQueue() throws Exception
{
Queue theQueue = null;
-
+
if (expiryQueue != null)
- {
- Binding binding = serverPeer.getPostOfficeInstance().getBindingForQueueName(expiryQueue.getName());
-
+ {
+ Binding binding = serverPeer.getPostOffice().getBindingForQueueName(expiryQueue);
+
if (binding == null)
{
- throw new IllegalStateException("Cannot find binding for queue " + expiryQueue.getName());
+ throw new IllegalStateException("Cannot find binding for queue " + expiryQueue);
}
-
+
Queue queue = binding.queue;
-
-
+
+
if (queue.isActive())
{
theQueue = queue;
}
}
-
+
return theQueue;
}
-
- public void setExpiryQueue(ManagedQueue expiryQueue)
+
+ public void setExpiryQueue(String expiryQueue)
{
this.expiryQueue = expiryQueue;
}
-
+
public long getRedeliveryDelay()
{
return redeliveryDelay;
}
-
+
public void setRedeliveryDelay(long delay)
{
this.redeliveryDelay = delay;
}
-
+
public int getMaxSize()
{
return maxSize;
}
-
+
/**
* Sets the max size for the destination. This will only set the MaxSize field. Processing must be
- * done to enable this for the queues.
+ * done to enable this for the queues.
* http://jira.jboss.com/jira/browse/JBMESSAGING-1075
* @param maxSize
* @throws Exception
*/
public void setMaxSize(int maxSize) throws Exception
{
- //took out processing for max size and moved it into the DestinationServiceSupport
+ //took out processing for max size and moved it into the DestinationServiceSupport
//http://jira.jboss.com/jira/browse/JBMESSAGING-1075
this.maxSize = maxSize;
}
-
+
public int getMessageCounterHistoryDayLimit()
{
return this.messageCounterHistoryDayLimit;
}
-
+
public void setMessageCounterHistoryDayLimit(int limit) throws Exception
{
this.messageCounterHistoryDayLimit = limit;
}
-
+
public int getMaxDeliveryAttempts()
{
return this.maxDeliveryAttempts;
}
-
+
public void setMaxDeliveryAttempts(int maxDeliveryAttempts)
{
this.maxDeliveryAttempts = maxDeliveryAttempts;
}
-
+
public abstract boolean isQueue();
public void start() throws Exception
@@ -315,7 +312,7 @@
}
public void stop() throws Exception
- {
+ {
//NOOP
}
}
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/ManagedTopic.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/ManagedTopic.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/ManagedTopic.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,11 +21,6 @@
*/
package org.jboss.jms.server.destination;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
import org.jboss.jms.server.JMSCondition;
import org.jboss.jms.server.messagecounter.MessageCounter;
import org.jboss.jms.server.selector.Selector;
@@ -35,6 +30,11 @@
import org.jboss.messaging.core.contract.Queue;
import org.jboss.messaging.util.MessageQueueNameHelper;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
/**
* A ManagedTopic
*
@@ -61,7 +61,7 @@
public void removeAllMessages() throws Throwable
{
- Collection queues = serverPeer.getPostOfficeInstance().getQueuesForCondition(new JMSCondition(false, name), true);
+ Collection queues = serverPeer.getPostOffice().getQueuesForCondition(new JMSCondition(false, name), true);
//XXX How to lock down all subscriptions?
Iterator iter = queues.iterator();
@@ -89,7 +89,7 @@
public int getAllSubscriptionsCount() throws Exception
{
- Collection queues = serverPeer.getPostOfficeInstance().getQueuesForCondition(new JMSCondition(false, name), true);
+ Collection queues = serverPeer.getPostOffice().getQueuesForCondition(new JMSCondition(false, name), true);
return queues.size();
}
@@ -156,7 +156,7 @@
List counters = new ArrayList();
// We deploy any queues corresponding to pre-existing durable subscriptions
- Collection queues = serverPeer.getPostOfficeInstance().getQueuesForCondition(new JMSCondition(false, name), true);
+ Collection queues = serverPeer.getPostOffice().getQueuesForCondition(new JMSCondition(false, name), true);
Iterator iter = queues.iterator();
@@ -164,7 +164,7 @@
{
Queue queue = (Queue)iter.next();
- String counterName = TopicService.SUBSCRIPTION_MESSAGECOUNTER_PREFIX + queue.getName();
+ String counterName = SUBSCRIPTION_MESSAGECOUNTER_PREFIX + queue.getName();
MessageCounter counter = serverPeer.getMessageCounterManager().getMessageCounter(counterName);
@@ -211,7 +211,7 @@
return msgs;
}
- Binding binding = serverPeer.getPostOfficeInstance().getBindingForQueueName(subId);
+ Binding binding = serverPeer.getPostOffice().getBindingForQueueName(subId);
if (binding == null || !binding.queue.isActive())
{
@@ -251,7 +251,7 @@
{
List subs = new ArrayList();
- Collection queues = serverPeer.getPostOfficeInstance().getQueuesForCondition(new JMSCondition(false, name), true);
+ Collection queues = serverPeer.getPostOffice().getQueuesForCondition(new JMSCondition(false, name), true);
Iterator iter = queues.iterator();
@@ -283,7 +283,7 @@
private int getMessageCount(int type) throws Exception
{
- Collection queues = serverPeer.getPostOfficeInstance().getQueuesForCondition(new JMSCondition(false, name), true);
+ Collection queues = serverPeer.getPostOffice().getQueuesForCondition(new JMSCondition(false, name), true);
Iterator iter = queues.iterator();
@@ -305,7 +305,7 @@
private int getSubscriptionsCount(boolean durable) throws Exception
{
- Collection queues = serverPeer.getPostOfficeInstance().getQueuesForCondition(new JMSCondition(false, name), true);
+ Collection queues = serverPeer.getPostOffice().getQueuesForCondition(new JMSCondition(false, name), true);
Iterator iter = queues.iterator();
@@ -327,7 +327,7 @@
private String listSubscriptionsAsHTML(int type) throws Exception
{
- Collection queues = serverPeer.getPostOfficeInstance().getQueuesForCondition(new JMSCondition(false, name), true);
+ Collection queues = serverPeer.getPostOffice().getQueuesForCondition(new JMSCondition(false, name), true);
StringBuffer sb = new StringBuffer();
Deleted: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/QueueService.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/QueueService.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/QueueService.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -1,419 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.jms.server.destination;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.jms.IllegalStateException;
-
-import org.jboss.jms.server.JMSCondition;
-import org.jboss.jms.server.messagecounter.MessageCounter;
-import org.jboss.jms.server.messagecounter.MessageStatistics;
-import org.jboss.messaging.core.contract.Binding;
-import org.jboss.messaging.core.contract.PostOffice;
-import org.jboss.messaging.core.contract.Queue;
-import org.jboss.messaging.core.impl.MessagingQueue;
-import org.jboss.messaging.util.ExceptionUtil;
-import org.jboss.messaging.util.XMLUtil;
-
-/**
- * MBean wrapper around a ManagedQueue
- *
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * @author <a href="mailto:alex.fu at novell.com">Alex Fu</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public class QueueService extends DestinationServiceSupport implements QueueMBean
-{
- // Constants ------------------------------------------------------------------------------------
-
- private static final String QUEUE_MESSAGECOUNTER_PREFIX = "Queue.";
-
- // Static ---------------------------------------------------------------------------------------
-
- // Attributes -----------------------------------------------------------------------------------
-
- // Constructors ---------------------------------------------------------------------------------
-
- public QueueService()
- {
- destination = new ManagedQueue();
- }
-
- public QueueService(boolean createdProgrammatically)
- {
- super(createdProgrammatically);
-
- destination = new ManagedQueue();
- }
-
- // ServiceMBeanSupport overrides ----------------------------------------------------------------
-
- public synchronized void startService() throws Exception
- {
- super.startService();
-
- try
- {
- // Binding must be added before destination is registered in JNDI otherwise the user could
- // get a reference to the destination and use it while it is still being loaded. Also,
- // binding might already exist.
-
- PostOffice po = serverPeer.getPostOfficeInstance();
-
- Binding binding = po.getBindingForQueueName(destination.getName());
-
- Queue queue;
-
- if (binding != null)
- {
- queue = binding.queue;
-
- if (queue.isActive())
- {
- throw new IllegalStateException("Cannot deploy queue " + destination.getName() + " it is already deployed");
- }
-
- queue.setPagingParams(destination.getFullSize(),
- destination.getPageSize(),
- destination.getDownCacheSize());
-
- queue.load();
-
- // Must be done after load
- queue.setMaxSize(destination.getMaxSize());
-
- queue.activate();
- }
- else
- {
- // Create a new queue
-
- JMSCondition queueCond = new JMSCondition(true, destination.getName());
-
- queue = new MessagingQueue(nodeId, destination.getName(),
- serverPeer.getChannelIDManager().getID(),
- serverPeer.getMessageStore(), serverPeer.getPersistenceManagerInstance(),
- true,
- destination.getMaxSize(), null,
- destination.getFullSize(), destination.getPageSize(),
- destination.getDownCacheSize(), destination.isClustered(),
- serverPeer.getRecoverDeliveriesTimeout());
- po.addBinding(new Binding(queueCond, queue, false), false);
-
- queue.activate();
- }
-
- ((ManagedQueue)destination).setQueue(queue);
-
- String counterName = QUEUE_MESSAGECOUNTER_PREFIX + destination.getName();
-
- int dayLimitToUse = destination.getMessageCounterHistoryDayLimit();
- if (dayLimitToUse == -1)
- {
- //Use override on server peer
- dayLimitToUse = serverPeer.getDefaultMessageCounterHistoryDayLimit();
- }
-
- MessageCounter counter =
- new MessageCounter(counterName, null, queue, false, false,
- dayLimitToUse);
-
- ((ManagedQueue)destination).setMessageCounter(counter);
-
- serverPeer.getMessageCounterManager().registerMessageCounter(counterName, counter);
-
- serverPeer.getDestinationManager().registerDestination(destination);
-
- log.debug(this + " security configuration: " + (destination.getSecurityConfig() == null ?
- "null" : "\n" + XMLUtil.elementToString(destination.getSecurityConfig())));
-
- started = true;
-
- log.info(this + " started, fullSize=" + destination.getFullSize() +
- ", pageSize=" + destination.getPageSize() + ", downCacheSize=" + destination.getDownCacheSize());
- }
- catch (Throwable t)
- {
- ExceptionUtil.handleJMXInvocation(t, this + " startService");
- }
- }
-
- public synchronized void stopService() throws Exception
- {
- try
- {
- serverPeer.getDestinationManager().unregisterDestination(destination);
-
- Queue queue = ((ManagedQueue)destination).getQueue();
-
- String counterName = QUEUE_MESSAGECOUNTER_PREFIX + destination.getName();
-
- MessageCounter counter = serverPeer.getMessageCounterManager().unregisterMessageCounter(counterName);
-
- if (counter == null)
- {
- throw new IllegalStateException("Cannot find counter to unregister " + counterName);
- }
-
- queue.deactivate();
-
- queue.unload();
-
- started = false;
-
- log.info(this + " stopped");
- }
- catch (Throwable t)
- {
- ExceptionUtil.handleJMXInvocation(t, this + " stopService");
- }
- }
-
- // JMX managed attributes -----------------------------------------------------------------------
-
- public int getMessageCount() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Queue is stopped");
- return 0;
- }
-
- return ((ManagedQueue)destination).getMessageCount();
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " getMessageCount");
- }
- }
-
- public int getDeliveringCount() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Queue is stopped");
- return 0;
- }
-
- return ((ManagedQueue)destination).getDeliveringCount();
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " getDeliveringCount");
- }
- }
-
- public int getScheduledMessageCount() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Queue is stopped");
- return 0;
- }
-
- return ((ManagedQueue)destination).getScheduledMessageCount();
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " getMessageCount");
- }
- }
-
- public MessageCounter getMessageCounter()
- {
- return ((ManagedQueue)destination).getMessageCounter();
- }
-
- public MessageStatistics getMessageStatistics() throws Exception
- {
- List counters = new ArrayList();
- counters.add(getMessageCounter());
-
- List stats = MessageCounter.getMessageStatistics(counters);
-
- return (MessageStatistics)stats.get(0);
- }
-
- public String listMessageCounterAsHTML()
- {
- return super.listMessageCounterAsHTML(new MessageCounter[] { getMessageCounter() });
- }
-
- public int getConsumerCount() throws Exception
- {
- return ((ManagedQueue)destination).getConsumersCount();
- }
-
- // JMX managed operations -----------------------------------------------------------------------
-
- public void removeAllMessages() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Queue is stopped.");
- return;
- }
-
- ((ManagedQueue)destination).removeAllMessages();
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " removeAllMessages");
- }
- }
-
- public List listAllMessages() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Queue is stopped.");
- return null;
- }
-
- return ((ManagedQueue)destination).listAllMessages(null);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listAllMessages");
- }
- }
-
- public List listAllMessages(String selector) throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Queue is stopped.");
- return null;
- }
-
- return ((ManagedQueue)destination).listAllMessages(selector);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listAllMessages");
- }
- }
-
- public List listDurableMessages() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Queue is stopped.");
- return null;
- }
-
- return ((ManagedQueue)destination).listDurableMessages(null);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listDurableMessages");
- }
- }
-
- public List listDurableMessages(String selector) throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Queue is stopped.");
- return null;
- }
-
- return ((ManagedQueue)destination).listDurableMessages(selector);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listDurableMessages");
- }
- }
-
- public List listNonDurableMessages() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Queue is stopped.");
- return null;
- }
-
- return ((ManagedQueue)destination).listNonDurableMessages(null);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listNonDurableMessages");
- }
- }
-
- public List listNonDurableMessages(String selector) throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Queue is stopped.");
- return null;
- }
-
- return ((ManagedQueue)destination).listNonDurableMessages(selector);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listNonDurableMessages");
- }
- }
-
- public void resetMessageCounter()
- {
- ((ManagedQueue)destination).getMessageCounter().resetCounter();
- }
-
- public String listMessageCounterHistoryAsHTML()
- {
- return super.listMessageCounterHistoryAsHTML(new MessageCounter[] { getMessageCounter() });
- }
-
- public void resetMessageCounterHistory()
- {
- ((ManagedQueue)destination).getMessageCounter().resetHistory();
- }
-
- // Public ---------------------------------------------------------------------------------------
-
- // Package protected ----------------------------------------------------------------------------
-
- // Protected ------------------------------------------------------------------------------------
-
- protected boolean isQueue()
- {
- return true;
- }
-
- // Private --------------------------------------------------------------------------------------
-
- // Inner classes --------------------------------------------------------------------------------
-}
Deleted: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/TopicService.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/TopicService.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/destination/TopicService.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -1,555 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.jms.server.destination;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.jms.JMSException;
-
-import org.jboss.jms.server.JMSCondition;
-import org.jboss.jms.server.messagecounter.MessageCounter;
-import org.jboss.messaging.core.contract.PostOffice;
-import org.jboss.messaging.core.contract.Queue;
-import org.jboss.messaging.util.ExceptionUtil;
-import org.jboss.messaging.util.MessageQueueNameHelper;
-import org.jboss.messaging.util.XMLUtil;
-
-/**
- * A deployable JBoss Messaging topic.
- *
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * @author <a href="mailto:alex.fu at novell.com">Alex Fu</a>
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>
- *
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public class TopicService extends DestinationServiceSupport implements TopicMBean
-{
- // Constants -----------------------------------------------------
-
- public static final String SUBSCRIPTION_MESSAGECOUNTER_PREFIX = "Subscription.";
-
- // Static --------------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public TopicService()
- {
- destination = new ManagedTopic();
- }
-
- public TopicService(boolean createdProgrammatically)
- {
- super(createdProgrammatically);
-
- destination = new ManagedTopic();
- }
-
- // ServiceMBeanSupport overrides ---------------------------------
-
- public synchronized void startService() throws Exception
- {
- super.startService();
-
- try
- {
- PostOffice po = serverPeer.getPostOfficeInstance();
-
- // We deploy any queues corresponding to pre-existing durable subscriptions
-
- Collection queues = po.getQueuesForCondition(new JMSCondition(false, destination.getName()), true);
-
- Iterator iter = queues.iterator();
- while (iter.hasNext())
- {
- Queue queue = (Queue)iter.next();
-
- //TODO We need to set the paging params this way since the post office doesn't store them
- //instead we should never create queues inside the postoffice - only do it at deploy time
- queue.setPagingParams(destination.getFullSize(), destination.getPageSize(), destination.getDownCacheSize());
-
- queue.load();
-
- queue.activate();
-
- //Must be done after load
- 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.getDefaultMessageCounterHistoryDayLimit();
- }
-
- MessageCounter counter =
- new MessageCounter(counterName, subName, queue, true, true,
- dayLimitToUse);
-
- serverPeer.getMessageCounterManager().registerMessageCounter(counterName, counter);
- }
-
- serverPeer.getDestinationManager().registerDestination(destination);
-
- log.debug(this + " security configuration: " + (destination.getSecurityConfig() == null ?
- "null" : "\n" + XMLUtil.elementToString(destination.getSecurityConfig())));
-
- started = true;
-
- log.info(this + " started, fullSize=" + destination.getFullSize() + ", pageSize=" + destination.getPageSize() + ", downCacheSize=" + destination.getDownCacheSize());
- }
- catch (Throwable t)
- {
- ExceptionUtil.handleJMXInvocation(t, this + " startService");
- }
- }
-
- public synchronized void stopService() throws Exception
- {
- try
- {
- serverPeer.getDestinationManager().unregisterDestination(destination);
-
- //When undeploying a topic, any non durable subscriptions will be removed
- //Any durable subscriptions will survive in persistent storage, but be removed
- //from memory
-
- //First we remove any data for a non durable sub - a non durable sub might have data in the
- //database since it might have paged
-
- PostOffice po = serverPeer.getPostOfficeInstance();
-
- Collection queues = serverPeer.getPostOfficeInstance().getQueuesForCondition(new JMSCondition(false, destination.getName()), true);
-
- Iterator iter = queues.iterator();
-
- while (iter.hasNext())
- {
- Queue queue = (Queue)iter.next();
-
- if (!queue.isRecoverable())
- {
- // Unbind
- po.removeBinding(queue.getName(), false);
- }
-
- queue.deactivate();
-
- queue.unload();
-
- //unregister counter
- String counterName = SUBSCRIPTION_MESSAGECOUNTER_PREFIX + queue.getName();
-
- serverPeer.getMessageCounterManager().unregisterMessageCounter(counterName);
- }
-
- started = false;
- log.info(this + " stopped");
- }
- catch (Throwable t)
- {
- ExceptionUtil.handleJMXInvocation(t, this + " stopService");
- }
- }
-
- // JMX managed attributes ----------------------------------------
-
- public int getAllMessageCount() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return -1;
- }
-
- return ((ManagedTopic)destination).getAllMessageCount();
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " getAllMessageCount");
- }
- }
-
-
- public int getDurableMessageCount() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return -1;
- }
-
- return ((ManagedTopic)destination).getDurableMessageCount();
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " getDurableMessageCount");
- }
- }
-
- public int getNonDurableMessageCount() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return -1;
- }
-
- return ((ManagedTopic)destination).getNonDurableMessageCount();
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " getNonDurableMessageCount");
- }
- }
-
- /**
- * All subscription count
- * @return all subscription count
- * @throws JMSException
- */
- public int getAllSubscriptionsCount() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return 0;
- }
-
- return ((ManagedTopic)destination).getAllSubscriptionsCount();
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " getAllSubscriptionsCount");
- }
- }
-
- public int getDurableSubscriptionsCount() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return 0;
- }
-
- return ((ManagedTopic)destination).getDurableSubscriptionsCount();
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " getDurableSubscriptionsCount");
- }
- }
-
- public int getNonDurableSubscriptionsCount() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return 0;
- }
-
- return ((ManagedTopic)destination).getNonDurableSubscriptionsCount();
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " getNonDurableSubscriptionsCount");
- }
- }
-
- // JMX managed operations ----------------------------------------
-
-
- /**
- * Remove all messages from subscription's storage.
- */
- public void removeAllMessages() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return;
- }
-
- ((ManagedTopic)destination).removeAllMessages();
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " removeAllMessages");
- }
- }
-
- public List listAllSubscriptions() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return null;
- }
-
- return ((ManagedTopic)destination).listAllSubscriptions();
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listAllSubscriptions");
- }
- }
-
- public List listDurableSubscriptions() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return null;
- }
-
- return ((ManagedTopic)destination).listDurableSubscriptions();
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listDurableSubscriptions");
- }
- }
-
- public List listNonDurableSubscriptions() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return null;
- }
-
- return ((ManagedTopic)destination).listNonDurableSubscriptions();
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listNonDurableSubscriptions");
- }
- }
-
- public String listAllSubscriptionsAsHTML() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return "";
- }
-
- return ((ManagedTopic)destination).listAllSubscriptionsAsHTML();
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listAllSubscriptionsAsHTML");
- }
- }
-
- public String listDurableSubscriptionsAsHTML() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return "";
- }
-
- return ((ManagedTopic)destination).listDurableSubscriptionsAsHTML();
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listDurableSubscriptionsAsHTML");
- }
- }
-
- public String listNonDurableSubscriptionsAsHTML() throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return "";
- }
-
- return ((ManagedTopic)destination).listNonDurableSubscriptionsAsHTML();
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listNonDurableSubscriptionsAsHTML");
- }
- }
-
- public List listAllMessages(String subscriptionId) throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return null;
- }
-
- return ((ManagedTopic)destination).listAllMessages(subscriptionId, null);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listMessages");
- }
- }
-
- public List listAllMessages(String subscriptionId, String selector) throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return null;
- }
-
- return ((ManagedTopic)destination).listAllMessages(subscriptionId, selector);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listMessages");
- }
- }
-
-
- public List listDurableMessages(String subscriptionId) throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return null;
- }
-
- return ((ManagedTopic)destination).listDurableMessages(subscriptionId, null);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listDurableMessages");
- }
- }
-
- public List listDurableMessages(String subscriptionId, String selector) throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return null;
- }
-
- return ((ManagedTopic)destination).listDurableMessages(subscriptionId, selector);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listDurableMessages");
- }
- }
-
- public List listNonDurableMessages(String subscriptionId) throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return null;
- }
-
- return ((ManagedTopic)destination).listNonDurableMessages(subscriptionId, null);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listNonDurableMessages");
- }
- }
-
- public List listNonDurableMessages(String subscriptionId, String selector) throws Exception
- {
- try
- {
- if (!started)
- {
- log.warn("Topic is stopped.");
- return null;
- }
-
- return ((ManagedTopic)destination).listNonDurableMessages(subscriptionId, selector);
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listNonDurableMessages");
- }
- }
-
- public List getMessageCounters()
- throws Exception
- {
- try
- {
- return ((ManagedTopic)destination).getMessageCounters();
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " listMessagesNonDurableSub");
- }
- }
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- protected boolean isQueue()
- {
- return false;
- }
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,20 +21,6 @@
*/
package org.jboss.jms.server.endpoint;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.jms.Destination;
-import javax.jms.IllegalStateException;
-import javax.jms.JMSException;
-import javax.jms.Session;
-
import org.jboss.aop.AspectManager;
import org.jboss.jms.client.delegate.ClientSessionDelegate;
import org.jboss.jms.client.remoting.CallbackManager;
@@ -43,23 +29,16 @@
import org.jboss.jms.delegate.SessionDelegate;
import org.jboss.jms.destination.JBossDestination;
import org.jboss.jms.message.JBossMessage;
-import org.jboss.jms.server.ConnectionManager;
-import org.jboss.jms.server.JMSCondition;
-import org.jboss.jms.server.SecurityStore;
-import org.jboss.jms.server.ServerPeer;
+import org.jboss.jms.server.*;
import org.jboss.jms.server.endpoint.advised.SessionAdvised;
import org.jboss.jms.tx.ClientTransaction;
+import org.jboss.jms.tx.ClientTransaction.SessionTxState;
import org.jboss.jms.tx.MessagingXid;
import org.jboss.jms.tx.TransactionRequest;
-import org.jboss.jms.tx.ClientTransaction.SessionTxState;
import org.jboss.jms.wireformat.Dispatcher;
import org.jboss.jms.wireformat.JMSWireFormat;
import org.jboss.logging.Logger;
-import org.jboss.messaging.core.contract.Binding;
-import org.jboss.messaging.core.contract.Delivery;
-import org.jboss.messaging.core.contract.MessageReference;
-import org.jboss.messaging.core.contract.MessageStore;
-import org.jboss.messaging.core.contract.PostOffice;
+import org.jboss.messaging.core.contract.*;
import org.jboss.messaging.core.contract.Queue;
import org.jboss.messaging.core.impl.tx.Transaction;
import org.jboss.messaging.core.impl.tx.TransactionRepository;
@@ -69,6 +48,12 @@
import org.jboss.remoting.Client;
import org.jboss.remoting.callback.ServerInvokerCallbackHandler;
+import javax.jms.Destination;
+import javax.jms.IllegalStateException;
+import javax.jms.JMSException;
+import javax.jms.Session;
+import java.util.*;
+
/**
* Concrete implementation of ConnectionEndpoint.
*
@@ -159,7 +144,7 @@
tr = serverPeer.getTxRepository();
cm = serverPeer.getConnectionManager();
ms = serverPeer.getMessageStore();
- postOffice = serverPeer.getPostOfficeInstance();
+ postOffice = serverPeer.getPostOffice();
started = false;
@@ -393,7 +378,7 @@
{
// Temporary queues must be unbound on ALL nodes of the cluster
- postOffice.removeBinding(dest.getName(), postOffice.isClustered());
+ postOffice.removeBinding(dest.getName(), Configuration.isClustered());
}
else
{
@@ -404,7 +389,7 @@
//Sanity check
- Collection queues = serverPeer.getPostOfficeInstance().getQueuesForCondition(new JMSCondition(false, dest.getName()), true);
+ Collection queues = serverPeer.getPostOffice().getQueuesForCondition(new JMSCondition(false, dest.getName()), true);
if (!queues.isEmpty())
{
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,26 +21,26 @@
*/
package org.jboss.jms.server.endpoint;
-import java.util.Map;
-
-import javax.jms.JMSException;
-
import org.jboss.aop.AspectManager;
import org.jboss.jms.client.delegate.ClientConnectionDelegate;
import org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate;
import org.jboss.jms.delegate.ConnectionFactoryEndpoint;
import org.jboss.jms.delegate.CreateConnectionResult;
import org.jboss.jms.delegate.TopologyResult;
+import org.jboss.jms.server.Configuration;
import org.jboss.jms.server.ServerPeer;
-import org.jboss.jms.server.connectionfactory.JNDIBindings;
import org.jboss.jms.server.endpoint.advised.ConnectionAdvised;
import org.jboss.jms.wireformat.ConnectionFactoryUpdate;
import org.jboss.jms.wireformat.Dispatcher;
import org.jboss.logging.Logger;
import org.jboss.messaging.util.ExceptionUtil;
import org.jboss.remoting.callback.Callback;
-import org.jboss.remoting.callback.ServerInvokerCallbackHandler;
+import org.jboss.remoting.callback.ServerInvokerCallbackHandler;
+import javax.jms.JMSException;
+import java.util.List;
+import java.util.Map;
+
/**
* Concrete implementation of ConnectionFactoryEndpoint
*
@@ -68,7 +68,7 @@
private String id;
- private JNDIBindings jndiBindings;
+ private List<String> jndiBindings;
private int prefetchSize;
@@ -102,7 +102,7 @@
*/
public ServerConnectionFactoryEndpoint(String uniqueName, String id, ServerPeer serverPeer,
String defaultClientID,
- JNDIBindings jndiBindings,
+ List<String> jndiBindings,
int preFetchSize,
boolean slowConsumers,
int defaultTempQueueFullSize,
@@ -173,8 +173,8 @@
// Wait for server side failover to complete
int failoverNodeID = serverPeer.getFailoverWaiter().waitForFailover(failedNodeID);
-
- if (failoverNodeID == -1 || failoverNodeID != serverPeer.getServerPeerID())
+
+ if (failoverNodeID == -1 || failoverNodeID != Configuration.getServerPeerID())
{
log.trace(this + " realized that we are on the wrong node or no failover has occured");
return new CreateConnectionResult(failoverNodeID);
@@ -266,7 +266,7 @@
// See http://jira.jboss.com/jira/browse/JBMESSAGING-797
synchronized (AspectManager.instance())
{
- return new ClientConnectionDelegate(connectionID, serverPeer.getServerPeerID());
+ return new ClientConnectionDelegate(connectionID, Configuration.getServerPeerID());
}
}
@@ -308,7 +308,7 @@
return id;
}
- public JNDIBindings getJNDIBindings()
+ public List<String> getJNDIBindings()
{
return jndiBindings;
}
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,32 +21,25 @@
*/
package org.jboss.jms.server.endpoint;
-import javax.jms.IllegalStateException;
-import javax.jms.InvalidSelectorException;
-import javax.jms.JMSException;
-
import org.jboss.jms.delegate.ConsumerEndpoint;
import org.jboss.jms.destination.JBossDestination;
import org.jboss.jms.message.JBossMessage;
+import org.jboss.jms.server.Configuration;
import org.jboss.jms.server.ServerPeer;
import org.jboss.jms.server.destination.ManagedDestination;
-import org.jboss.jms.server.destination.TopicService;
import org.jboss.jms.server.messagecounter.MessageCounter;
import org.jboss.jms.server.selector.Selector;
import org.jboss.jms.wireformat.Dispatcher;
import org.jboss.logging.Logger;
-import org.jboss.messaging.core.contract.Delivery;
-import org.jboss.messaging.core.contract.DeliveryObserver;
-import org.jboss.messaging.core.contract.Message;
-import org.jboss.messaging.core.contract.MessageReference;
-import org.jboss.messaging.core.contract.PostOffice;
-import org.jboss.messaging.core.contract.Queue;
-import org.jboss.messaging.core.contract.Receiver;
-import org.jboss.messaging.core.contract.Replicator;
+import org.jboss.messaging.core.contract.*;
import org.jboss.messaging.core.impl.SimpleDelivery;
import org.jboss.messaging.core.impl.tx.Transaction;
import org.jboss.messaging.util.ExceptionUtil;
+import javax.jms.IllegalStateException;
+import javax.jms.InvalidSelectorException;
+import javax.jms.JMSException;
+
/**
* Concrete implementation of ConsumerEndpoint. Lives on the boundary between Messaging Core and the
* JMS Facade. Handles delivery of messages from the server to the client side consumer.
@@ -151,7 +144,7 @@
this.startStopLock = new Object();
- this.preserveOrdering = sessionEndpoint.getConnectionEndpoint().getServerPeer().isDefaultPreserveOrdering();
+ this.preserveOrdering = Configuration.isDefaultPreserveOrdering();
this.replicating = replicating;
@@ -519,7 +512,7 @@
if (destination.isTopic())
{
- PostOffice postOffice = sessionEndpoint.getConnectionEndpoint().getServerPeer().getPostOfficeInstance();
+ PostOffice postOffice = sessionEndpoint.getConnectionEndpoint().getServerPeer().getPostOffice();
ServerPeer sp = sessionEndpoint.getConnectionEndpoint().getServerPeer();
@@ -533,7 +526,7 @@
if (!mDest.isTemporary())
{
- String counterName = TopicService.SUBSCRIPTION_MESSAGECOUNTER_PREFIX + queueName;
+ String counterName = ManagedDestination.SUBSCRIPTION_MESSAGECOUNTER_PREFIX + queueName;
MessageCounter counter = sp.getMessageCounterManager().unregisterMessageCounter(counterName);
@@ -547,7 +540,7 @@
{
//Durable sub consumer
- if (queue.isClustered() && postOffice.isClustered())
+ if (queue.isClustered() && Configuration.isClustered())
{
//Clustered durable sub consumer created - we need to remove this info from the replicator
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,43 +21,25 @@
*/
package org.jboss.jms.server.endpoint;
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.jms.IllegalStateException;
-import javax.jms.InvalidDestinationException;
-import javax.jms.JMSException;
-
+import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
+import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
+import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
+import EDU.oswego.cs.dl.util.concurrent.SynchronizedLong;
import org.jboss.aop.AspectManager;
import org.jboss.jms.client.delegate.ClientBrowserDelegate;
import org.jboss.jms.client.delegate.ClientConsumerDelegate;
-import org.jboss.jms.delegate.Ack;
-import org.jboss.jms.delegate.BrowserDelegate;
-import org.jboss.jms.delegate.Cancel;
-import org.jboss.jms.delegate.ConsumerDelegate;
-import org.jboss.jms.delegate.DeliveryInfo;
-import org.jboss.jms.delegate.DeliveryRecovery;
-import org.jboss.jms.delegate.SessionEndpoint;
+import org.jboss.jms.delegate.*;
import org.jboss.jms.destination.JBossDestination;
import org.jboss.jms.destination.JBossQueue;
import org.jboss.jms.destination.JBossTopic;
import org.jboss.jms.message.JBossMessage;
+import org.jboss.jms.server.Configuration;
import org.jboss.jms.server.DestinationManager;
import org.jboss.jms.server.JMSCondition;
import org.jboss.jms.server.ServerPeer;
import org.jboss.jms.server.destination.ManagedDestination;
import org.jboss.jms.server.destination.ManagedQueue;
import org.jboss.jms.server.destination.ManagedTopic;
-import org.jboss.jms.server.destination.TopicService;
import org.jboss.jms.server.endpoint.advised.BrowserAdvised;
import org.jboss.jms.server.endpoint.advised.ConsumerAdvised;
import org.jboss.jms.server.messagecounter.MessageCounter;
@@ -65,18 +47,8 @@
import org.jboss.jms.wireformat.ClientDelivery;
import org.jboss.jms.wireformat.Dispatcher;
import org.jboss.logging.Logger;
-import org.jboss.messaging.core.contract.Binding;
-import org.jboss.messaging.core.contract.Channel;
-import org.jboss.messaging.core.contract.Condition;
-import org.jboss.messaging.core.contract.Delivery;
-import org.jboss.messaging.core.contract.DeliveryObserver;
-import org.jboss.messaging.core.contract.Message;
-import org.jboss.messaging.core.contract.MessageReference;
-import org.jboss.messaging.core.contract.MessageStore;
-import org.jboss.messaging.core.contract.PersistenceManager;
-import org.jboss.messaging.core.contract.PostOffice;
+import org.jboss.messaging.core.contract.*;
import org.jboss.messaging.core.contract.Queue;
-import org.jboss.messaging.core.contract.Replicator;
import org.jboss.messaging.core.impl.IDManager;
import org.jboss.messaging.core.impl.MessagingQueue;
import org.jboss.messaging.core.impl.tx.Transaction;
@@ -90,10 +62,11 @@
import org.jboss.remoting.callback.Callback;
import org.jboss.remoting.callback.ServerInvokerCallbackHandler;
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
-import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
-import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
-import EDU.oswego.cs.dl.util.concurrent.SynchronizedLong;
+import javax.jms.IllegalStateException;
+import javax.jms.InvalidDestinationException;
+import javax.jms.JMSException;
+import java.lang.ref.WeakReference;
+import java.util.*;
/**
* The server side representation of a JMS session.
@@ -200,13 +173,13 @@
dm = sp.getDestinationManager();
- postOffice = sp.getPostOfficeInstance();
+ postOffice = sp.getPostOffice();
- supportsFailover = connectionEndpoint.getConnectionFactoryEndpoint().isSupportsFailover() && postOffice.isClustered();
+ supportsFailover = connectionEndpoint.getConnectionFactoryEndpoint().isSupportsFailover() && Configuration.isClustered();
idm = sp.getChannelIDManager();
- nodeId = sp.getServerPeerID();
+ nodeId = Configuration.getServerPeerID();
tr = sp.getTxRepository();
@@ -220,9 +193,9 @@
tr = sp.getTxRepository();
- defaultMaxDeliveryAttempts = sp.getDefaultMaxDeliveryAttempts();
+ defaultMaxDeliveryAttempts = Configuration.getDefaultMaxDeliveryAttempts();
- defaultRedeliveryDelay = sp.getDefaultRedeliveryDelay();
+ defaultRedeliveryDelay = Configuration.getDefaultRedeliveryDelay();
deliveries = new ConcurrentHashMap();
@@ -522,7 +495,7 @@
try
{
- if (!postOffice.isClustered())
+ if (!Configuration.isClustered())
{
throw new IllegalStateException("Recovering deliveries but post office is not clustered!");
}
@@ -681,11 +654,11 @@
if (dest.isTopic())
{
- mDest = new ManagedTopic(dest.getName(), fullSize, pageSize, downCacheSize, postOffice.isClustered());
+ mDest = new ManagedTopic(dest.getName(), fullSize, pageSize, downCacheSize, Configuration.isClustered());
}
else
{
- mDest = new ManagedQueue(dest.getName(), fullSize, pageSize, downCacheSize, postOffice.isClustered());
+ mDest = new ManagedQueue(dest.getName(), fullSize, pageSize, downCacheSize, Configuration.isClustered());
}
mDest.setTemporary(true);
@@ -696,8 +669,8 @@
{
Queue coreQueue = new MessagingQueue(nodeId, dest.getName(),
idm.getID(), ms, pm, false, -1, null,
- fullSize, pageSize, downCacheSize, postOffice.isClustered(),
- sp.getRecoverDeliveriesTimeout());
+ fullSize, pageSize, downCacheSize, Configuration.isClustered(),
+ Configuration.getRecoverDeliveriesTimeout());
Condition cond = new JMSCondition(true, dest.getName());
@@ -705,7 +678,7 @@
// make a binding for this temporary queue
// temporary queues need to bound on ALL nodes of the cluster
- postOffice.addBinding(new Binding(cond, coreQueue, true), postOffice.isClustered());
+ postOffice.addBinding(new Binding(cond, coreQueue, true), Configuration.isClustered());
coreQueue.activate();
}
@@ -754,7 +727,7 @@
// temporary queues must be unbound on ALL nodes of the cluster
- postOffice.removeBinding(dest.getName(), postOffice.isClustered());
+ postOffice.removeBinding(dest.getName(), Configuration.isClustered());
}
else
{
@@ -827,8 +800,8 @@
}
//Also if it is clustered we must disallow unsubscribing if it has active consumers on other nodes
-
- if (sub.isClustered() && postOffice.isClustered())
+
+ if (sub.isClustered() && Configuration.isClustered())
{
Replicator rep = (Replicator)postOffice;
@@ -841,9 +814,9 @@
}
}
- postOffice.removeBinding(sub.getName(), sub.isClustered() && postOffice.isClustered());
+ postOffice.removeBinding(sub.getName(), sub.isClustered() && Configuration.isClustered());
- String counterName = TopicService.SUBSCRIPTION_MESSAGECOUNTER_PREFIX + sub.getName();
+ String counterName = ManagedDestination.SUBSCRIPTION_MESSAGECOUNTER_PREFIX + sub.getName();
MessageCounter counter = sp.getMessageCounterManager().unregisterMessageCounter(counterName);
@@ -1918,7 +1891,7 @@
mDest.getPageSize(),
mDest.getDownCacheSize(),
mDest.isClustered(),
- sp.getRecoverDeliveriesTimeout());
+ Configuration.getRecoverDeliveriesTimeout());
JMSCondition topicCond = new JMSCondition(false, jmsDestination.getName());
@@ -1926,13 +1899,13 @@
queue.activate();
- String counterName = TopicService.SUBSCRIPTION_MESSAGECOUNTER_PREFIX + queue.getName();
+ String counterName = ManagedDestination.SUBSCRIPTION_MESSAGECOUNTER_PREFIX + queue.getName();
int dayLimitToUse = mDest.getMessageCounterHistoryDayLimit();
if (dayLimitToUse == -1)
{
//Use override on server peer
- dayLimitToUse = sp.getDefaultMessageCounterHistoryDayLimit();
+ dayLimitToUse = Configuration.getDefaultMessageCounterHistoryDayLimit();
}
//We don't create message counters on temp topics
@@ -1976,19 +1949,19 @@
mDest.getPageSize(),
mDest.getDownCacheSize(),
mDest.isClustered(),
- sp.getRecoverDeliveriesTimeout());
+ Configuration.getRecoverDeliveriesTimeout());
// Durable subs must be bound on ALL nodes of the cluster (if clustered)
postOffice.addBinding(new Binding(new JMSCondition(false, jmsDestination.getName()), queue, true),
- postOffice.isClustered() && mDest.isClustered());
+ Configuration.isClustered() && mDest.isClustered());
queue.activate();
//We don't create message counters on temp topics
if (!mDest.isTemporary())
{
- String counterName = TopicService.SUBSCRIPTION_MESSAGECOUNTER_PREFIX + queue.getName();
+ String counterName = ManagedDestination.SUBSCRIPTION_MESSAGECOUNTER_PREFIX + queue.getName();
MessageCounter counter =
new MessageCounter(counterName, subscriptionName, queue, true, true,
@@ -2016,7 +1989,7 @@
// If the durable sub exists because it is clustered and was created on this node due to a bind on another node
// then it will have no message counter
- String counterName = TopicService.SUBSCRIPTION_MESSAGECOUNTER_PREFIX + queue.getName();
+ String counterName = ManagedDestination.SUBSCRIPTION_MESSAGECOUNTER_PREFIX + queue.getName();
boolean createCounter = false;
@@ -2055,7 +2028,7 @@
// Durable subs must be unbound on ALL nodes of the cluster
- postOffice.removeBinding(queue.getName(), postOffice.isClustered() && mDest.isClustered());
+ postOffice.removeBinding(queue.getName(), Configuration.isClustered() && mDest.isClustered());
// create a fresh new subscription
@@ -2065,12 +2038,12 @@
mDest.getPageSize(),
mDest.getDownCacheSize(),
mDest.isClustered(),
- sp.getRecoverDeliveriesTimeout());
+ Configuration.getRecoverDeliveriesTimeout());
// Durable subs must be bound on ALL nodes of the cluster
postOffice.addBinding(new Binding(new JMSCondition(false, jmsDestination.getName()), queue, true),
- postOffice.isClustered() && mDest.isClustered());
+ Configuration.isClustered() && mDest.isClustered());
queue.activate();
@@ -2125,7 +2098,7 @@
jmsDestination, dlqToUse, expiryQueueToUse, redeliveryDelayToUse,
maxDeliveryAttemptsToUse, false, replicating);
- if (queue.isClustered() && postOffice.isClustered() && jmsDestination.isTopic() && subscriptionName != null)
+ if (queue.isClustered() && Configuration.isClustered() && jmsDestination.isTopic() && subscriptionName != null)
{
//Clustered durable sub consumer created - we need to add this info in the replicator - it is needed by other nodes
Added: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/AuthenticationManager.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/AuthenticationManager.java (rev 0)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/AuthenticationManager.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss 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.jms.server.microcontainer;
+
+import org.jboss.security.RealmMapping;
+
+import javax.security.auth.Subject;
+import java.security.Principal;
+import java.util.Set;
+
+/**
+ * @author <a href="ataylor at redhat.com">Andy Taylor</a>
+ */
+public class AuthenticationManager implements org.jboss.security.AuthenticationManager, RealmMapping
+{
+ public String getSecurityDomain()
+ {
+ return "messaging";
+ }
+
+ public boolean isValid(Principal principal, Object object)
+ {
+ return true;
+ }
+
+ public boolean isValid(Principal principal, Object object, Subject subject)
+ {
+ return true;
+ }
+
+
+ public Subject getActiveSubject()
+ {
+ return null;
+ }
+
+
+ public Principal getPrincipal(Principal principal)
+ {
+ return null;
+ }
+
+ public boolean doesUserHaveRole(Principal principal, Set set)
+ {
+ return true;
+ }
+
+ public Set getUserRoles(Principal principal)
+ {
+ return null;
+ }
+}
Added: 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 (rev 0)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/JBMBootstrapServer.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,192 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss 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.jms.server.microcontainer;
+
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+import org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer;
+import org.jboss.kernel.spi.deployment.KernelDeployment;
+import org.jboss.util.CollectionsFactory;
+
+import javax.jms.*;
+import javax.naming.InitialContext;
+import java.net.URL;
+import java.util.List;
+import java.util.ListIterator;
+
+/**
+ * @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;
+
+ /**
+ * 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();
+
+ //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)
+ {
+ url = cl.getResource("META-INF/" + arg);
+ }
+ if(url == null)
+ {
+ throw new RuntimeException("Unable to find rersource:" + arg);
+ }
+ deploy(url);
+ }
+
+ 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);
+ }
+ }
+
+ 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);
+ }
+ }
+ }
+}
+
+
Added: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/JMSTXAgent.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/JMSTXAgent.java (rev 0)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/JMSTXAgent.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss 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.jms.server.microcontainer;
+
+import com.arjuna.ats.tsmx.agent.AgentInterface;
+import com.arjuna.ats.tsmx.agent.exceptions.AgentNotFoundException;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+
+/**
+ * @author <a href="ataylor at redhat.com">Andy Taylor</a>
+ */
+public class JMSTXAgent implements AgentInterface
+{
+ public MBeanServer getAgent() throws AgentNotFoundException
+ {
+ return (MBeanServer) MBeanServerFactory.findMBeanServer("JBOSS").get(0);
+ }
+}
Added: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/JndiBinder.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/JndiBinder.java (rev 0)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/JndiBinder.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss 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.jms.server.microcontainer;
+
+import org.jboss.util.naming.Util;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.Hashtable;
+
+/**
+ * @author <a href="ataylor at redhat.com">Andy Taylor</a>
+ */
+public class JndiBinder
+{
+
+ public JndiBinder()
+ {
+ }
+
+ public void setBindTo(String bindTo)
+ {
+ this.bindTo = bindTo;
+ }
+
+
+ public void setTarget(Object target)
+ {
+ this.target = target;
+ }
+
+
+ public void setSerializable(boolean serializable)
+ {
+ this.serializable = serializable;
+ }
+
+
+ public void setJndiProperties(Hashtable properties)
+ {
+ this.properties = properties;
+ }
+
+ public void start()
+ throws Exception
+ {
+ InitialContext ctx = getInitialContext(properties);
+
+
+ try
+ {
+ if (serializable)
+
+ Util.rebind(ctx, bindTo, target);
+
+
+ else NonSerializableFactory.rebind(ctx, bindTo, target);
+ }
+ catch (NamingException e)
+ {
+
+ NamingException namingException = new NamingException((new StringBuilder()).append("Could not bind JndiBinder service into JNDI under jndiName:").append(ctx.getNameInNamespace()).append("/").append(bindTo).toString());
+ namingException.setRootCause(e);
+ throw namingException;
+ }
+ }
+
+ public void stop()
+ throws Exception
+ {
+ InitialContext ctx = getInitialContext(properties);
+ if (serializable)
+
+ Util.unbind(ctx, bindTo);
+
+
+ else NonSerializableFactory.unbind(ctx, bindTo);
+ }
+
+ private String bindTo;
+ private Object target;
+ private boolean serializable;
+ private Hashtable properties;
+
+ private static InitialContext getInitialContext(Hashtable props)
+ throws NamingException
+ {
+ InitialContext ctx = null;
+ if (props != null)
+
+ ctx = new InitialContext(props);
+
+ else ctx = new InitialContext();
+ return ctx;
+ }
+}
\ No newline at end of file
Added: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/NonSerializableFactory.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/NonSerializableFactory.java (rev 0)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/NonSerializableFactory.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss 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.jms.server.microcontainer;
+
+import org.jboss.util.naming.Util;
+
+import javax.naming.*;
+import javax.naming.spi.ObjectFactory;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+
+/**
+ * @author <a href="ataylor at redhat.com">Andy Taylor</a>
+ */
+public class NonSerializableFactory implements ObjectFactory
+{
+
+ public NonSerializableFactory()
+ {
+ }
+
+ public static void unbind(Context ctx, String strName)
+ throws NamingException
+ {
+ Name name = ctx.getNameParser("").parse(strName);
+ int size = name.size();
+ String atom = name.get(size - 1);
+ Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
+ String key = (new StringBuilder()).append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
+ wrapperMap.remove(key);
+ Util.unbind(ctx, strName);
+ }
+
+
+ public static void rebind(Context ctx, String strName, Object value)
+ throws NamingException
+ {
+ Name name = ctx.getNameParser("").parse(strName);
+ int size = name.size();
+ String atom = name.get(size - 1);
+ Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
+ String key = (new StringBuilder()).append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
+ wrapperMap.put(key, value);
+ String className = value.getClass().getName();
+ String factory = NonSerializableFactory.class.getName();
+ StringRefAddr addr = new StringRefAddr("nns", key);
+ Reference memoryRef = new Reference(className, addr, factory, null);
+ parentCtx.rebind(atom, memoryRef);
+ }
+
+ public static void bind(Context ctx, String strName, Object value)
+ throws NamingException
+ {
+ Name name = ctx.getNameParser("").parse(strName);
+ int size = name.size();
+ String atom = name.get(size - 1);
+ Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
+ String key = (new StringBuilder()).append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
+ wrapperMap.put(key, value);
+ String className = value.getClass().getName();
+ String factory = NonSerializableFactory.class.getName();
+ StringRefAddr addr = new StringRefAddr("nns", key);
+ Reference memoryRef = new Reference(className, addr, factory, null);
+
+ parentCtx.bind(atom, memoryRef);
+ }
+
+
+ public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable env)
+ throws Exception
+ {
+ Reference ref = (Reference) obj;
+ RefAddr addr = ref.get("nns");
+ String key = (String) addr.getContent();
+ return wrapperMap.get(key);
+ }
+
+ private static Map wrapperMap = Collections.synchronizedMap(new HashMap());
+
+}
\ No newline at end of file
Added: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/ServiceLocator.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/ServiceLocator.java (rev 0)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/ServiceLocator.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,124 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss 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.jms.server.microcontainer;
+
+import com.arjuna.ats.jbossatx.jta.TransactionManagerService;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.kernel.spi.dependency.KernelControllerContextAware;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.naming.InitialContext;
+import javax.naming.NameNotFoundException;
+import javax.sql.DataSource;
+import javax.transaction.TransactionManager;
+
+/**
+ * @author <a href="ataylor at redhat.com">Andy Taylor</a>
+ */
+public class ServiceLocator implements KernelControllerContextAware
+{
+ private ObjectName multiplexer;
+ private TransactionManager tm;
+ private DataSource dataSource;
+ private KernelControllerContext kernelControllerContext;
+
+ public void setKernelControllerContext(KernelControllerContext kernelControllerContext) throws Exception
+ {
+ this.kernelControllerContext = kernelControllerContext;
+ }
+
+ public void unsetKernelControllerContext(KernelControllerContext kernelControllerContext) throws Exception
+ {
+ kernelControllerContext = null;
+ }
+
+ public TransactionManager getTransactionManager() throws MalformedObjectNameException
+ {
+ if(tm == null)
+ {
+ Object o = kernelControllerContext.getController().getInstalledContext("jboss:service=TransactionManager").getTarget();
+ if(o instanceof TransactionManagerService)
+ {
+ tm = ((TransactionManagerService) o).getTransactionManager();
+ }
+ else
+ {
+ tm = (TransactionManager) o;
+ }
+
+ }
+ return tm;
+ }
+
+ public void setTransactionManager(TransactionManager transactionManager)
+ {
+ this.tm = transactionManager;
+ }
+
+ public DataSource getDataSource() throws Exception
+ {
+ if(dataSource == null)
+ {
+ InitialContext ic = new InitialContext();
+ //try in the initial context, if its not there use the one that has been injected
+ try
+ {
+ dataSource = (DataSource)ic.lookup("java:DefaultDS");
+ }
+ catch (NameNotFoundException e)
+ {
+ dataSource = (DataSource) kernelControllerContext.getController().getInstalledContext("DataSource").getTarget();
+ }
+ }
+ return dataSource;
+ }
+
+ public void setDataSource(DataSource datasource)
+ {
+ this.dataSource = datasource;
+ }
+
+
+
+ public ObjectName getMultiplexer()
+ {
+ return multiplexer;
+ }
+
+ public void setMultiplexer(ObjectName multiplexer)
+ {
+ this.multiplexer = multiplexer;
+ }
+ /*if(mBeanServer != null)
+ {
+ TransactionManagerServiceMBean tms =
+ (TransactionManagerServiceMBean) MBeanServerInvocationHandler.
+ newProxyInstance(mBeanServer, new ObjectName("jboss:service=TransactionManager"), TransactionManagerServiceMBean.class, false);
+
+ tm = tms.getTransactionManager();
+ }
+ else
+ {
+ tm = (TransactionManager) kernelControllerContext.getKernel().getRegistry().getEntry("TransactionManager").getTarget();
+ }*/
+}
Added: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/factory/Connector.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/factory/Connector.java (rev 0)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/factory/Connector.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss 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.jms.server.microcontainer.factory;
+
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.ServerInvocationHandler;
+
+import java.util.Map;
+
+/**
+ * @author <a href="ataylor at redhat.com">Andy Taylor</a>
+ */
+public class Connector extends org.jboss.remoting.transport.Connector
+{
+ private ServerInvocationHandler serverInvocationHandler;
+
+ public Connector()
+ {
+ super(); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ public Connector(String locatorURI)
+ {
+ super(locatorURI); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ public Connector(InvokerLocator locator)
+ {
+ super(locator); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ public Connector(Map configuration)
+ {
+ super(configuration); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ public Connector(String locatorURI, Map configuration)
+ {
+ super(locatorURI, configuration); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ public Connector(InvokerLocator locator, Map configuration)
+ {
+ super(locator, configuration); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ protected Connector(boolean isMarshallerConnector)
+ {
+ super(isMarshallerConnector); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ public void setInvocationHandler(ServerInvocationHandler handler) throws Exception
+ {
+ serverInvocationHandler=handler;
+ }
+
+
+ public void start() throws Exception
+ {
+ super.start();
+ super.addInvocationHandler("JMS", serverInvocationHandler);
+ }
+}
Added: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/factory/mBeanServerCreator.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/factory/mBeanServerCreator.java (rev 0)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/microcontainer/factory/mBeanServerCreator.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss 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.jms.server.microcontainer.factory;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+
+/**
+ * @author <a href="ataylor at redhat.com">Andy Taylor</a>
+ */
+public class mBeanServerCreator
+{
+ public static MBeanServer createMBeanServer()
+ {
+ return MBeanServerFactory.createMBeanServer("JBOSS");
+ }
+}
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManager.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManager.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManager.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,25 +21,13 @@
*/
package org.jboss.jms.server.plugin;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.sql.DataSource;
-import javax.transaction.TransactionManager;
-
import org.jboss.jms.server.plugin.contract.JMSUserManager;
import org.jboss.logging.Logger;
import org.jboss.messaging.core.impl.JDBCSupport;
+import java.sql.*;
+import java.util.*;
+
/**
* A JDBCJMSUserManager
*
@@ -57,12 +45,7 @@
private static final Logger log = Logger.getLogger(JDBCJMSUserManager.class);
// Constructors ----------------------------------------------------
-
- public JDBCJMSUserManager(DataSource ds, TransactionManager tm, Properties sqlProperties,
- boolean createTablesOnStartup)
- {
- super(ds, tm, sqlProperties, createTablesOnStartup);
- }
+
// JDBCSupport overrides ----------------------------
Deleted: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManagerService.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManagerService.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManagerService.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -1,108 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss 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.jms.server.plugin;
-
-import javax.transaction.TransactionManager;
-
-import org.jboss.jms.server.plugin.contract.JMSUserManager;
-import org.jboss.messaging.core.contract.MessagingComponent;
-import org.jboss.messaging.core.jmx.JDBCServiceSupport;
-import org.jboss.messaging.util.ExceptionUtil;
-
-/**
- * A JDBCJMSUserManagerService
- *
- * MBean wrapper for a JMSUserManager
- *
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- *
- */
-public class JDBCJMSUserManagerService extends JDBCServiceSupport
-{
- private JMSUserManager userManager;
-
- private boolean started;
-
- // Constructors -----------------------------------------------------
-
- public JDBCJMSUserManagerService()
- {
- }
-
- // ServerPlugin implementation ------------------------------------------
-
- public MessagingComponent getInstance()
- {
- return userManager;
- }
-
- // ServiceMBeanSupport overrides ---------------------------------
-
- protected synchronized void startService() throws Exception
- {
- if (started)
- {
- throw new IllegalStateException("Service is already started");
- }
-
- super.startService();
-
- try
- {
- TransactionManager tm = getTransactionManagerReference();
-
- userManager = new JDBCJMSUserManager(ds, tm, sqlProperties, createTablesOnStartup);
-
- userManager.start();
-
- started = true;
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " startService");
- }
- }
-
- protected void stopService() throws Exception
- {
- if (!started)
- {
- throw new IllegalStateException("Service is not started");
- }
-
- super.stopService();
-
- try
- {
- userManager.stop();
-
- started = false;
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " startService");
- }
- }
-}
Added: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/security/Role.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/security/Role.java (rev 0)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/security/Role.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss 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.jms.server.security;
+
+/**
+ * @author <a href="ataylor at redhat.com">Andy Taylor</a>
+ */
+public class Role
+{
+ String name;
+ private boolean read = false;
+ private boolean write = false;
+ private boolean create = false;
+
+
+ public Role()
+ {
+ }
+
+ public Role(String name, boolean read, boolean write, boolean create)
+ {
+ this.name = name;
+ this.read = read;
+ this.write = write;
+ this.create = create;
+ }
+
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public boolean isRead()
+ {
+ return read;
+ }
+
+ public void setRead(boolean read)
+ {
+ this.read = read;
+ }
+
+ public boolean isWrite()
+ {
+ return write;
+ }
+
+ public void setWrite(boolean write)
+ {
+ this.write = write;
+ }
+
+ public boolean isCreate()
+ {
+ return create;
+ }
+
+ public void setCreate(boolean create)
+ {
+ this.create = create;
+ }
+
+ public String toString()
+ {
+ return "Role {name=" + name + ";read=" + read + ";write=" + write + ";create=" + create + "}";
+ }
+
+}
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/security/SecurityMetadata.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/security/SecurityMetadata.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/security/SecurityMetadata.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,150 +21,104 @@
*/
package org.jboss.jms.server.security;
-import java.io.StringReader;
-import java.util.HashMap;
+import org.jboss.logging.Logger;
+import org.jboss.security.SimplePrincipal;
+
import java.util.HashSet;
import java.util.Set;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.jboss.logging.Logger;
-import org.jboss.security.SimplePrincipal;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
/**
* SecurityMetadata.java
- *
- *
+ * <p/>
+ * <p/>
* Created: Tue Feb 26 15:02:29 2002
*
* @author Peter
- * @version
*/
-public class SecurityMetadata {
- static Role DEFAULT_ROLE = new Role("guest", true, true, true);
+public class SecurityMetadata
+{
+ static Role DEFAULT_ROLE = new Role("guest", true, true, true);
- static class Role {
- String name;
- boolean read= false;
- boolean write = false;
- boolean create = false;
- public Role(String name, boolean read, boolean write, boolean create) {
- this.name = name;
- this.read = read;
- this.write = write;
- this.create = create;
- }
- public String toString() {
- return "Role {name="+name+";read="+read+";write="+write+";create="+create+"}";
- }
+ HashSet<Role> roles = new HashSet<Role>();
+ HashSet<SimplePrincipal> read = new HashSet<SimplePrincipal>();
+ HashSet<SimplePrincipal> write = new HashSet<SimplePrincipal>();
+ HashSet<SimplePrincipal> create = new HashSet<SimplePrincipal>();
+ static Logger log = Logger.getLogger(SecurityMetadata.class);
- }
+ /**
+ * create with default roles
+ */
+ public SecurityMetadata()
+ {
+ addRole(DEFAULT_ROLE);
+ }
- HashMap roles = new HashMap();
- HashSet read = new HashSet();
- HashSet write = new HashSet();
- HashSet create = new HashSet();
- static Logger log = Logger.getLogger(SecurityMetadata.class);
+ /**
+ * create with roles provided
+ * @param roles
+ * @throws Exception
+ */
+ public SecurityMetadata(HashSet<Role> roles) throws Exception
+ {
+ setRoles(roles);
+ }
- public SecurityMetadata() {
- addRole(DEFAULT_ROLE);
- }
- /**
- * Create with given xml @see configure.
- *
- * If the configure script is null, a default role named guest will be
- * created with read and write access, but no create access.
- */
- public SecurityMetadata(String conf)throws Exception {
- configure(conf);
- }
- public SecurityMetadata(Element conf)throws Exception {
- configure(conf);
- }
- /**
- * Configure with an xml string.
- *
- * The format of the string is:
- * <security>
- * <role name="nameOfRole" read="true" write="true" create="false"/>
- * </security>
- *
- * There may be one or more role elements.
- */
- public void configure(String conf) throws Exception {
- Element sec = null;
- if (conf != null) {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder parser = factory.newDocumentBuilder();
- Document doc = parser.parse(new InputSource(new StringReader(conf)));
- sec = doc.getDocumentElement();
+ public void addRole(String name, boolean read, boolean write, boolean create)
+ {
+ Role r = new Role(name, read, write, create);
+ addRole(r);
+ }
- }
- configure(sec);
- }
+ public void addRole(Role r)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Adding role: " + r.toString());
- public void configure(Element sec) throws Exception {
+ roles.add(r);
+ SimplePrincipal p = new SimplePrincipal(r.name);
+ if (r.isRead())
+ read.add(p);
+ if (r.isWrite())
+ write.add(p);
+ if (r.isCreate())
+ create.add(p);
+ }
- if (sec == null) {
- addRole(DEFAULT_ROLE);
- }else {
+ public Set<SimplePrincipal> getReadPrincipals()
+ {
+ return read;
+ }
- if (!sec.getTagName().equals("security"))
- throw new SAXException("Configuration document not valid: root element must be security, not " + sec.getTagName());
+ public Set<SimplePrincipal> getWritePrincipals()
+ {
+ return write;
+ }
- // Parse
- NodeList list = sec.getElementsByTagName("role");
- int l = list.getLength();
- for(int i = 0; i<l;i++) {
- Element role = (Element)list.item(i);
- Attr na = role.getAttributeNode("name");
- if (na == null)
- throw new SAXException("There must exist a name attribute of role");
- String n = na.getValue();
- boolean r = role.getAttributeNode("read") != null ? Boolean.valueOf( role.getAttributeNode("read").getValue() ).booleanValue() : false;
- boolean w = role.getAttributeNode("write") != null ? Boolean.valueOf( role.getAttributeNode("write").getValue() ).booleanValue() : false;
- boolean c = role.getAttributeNode("create") != null ? Boolean.valueOf( role.getAttributeNode("create").getValue() ).booleanValue() : false;
- addRole(n,r,w,c);
+ public Set<SimplePrincipal> getCreatePrincipals()
+ {
+ return create;
+ }
- }
- }
- }
- public void addRole(String name, boolean read, boolean write, boolean create) {
- Role r = new Role(name,read,write,create);
- addRole(r);
- }
+ public HashSet<Role> getRoles()
+ {
+ return roles;
+ }
- public void addRole(Role r) {
- if (log.isTraceEnabled())
- log.trace("Adding role: " + r.toString());
+ public void setRoles(HashSet< Role> roles)
+ {
+ this.roles = roles;
+ for (Role role : roles)
+ {
+ SimplePrincipal p = new SimplePrincipal(role.name);
+ if (role.isRead())
+ read.add(p);
+ if (role.isWrite())
+ write.add(p);
+ if (role.isCreate())
+ create.add(p);
+ }
+ }
- roles.put(r.name,r);
- SimplePrincipal p = new SimplePrincipal(r.name);
- if(r.read == true)
- read.add(p);
- if(r.write == true)
- write.add(p);
- if (r.create == true)
- create.add(p);
- }
-
- public Set getReadPrincipals() {
- return read;
- }
-
- public Set getWritePrincipals() {
- return write;
- }
-
- public Set getCreatePrincipals() {
- return create;
- }
} // SecurityMetadata
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/security/SecurityMetadataStore.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/security/SecurityMetadataStore.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/jms/server/security/SecurityMetadataStore.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,24 +21,24 @@
*/
package org.jboss.jms.server.security;
-import java.security.Principal;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import javax.jms.JMSSecurityException;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.security.auth.Subject;
-
+import org.jboss.jms.server.Configuration;
import org.jboss.jms.server.SecurityStore;
import org.jboss.logging.Logger;
import org.jboss.security.AuthenticationManager;
import org.jboss.security.RealmMapping;
import org.jboss.security.SimplePrincipal;
import org.jboss.security.SubjectSecurityManager;
-import org.w3c.dom.Element;
+import javax.jms.JMSSecurityException;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.security.auth.Subject;
+import java.security.Principal;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
/**
* A security metadate store for JMS. Stores security information for destinations and delegates
* authentication and authorization to a JaasSecurityManager.
@@ -70,10 +70,7 @@
private AuthenticationManager authenticationManager;
private RealmMapping realmMapping;
-
- private Element defaultSecurityConfig;
- private String securityDomain;
-
+
private String suckerPassword;
// Static --------------------------------------------------------
@@ -96,12 +93,12 @@
if (m == null)
{
// No SecurityMetadata was configured for the destination, apply the default
- if (defaultSecurityConfig != null)
+ if (Configuration.getSecurityConfig() != null)
{
log.debug("No SecurityMetadadata was available for " + destName + ", using default security config");
try
{
- m = new SecurityMetadata(defaultSecurityConfig);
+ m = new SecurityMetadata(Configuration.getSecurityConfig());
}
catch (Exception e)
{
@@ -123,7 +120,7 @@
return m;
}
- public void setSecurityConfig(boolean isQueue, String destName, Element conf) throws Exception
+ public void setSecurityConfig(boolean isQueue, String destName, HashSet<Role> conf) throws Exception
{
if (trace) { log.trace("adding security configuration for " + (isQueue ? "queue " : "topic ") + destName); }
@@ -241,7 +238,7 @@
try
{
- Object mgr = ic.lookup(securityDomain);
+ Object mgr = ic.lookup(Configuration.getSecurityDomain());
log.debug("JaasSecurityManager is " + mgr);
@@ -253,12 +250,12 @@
catch (NamingException e)
{
// Apparently there is no security context, try adding java:/jaas
- log.warn("Failed to lookup securityDomain " + securityDomain, e);
+ log.warn("Failed to lookup securityDomain " + Configuration.getSecurityDomain(), e);
- if (!securityDomain.startsWith("java:/jaas/"))
+ if (!Configuration.getSecurityDomain().startsWith("java:/jaas/"))
{
authenticationManager =
- (SubjectSecurityManager)ic.lookup("java:/jaas/" + securityDomain);
+ (SubjectSecurityManager)ic.lookup("java:/jaas/" + Configuration.getSecurityDomain());
}
else
{
@@ -275,28 +272,8 @@
{
}
- public String getSecurityDomain()
- {
- return this.securityDomain;
- }
- public void setSecurityDomain(String securityDomain)
- {
- this.securityDomain = securityDomain;
- }
- public Element getDefaultSecurityConfig()
- {
- return this.defaultSecurityConfig;
- }
-
- public void setDefaultSecurityConfig(Element conf) throws Exception
- {
- // Force a parse
- new SecurityMetadata(conf);
- defaultSecurityConfig = conf;
- }
-
// Protected -----------------------------------------------------
// Package Private -----------------------------------------------
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/contract/PostOffice.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/contract/PostOffice.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/contract/PostOffice.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,12 +21,12 @@
*/
package org.jboss.messaging.core.contract;
+import org.jboss.messaging.core.impl.tx.Transaction;
+
import java.util.Collection;
import java.util.Map;
import java.util.Set;
-import org.jboss.messaging.core.impl.tx.Transaction;
-
/**
*
* A post office holds bindings of queues to conditions.
@@ -47,14 +47,7 @@
*
*/
public interface PostOffice extends MessagingComponent
-{
- /**
- * Get the name of the post office
- *
- * @return The name of this post office
- */
- String getOfficeName();
-
+{
/**
* Add a binding to the post office
* @param binding The binding to add
@@ -120,14 +113,7 @@
* @return
* @throws Exception
*/
- Collection getAllBindings() throws Exception;
-
- /**
- * Is this post office clustered?
- *
- * @return true If the post office is clustered
- */
- boolean isClustered();
+ Collection getAllBindings() throws Exception;
/**
* Get the failover map
@@ -155,5 +141,7 @@
Map getRecoveryArea(String queueName);
int getRecoveryMapSize(String queueName);
+
+ void setClusterNotifier(ClusterNotifier clusterNotifier);
}
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,34 +21,6 @@
*/
package org.jboss.messaging.core.impl;
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.InputStream;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.sql.Types;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.sql.DataSource;
-import javax.transaction.TransactionManager;
-import javax.transaction.xa.Xid;
-
import org.jboss.jms.tx.MessagingXid;
import org.jboss.logging.Logger;
import org.jboss.messaging.core.contract.Message;
@@ -63,6 +35,11 @@
import org.jboss.messaging.util.StreamUtils;
import org.jboss.messaging.util.Util;
+import javax.transaction.xa.Xid;
+import java.io.*;
+import java.sql.*;
+import java.util.*;
+
/**
* JDBC implementation of PersistenceManager
*
@@ -89,7 +66,7 @@
private boolean usingTrailingByte = false;
- private int maxParams;
+ private int maxParams = 100;
private short orderCount;
@@ -99,29 +76,10 @@
// Some versions of the oracle driver don't support binding blobs on select clauses,
// what would force us to use a two stage insert (insert and if successful, update)
- private boolean supportsBlobSelect;
+ private boolean supportsBlobSelect = true;
// Constructors --------------------------------------------------
-
- public JDBCPersistenceManager(DataSource ds, TransactionManager tm, Properties sqlProperties,
- boolean createTablesOnStartup, boolean usingBatchUpdates,
- boolean usingBinaryStream, boolean usingTrailingByte, int maxParams,
- boolean supportsBlobSelect)
- {
- super(ds, tm, sqlProperties, createTablesOnStartup);
-
- //usingBatchUpdates is currently ignored due to sketchy support from databases
-
- this.usingBinaryStream = usingBinaryStream;
-
- this.usingTrailingByte = usingTrailingByte;
-
- this.maxParams = maxParams;
-
- this.supportsBlobSelect = supportsBlobSelect;
- }
-
-
+
// MessagingComponent overrides ---------------------------------
public void start() throws Exception
@@ -2485,5 +2443,74 @@
return (id1 < id2 ? -1 : (id1 == id2 ? 0 : 1));
}
}
-
+
+ public boolean isUsingBinaryStream()
+ {
+ return usingBinaryStream;
+ }
+
+ public void setUsingBinaryStream(boolean usingBinaryStream)
+ {
+ this.usingBinaryStream = usingBinaryStream;
+ }
+
+ public boolean isUsingTrailingByte()
+ {
+ return usingTrailingByte;
+ }
+
+ public void setUsingTrailingByte(boolean usingTrailingByte)
+ {
+ this.usingTrailingByte = usingTrailingByte;
+ }
+
+ public int getMaxParams()
+ {
+ return maxParams;
+ }
+
+ public void setMaxParams(int maxParams)
+ {
+ this.maxParams = maxParams;
+ }
+
+ public short getOrderCount()
+ {
+ return orderCount;
+ }
+
+ public void setOrderCount(short orderCount)
+ {
+ this.orderCount = orderCount;
+ }
+
+ public int getNodeID()
+ {
+ return nodeID;
+ }
+
+ public void setNodeID(int nodeID)
+ {
+ this.nodeID = nodeID;
+ }
+
+ public boolean isNodeIDSet()
+ {
+ return nodeIDSet;
+ }
+
+ public void setNodeIDSet(boolean nodeIDSet)
+ {
+ this.nodeIDSet = nodeIDSet;
+ }
+
+ public boolean isSupportsBlobSelect()
+ {
+ return supportsBlobSelect;
+ }
+
+ public void setSupportsBlobSelect(boolean supportsBlobSelect)
+ {
+ this.supportsBlobSelect = supportsBlobSelect;
+ }
}
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/impl/JDBCSupport.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/impl/JDBCSupport.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/impl/JDBCSupport.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,24 +21,19 @@
*/
package org.jboss.messaging.core.impl;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Properties;
+import org.jboss.logging.Logger;
+import org.jboss.messaging.core.contract.MessagingComponent;
import javax.sql.DataSource;
import javax.transaction.Status;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.*;
-import org.jboss.logging.Logger;
-import org.jboss.messaging.core.contract.MessagingComponent;
-
/**
* Common functionality for messaging components that need to access a database.
*
@@ -74,24 +69,7 @@
sqlProperties = new Properties();
}
-
- public JDBCSupport(DataSource ds, TransactionManager tm, Properties sqlProperties,
- boolean createTablesOnStartup)
- {
- this();
- this.ds = ds;
-
- this.tm = tm;
-
- if (sqlProperties != null)
- {
- this.sqlProperties = sqlProperties;
- }
-
- this.createTablesOnStartup = createTablesOnStartup;
- }
-
// MessagingComponent overrides ---------------------------------
public void start() throws Exception
@@ -516,4 +494,44 @@
public abstract T doTransaction() throws Exception;
}
+ public TransactionManager getTm()
+ {
+ return tm;
+ }
+
+ public void setTm(TransactionManager tm)
+ {
+ this.tm = tm;
+ }
+
+ public Properties getSqlProperties()
+ {
+ return sqlProperties;
+ }
+
+ public void setSqlProperties(Properties sqlProperties)
+ {
+ this.sqlProperties = sqlProperties;
+ }
+
+ public boolean isCreateTablesOnStartup()
+ {
+ return createTablesOnStartup;
+ }
+
+ public void setCreateTablesOnStartup(boolean createTablesOnStartup)
+ {
+ this.createTablesOnStartup = createTablesOnStartup;
+ }
+
+
+ public DataSource getDs()
+ {
+ return ds;
+ }
+
+ public void setDs(DataSource ds)
+ {
+ this.ds = ds;
+ }
}
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/impl/jchannelfactory/MultiplexerChannelFactory.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/impl/jchannelfactory/MultiplexerChannelFactory.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/impl/jchannelfactory/MultiplexerChannelFactory.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -22,16 +22,15 @@
package org.jboss.messaging.core.impl.jchannelfactory;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
import org.jboss.messaging.core.contract.ChannelFactory;
import org.jgroups.Channel;
+import org.jgroups.JChannelFactory;
/**
* A ChannelFactory that will use the MBean ChannelFactory interface
*
* @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ * @author <a href="mailto:ataylor at redhat.com">Andy Taylor</a>
* @version <tt>$Revision$</tt>
* $Id$
*/
@@ -40,29 +39,23 @@
// Constants ------------------------------------------------------------------------------------
- private static final String[] MUX_SIGNATURE = new String[]{"java.lang.String",
- "java.lang.String", "boolean", "java.lang.String"};
// Attributes -----------------------------------------------------------------------------------
- MBeanServer server;
- ObjectName channelFactory;
+ JChannelFactory jChannelFactory;
String dataStack;
String controlStack;
String uniqueID;
- private static final String MUX_OPERATION = "createMultiplexerChannel";
// Static ---------------------------------------------------------------------------------------
// Constructors ---------------------------------------------------------------------------------
- public MultiplexerChannelFactory(MBeanServer server,
- ObjectName channelFactory,
+ public MultiplexerChannelFactory(JChannelFactory jChannelFactory,
String uniqueID,
String controlStack,
String dataStack)
{
- this.server = server;
- this.channelFactory = channelFactory;
+ this.jChannelFactory = jChannelFactory;
this.uniqueID = uniqueID;
this.dataStack = dataStack;
this.controlStack = controlStack;
@@ -70,26 +63,7 @@
// Public ---------------------------------------------------------------------------------------
- public MBeanServer getServer()
- {
- return server;
- }
- public void setServer(MBeanServer server)
- {
- this.server = server;
- }
-
- public ObjectName getChannelFactory()
- {
- return channelFactory;
- }
-
- public void setChannelFactory(ObjectName channelFactory)
- {
- this.channelFactory = channelFactory;
- }
-
public String getDataStack()
{
return dataStack;
@@ -122,16 +96,12 @@
public Channel createControlChannel() throws Exception
{
- return (Channel) server.invoke(this.channelFactory, MUX_OPERATION,
- new Object[]{controlStack, uniqueID + "-CTRL", Boolean.TRUE, uniqueID}, MUX_SIGNATURE);
+ return jChannelFactory.createMultiplexerChannel(controlStack, uniqueID + "-CTRL", Boolean.TRUE, uniqueID);
}
- //Note that for the data channel we don't receive state immediately after connecting so third param
- //must be false http://jira.jboss.com/jira/browse/JBMESSAGING-1120
public Channel createDataChannel() throws Exception
{
- return (Channel) server.invoke(this.channelFactory, MUX_OPERATION,
- new Object[]{dataStack, uniqueID + "-DATA", Boolean.FALSE, uniqueID}, MUX_SIGNATURE);
+ return jChannelFactory.createMultiplexerChannel(dataStack, uniqueID + "-DATA", Boolean.TRUE, uniqueID);
}
// Package protected ----------------------------------------------------------------------------
Modified: branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -21,56 +21,19 @@
*/
package org.jboss.messaging.core.impl.postoffice;
-import java.io.Serializable;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.Types;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.Vector;
-
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanNotificationInfo;
-import javax.management.Notification;
-import javax.management.NotificationBroadcasterSupport;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.sql.DataSource;
-import javax.transaction.TransactionManager;
-
+import EDU.oswego.cs.dl.util.concurrent.*;
import org.jboss.jms.client.container.JMSClientVMIdentifier;
+import org.jboss.jms.server.Configuration;
+import org.jboss.jms.server.JMSConditionFactory;
import org.jboss.jms.server.ServerPeer;
import org.jboss.jms.server.endpoint.ServerSessionEndpoint;
import org.jboss.logging.Logger;
-import org.jboss.messaging.core.contract.Binding;
-import org.jboss.messaging.core.contract.ChannelFactory;
-import org.jboss.messaging.core.contract.ClusterNotification;
-import org.jboss.messaging.core.contract.ClusterNotifier;
-import org.jboss.messaging.core.contract.Condition;
-import org.jboss.messaging.core.contract.ConditionFactory;
-import org.jboss.messaging.core.contract.Delivery;
-import org.jboss.messaging.core.contract.Filter;
-import org.jboss.messaging.core.contract.FilterFactory;
-import org.jboss.messaging.core.contract.Message;
-import org.jboss.messaging.core.contract.MessageReference;
-import org.jboss.messaging.core.contract.MessageStore;
-import org.jboss.messaging.core.contract.MessagingComponent;
-import org.jboss.messaging.core.contract.PersistenceManager;
-import org.jboss.messaging.core.contract.PostOffice;
+import org.jboss.messaging.core.contract.*;
import org.jboss.messaging.core.contract.Queue;
-import org.jboss.messaging.core.contract.Replicator;
import org.jboss.messaging.core.impl.IDManager;
import org.jboss.messaging.core.impl.JDBCSupport;
import org.jboss.messaging.core.impl.MessagingQueue;
+import org.jboss.messaging.core.impl.jchannelfactory.MultiplexerChannelFactory;
import org.jboss.messaging.core.impl.tx.Transaction;
import org.jboss.messaging.core.impl.tx.TransactionRepository;
import org.jboss.messaging.core.impl.tx.TxCallback;
@@ -78,18 +41,21 @@
import org.jboss.messaging.util.ConcurrentHashSet;
import org.jboss.messaging.util.StreamUtils;
import org.jgroups.Address;
+import org.jgroups.JChannelFactory;
import org.jgroups.View;
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
-import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
-import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
-import EDU.oswego.cs.dl.util.concurrent.ReadWriteLock;
-import EDU.oswego.cs.dl.util.concurrent.ReentrantWriterPreferenceReadWriteLock;
+import javax.management.*;
+import java.io.Serializable;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Types;
+import java.util.*;
/**
* @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
* @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
* @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
+ * @author <a href="mailto:ataylor at redhat.com>Andy Taylor</a>
* @version <tt>$Revision: 2782 $</tt>
*
* $Id: DefaultClusteredPostOffice.java 2782 2007-06-14 12:16:17Z timfox $
@@ -163,9 +129,8 @@
private FilterFactory filterFactory;
private ConditionFactory conditionFactory;
-
- private int thisNodeID;
+
// Map <Condition, List <Queue>> - for ALL nodes
private Map mappings;
@@ -179,11 +144,7 @@
private Map channelIDMap;
private ReadWriteLock lock;
-
- private String officeName;
-
- private boolean clustered;
-
+
//Started still needs to be volatile since the ReadWriteLock won't synchronize between threads
private volatile boolean started;
@@ -224,107 +185,27 @@
private volatile int failoverNodeID = -1;
private volatile boolean firstNode;
-
+
+ private JChannelFactory channelFactory;
//We keep use a semaphore to limit the number of concurrent replication requests to avoid
//overwhelming JGroups
private ClearableSemaphore replicateSemaphore;
-
- private boolean useJGroupsWorkaround;
+
// Constructors ---------------------------------------------------------------------------------
+ public MessagingPostOffice()
+ {
+ lock = new ReentrantWriterPreferenceReadWriteLock();
- /*
- * Constructor for a non clustered post office
- */
- public MessagingPostOffice(DataSource ds,
- TransactionManager tm,
- Properties sqlProperties,
- boolean createTablesOnStartup,
- int nodeId,
- String officeName,
- MessageStore ms,
- PersistenceManager pm,
- TransactionRepository tr,
- FilterFactory filterFactory,
- ConditionFactory conditionFactory,
- IDManager channelIDManager,
- ClusterNotifier clusterNotifier)
- throws Exception
- {
- super (ds, tm, sqlProperties, createTablesOnStartup);
+ conditionFactory = new JMSConditionFactory();
- this.thisNodeID = nodeId;
-
- this.ms = ms;
-
- this.pm = pm;
-
- this.tr = tr;
-
- this.filterFactory = filterFactory;
-
- this.conditionFactory = conditionFactory;
-
- this.officeName = officeName;
-
- this.clustered = false;
-
- this.channelIDManager = channelIDManager;
-
- this.clusterNotifier = clusterNotifier;
+ waitForBindUnbindLock = new Object();
+ }
- lock = new ReentrantWriterPreferenceReadWriteLock();
-
- waitForBindUnbindLock = new Object();
- }
+
- /*
- * Constructor for a clustered post office
- */
- public MessagingPostOffice(DataSource ds,
- TransactionManager tm,
- Properties sqlProperties,
- boolean createTablesOnStartup,
- int nodeId,
- String officeName,
- MessageStore ms,
- PersistenceManager pm,
- TransactionRepository tr,
- FilterFactory filterFactory,
- ConditionFactory conditionFactory,
- IDManager channelIDManager,
- ClusterNotifier clusterNotifier,
- String groupName,
- ChannelFactory jChannelFactory,
- long stateTimeout, long castTimeout,
- boolean supportsFailover,
- int maxConcurrentReplications)
- throws Exception
- {
- this(ds, tm, sqlProperties, createTablesOnStartup, nodeId, officeName, ms, pm, tr,
- filterFactory, conditionFactory, channelIDManager, clusterNotifier);
-
- this.clustered = true;
-
- groupMember = new GroupMember(groupName, stateTimeout, castTimeout, jChannelFactory, this, this);
- this.supportsFailover = supportsFailover;
-
- nbSupport = new NotificationBroadcasterSupport();
-
- replicateSemaphore = new ClearableSemaphore(maxConcurrentReplications);
-
- this.useJGroupsWorkaround = "true".equals(System.getProperty("jboss.messaging.usejgroupsworkaround"));
-
- log.debug("Using JGroups flow control workaround: " + this.useJGroupsWorkaround);
- }
-
// MessagingComponent overrides -----------------------------------------------------------------
-
- public MessagingComponent getInstance()
- {
- return this;
- }
public void start() throws Exception
{
@@ -342,31 +223,41 @@
loadedBindings = getBindingsFromStorage();
- if (clustered)
+ if (Configuration.isClustered())
{
- groupMember.start();
+ ChannelFactory jChannelFactory = new MultiplexerChannelFactory(channelFactory, Configuration.getChannelPartitionName(),
+ Configuration.getControlChannelName(), Configuration.getDataChannelName());
+ groupMember = new GroupMember(Configuration.getGroupName(), Configuration.getStateTimeout(), Configuration.getCastTimeout(), jChannelFactory, this, this);
+ replicateSemaphore = new ClearableSemaphore(Configuration.getMaxConcurrentReplications());
+
- //Sanity check - we check there aren't any other nodes already in the cluster with the same node id
- if (knowAboutNodeId(thisNodeID))
+
+ log.debug("Using JGroups flow control workaround: " + Configuration.isUseJGroupsWorkaround());
+
+ nbSupport = new NotificationBroadcasterSupport();
+ groupMember.start();
+
+ //Sanity check - we check there aren't any other nodes already in the cluster with the same node id
+ if (knowAboutNodeId(Configuration.getServerPeerID()))
{
throw new IllegalArgumentException("Cannot start post office since there is already a post office in the " +
- "cluster with the same node id (" + thisNodeID + "). " +
+ "cluster with the same node id (" + Configuration.getServerPeerID() + "). " +
"Are you sure you have given each node a unique node id during installation?");
}
-
+
PostOfficeAddressInfo info = new PostOfficeAddressInfo(groupMember.getSyncAddress(), groupMember.getAsyncAddress());
-
- nodeIDAddressMap.put(new Integer(thisNodeID), info);
-
+
+ nodeIDAddressMap.put(new Integer(Configuration.getServerPeerID()), info);
+
//calculate the failover map
calculateFailoverMap();
-
+
String clientVMId = JMSClientVMIdentifier.instance;
-
+
//add our vm identifier to the replicator
put(Replicator.JVM_ID_KEY, clientVMId);
-
- groupMember.multicastControl(new JoinClusterRequest(thisNodeID, info), true);
+
+ groupMember.multicastControl(new JoinClusterRequest(Configuration.getServerPeerID(), info), true);
}
//Now load the bindings for this node
@@ -391,10 +282,10 @@
super.stop();
- if (clustered)
+ if (Configuration.isClustered())
{
//Need to send this *before* stopping
- groupMember.multicastControl(new LeaveClusterRequest(thisNodeID), true);
+ groupMember.multicastControl(new LeaveClusterRequest(Configuration.getServerPeerID()), true);
groupMember.stop();
}
@@ -427,13 +318,7 @@
}
// PostOffice implementation -------------------------------------------------------------------------
-
- public String getOfficeName()
- {
- return officeName;
- }
-
-
+
public boolean addBinding(Binding binding, boolean allNodes) throws Exception
{
if (allNodes && !binding.queue.isClustered())
@@ -443,7 +328,7 @@
boolean added = internalAddBinding(binding, allNodes, true);
- if (added && allNodes && clustered && binding.queue.isClustered())
+ if (added && allNodes && Configuration.isClustered() && binding.queue.isClustered())
{
//Now we must wait for all the bindings to appear in state
//This is necessary since the second bind in an all bind is sent asynchronously to avoid deadlock
@@ -463,7 +348,7 @@
{
Binding binding = internalRemoveBinding(queueName, allNodes, true);
- if (binding != null && allNodes && clustered && binding.queue.isClustered())
+ if (binding != null && allNodes && Configuration.isClustered() && binding.queue.isClustered())
{
//Now we must wait for all the bindings to be removed from state
//This is necessary since the second unbind in an all unbind is sent asynchronously to avoid deadlock
@@ -496,7 +381,7 @@
throw new IllegalArgumentException("Condition is null");
}
- if (!localOnly && !clustered)
+ if (!localOnly && !Configuration.isClustered())
{
throw new IllegalArgumentException("Cannot request clustered queues on non clustered post office");
}
@@ -523,7 +408,7 @@
{
Queue queue = (Queue)iter.next();
- if (!localOnly || (queue.getNodeID() == thisNodeID))
+ if (!localOnly || (queue.getNodeID() == Configuration.getServerPeerID()))
{
list.add(queue);
}
@@ -581,12 +466,7 @@
lock.readLock().release();
}
}
-
- public boolean isClustered()
- {
- return clustered;
- }
-
+
public Map getFailoverMap()
{
synchronized (failoverMap)
@@ -623,7 +503,7 @@
//This is to prevent overwhelming JGroups
//See http://jira.jboss.com/jira/browse/JBMESSAGING-1112
- if (reply && this.useJGroupsWorkaround)
+ if (reply && Configuration.isUseJGroupsWorkaround())
{
//We timeout to avoid locking the system in event of failure
boolean ok = replicateSemaphore.tryAcquire(SEMAPHORE_ACQUIRE_TIMEOUT);
@@ -647,12 +527,12 @@
{
//TODO optimise this
- PostOfficeAddressInfo info = (PostOfficeAddressInfo)nodeIDAddressMap.get(new Integer(thisNodeID));
+ PostOfficeAddressInfo info = (PostOfficeAddressInfo)nodeIDAddressMap.get(new Integer(Configuration.getServerPeerID()));
replyAddress = info.getDataChannelAddress();
}
- ClusterRequest request = new ReplicateDeliveryMessage(thisNodeID, queueName, sessionID, messageID, deliveryID, replyAddress);
+ ClusterRequest request = new ReplicateDeliveryMessage(Configuration.getServerPeerID(), queueName, sessionID, messageID, deliveryID, replyAddress);
if (trace) { log.trace(this + " sending replicate delivery message " + queueName + " " + sessionID + " " + messageID); }
@@ -680,7 +560,7 @@
//There is no need to lock this while failover node change is occuring since the receiving node is tolerant to duplicate
//adds or acks
- ClusterRequest request = new ReplicateAckMessage(thisNodeID, queueName, messageID);
+ ClusterRequest request = new ReplicateAckMessage(Configuration.getServerPeerID(), queueName, messageID);
Address address = getFailoverNodeDataChannelAddress();
@@ -780,7 +660,7 @@
long channelID = channelIDManager.getID();
- Queue queue2 = new MessagingQueue(thisNodeID, mapping.getQueueName(), channelID, ms, pm,
+ Queue queue2 = new MessagingQueue(Configuration.getServerPeerID(), mapping.getQueueName(), channelID, ms, pm,
mapping.isRecoverable(), mapping.getMaxSize(), filter,
mapping.getFullSize(), mapping.getPageSize(), mapping.getDownCacheSize(),
true, mapping.getRecoverDeliveriesTimeout());
@@ -809,7 +689,7 @@
replicatedData = copyReplicatedData(state.getReplicatedData());
}
- nodeIDAddressMap = new HashMap(state.getNodeIDAddressMap());
+ nodeIDAddressMap = new HashMap(state.getNodeIDAddressMap());
}
public byte[] getState() throws Exception
@@ -894,13 +774,13 @@
int oldFailoverNodeID = failoverNodeID;
- if (trace) { log.trace("Old failover node id: " + oldFailoverNodeID); }
+ if (trace) { log.trace("Old failover node id: " + oldFailoverNodeID); }
calculateFailoverMap();
if (trace) { log.trace("First node is now " + firstNode); }
- if (firstNode && this.useJGroupsWorkaround)
+ if (firstNode && Configuration.isUseJGroupsWorkaround())
{
//If we are now the first node in the cluster then any outstanding replication requests will not get responses
//so we must release these and we have no more need of a semaphore until another node joins
@@ -943,7 +823,7 @@
throw new IllegalStateException("Cannot find failover node for node " + leftNodeID);
}
- if (fnodeID.intValue() == thisNodeID)
+ if (fnodeID.intValue() == Configuration.getServerPeerID())
{
// The node crashed and we are the failover node so let's perform failover
@@ -969,7 +849,7 @@
{
//Failover node for this node has changed
- failoverNodeChanged(oldFailoverNodeID, firstNode, false);
+ failoverNodeChanged(oldFailoverNodeID, firstNode, false);
}
}
@@ -1021,7 +901,7 @@
long channelID = channelIDManager.getID();
- Queue queue2 = new MessagingQueue(thisNodeID, mapping.getQueueName(), channelID, ms, pm,
+ Queue queue2 = new MessagingQueue(Configuration.getServerPeerID(), mapping.getQueueName(), channelID, ms, pm,
mapping.isRecoverable(), mapping.getMaxSize(), filter,
mapping.getFullSize(), mapping.getPageSize(), mapping.getDownCacheSize(), true,
mapping.getRecoverDeliveriesTimeout());
@@ -1059,7 +939,7 @@
throw new IllegalStateException("Don't know about node id: " + mapping.getNodeId());
}
- removeBindingInMemory(mapping.getNodeId(), mapping.getQueueName());
+ removeBindingInMemory(mapping.getNodeId(), mapping.getQueueName());
synchronized (waitForBindUnbindLock)
{
@@ -1082,7 +962,7 @@
{
//No need to remove the nodeid-address map info, this will be removed when data cleaned for node
- leftSet.add(new Integer(nodeId));
+ leftSet.add(new Integer(nodeId));
//We don't update the failover map here since this doesn't get called if the node crashed
}
@@ -1099,7 +979,7 @@
calculateFailoverMap();
- if (wasFirstNode && useJGroupsWorkaround)
+ if (wasFirstNode && Configuration.isUseJGroupsWorkaround())
{
//If we were the first node but now another node has joined - we need to re-enable the semaphore
replicateSemaphore.enable();
@@ -1235,7 +1115,7 @@
{
Queue queue = binding.queue;
- queue.addToRecoveryArea(nodeID, messageID, sessionID);
+ queue.addToRecoveryArea(nodeID, messageID, sessionID);
}
if (trace) { log.trace(this + " reply address is " + replyAddress); }
@@ -1300,7 +1180,7 @@
Queue queue = binding.queue;
- queue.removeFromRecoveryArea(nodeID, messageID);
+ queue.removeFromRecoveryArea(nodeID, messageID);
}
@@ -1311,7 +1191,7 @@
//TODO - this does not belong here
final ServerSessionEndpoint session = serverPeer.getSession(sessionID);
- if (this.useJGroupsWorkaround)
+ if (Configuration.isUseJGroupsWorkaround())
{
replicateSemaphore.release();
}
@@ -1417,9 +1297,9 @@
public void put(Serializable key, Serializable replicant) throws Exception
{
- putReplicantLocally(thisNodeID, key, replicant);
+ putReplicantLocally(Configuration.getServerPeerID(), key, replicant);
- PutReplicantRequest request = new PutReplicantRequest(thisNodeID, key, replicant);
+ PutReplicantRequest request = new PutReplicantRequest(Configuration.getServerPeerID(), key, replicant);
groupMember.multicastControl(request, true);
}
@@ -1436,9 +1316,9 @@
public boolean remove(Serializable key) throws Exception
{
- if (removeReplicantLocally(thisNodeID, key))
+ if (removeReplicantLocally(Configuration.getServerPeerID(), key))
{
- RemoveReplicantRequest request = new RemoveReplicantRequest(thisNodeID, key);
+ RemoveReplicantRequest request = new RemoveReplicantRequest(Configuration.getServerPeerID(), key);
groupMember.multicastControl(request, true);
@@ -1616,9 +1496,9 @@
channelIDMap = new HashMap();
- nodeIDAddressMap = new ConcurrentHashMap();
+ nodeIDAddressMap = new ConcurrentHashMap();
- if (clustered)
+ if (Configuration.isClustered())
{
replicatedData = new HashMap();
@@ -1631,6 +1511,9 @@
replyExecutor = new QueuedExecutor(new LinkedQueue());
replicateResponseExecutor = new QueuedExecutor(new LinkedQueue());
+
+ replicateSemaphore = new ClearableSemaphore(Configuration.getMaxConcurrentReplications());
+
}
private void deInit()
@@ -1643,7 +1526,7 @@
nodeIDAddressMap = null;
- if (clustered)
+ if (Configuration.isClustered())
{
replicatedData = null;
@@ -1659,11 +1542,11 @@
private void requestDeliveries(Queue queue) throws Exception
{
- if (!firstNode && supportsFailover && clustered && queue.isClustered())
+ if (!firstNode && supportsFailover && Configuration.isClustered() && queue.isClustered())
{
// reverse lookup in failover map
- Integer masterNodeID = getMasterForFailoverNodeID(thisNodeID);
+ Integer masterNodeID = getMasterForFailoverNodeID(Configuration.getServerPeerID());
if (masterNodeID != null)
{
@@ -1682,7 +1565,7 @@
dumpFailoverMap(this.failoverMap);
- PostOfficeAddressInfo info = (PostOfficeAddressInfo)nodeIDAddressMap.get(new Integer(thisNodeID));
+ PostOfficeAddressInfo info = (PostOfficeAddressInfo)nodeIDAddressMap.get(new Integer(Configuration.getServerPeerID()));
Address replyAddress = info.getDataChannelAddress();
@@ -1833,7 +1716,7 @@
private boolean internalAddBinding(Binding binding, boolean allNodes, boolean sync) throws Exception
{
- if (trace) { log.trace(thisNodeID + " binding " + binding.queue + " with condition " + binding.condition + " all nodes " + allNodes); }
+ if (trace) { log.trace(Configuration.getServerPeerID() + " binding " + binding.queue + " with condition " + binding.condition + " all nodes " + allNodes); }
if (binding == null)
{
@@ -1849,7 +1732,7 @@
throw new IllegalArgumentException("Queue is null");
}
- if (queue.getNodeID() != thisNodeID)
+ if (queue.getNodeID() != Configuration.getServerPeerID())
{
throw new IllegalArgumentException("Cannot bind a queue from another node");
}
@@ -1870,11 +1753,11 @@
insertBindingInStorage(condition, queue, binding.allNodes);
}
- if (clustered && queue.isClustered())
+ if (Configuration.isClustered() && queue.isClustered())
{
String filterString = queue.getFilter() == null ? null : queue.getFilter().getFilterString();
- MappingInfo info = new MappingInfo(thisNodeID, queue.getName(), condition.toText(), filterString, queue.getChannelID(),
+ MappingInfo info = new MappingInfo(Configuration.getServerPeerID(), queue.getName(), condition.toText(), filterString, queue.getChannelID(),
queue.isRecoverable(), true,
binding.allNodes,
queue.getFullSize(), queue.getPageSize(), queue.getDownCacheSize(),
@@ -1892,14 +1775,14 @@
private Binding internalRemoveBinding(String queueName, boolean allNodes, boolean sync) throws Throwable
{
- if (trace) { log.trace(thisNodeID + " unbind queue: " + queueName + " all nodes " + allNodes); }
+ if (trace) { log.trace(Configuration.getServerPeerID() + " unbind queue: " + queueName + " all nodes " + allNodes); }
if (queueName == null)
{
throw new IllegalArgumentException("Queue name is null");
}
- Binding removed = removeBindingInMemory(thisNodeID, queueName);
+ Binding removed = removeBindingInMemory(Configuration.getServerPeerID(), queueName);
//The queue might not be removed (it's already removed) if two unbind all requests are sent simultaneously on the cluster
if (removed != null)
@@ -1915,11 +1798,11 @@
deleteBindingFromStorage(queue);
}
- if (clustered && queue.isClustered())
+ if (Configuration.isClustered() && queue.isClustered())
{
String filterString = queue.getFilter() == null ? null : queue.getFilter().getFilterString();
- MappingInfo info = new MappingInfo(thisNodeID, queue.getName(), condition.toText(), filterString, queue.getChannelID(),
+ MappingInfo info = new MappingInfo(Configuration.getServerPeerID(), queue.getName(), condition.toText(), filterString, queue.getChannelID(),
queue.isRecoverable(), true, allNodes);
UnbindRequest request = new UnbindRequest(info, allNodes);
@@ -1973,14 +1856,14 @@
throw new IllegalStateException("Cannot find node id for address " + failoverAddress);
}
- failoverMap.put(theNodeID, failoverNodeID);
+ failoverMap.put(theNodeID, failoverNodeID);
}
- int fid = ((Integer)failoverMap.get(new Integer(thisNodeID))).intValue();
+ int fid = ((Integer)failoverMap.get(new Integer(Configuration.getServerPeerID()))).intValue();
//if we are the first node in the cluster we don't want to be our own failover node!
- if (fid == thisNodeID)
+ if (fid == Configuration.getServerPeerID())
{
firstNode = true;
failoverNodeID = -1;
@@ -2086,7 +1969,7 @@
if (trace) { log.trace(this + " considering queue " + queue); }
- if (queue.getNodeID() == thisNodeID)
+ if (queue.getNodeID() == Configuration.getServerPeerID())
{
if (trace) { log.trace(this + " is a local queue"); }
@@ -2295,7 +2178,7 @@
{
nameMaps.remove(nid);
- if (nodeID == thisNodeID)
+ if (nodeID == nodeID)
{
localNameMap = null;
}
@@ -2373,7 +2256,7 @@
nameMaps.put(nid, nameMap);
- if (queue.getNodeID() == thisNodeID)
+ if (queue.getNodeID() == Configuration.getServerPeerID())
{
localNameMap = nameMap;
}
@@ -2459,9 +2342,9 @@
{
ps = conn.prepareStatement(getSQLStatement("LOAD_BINDINGS"));
- ps.setString(1, officeName);
+ ps.setString(1, Configuration.getPostOfficeName());
- ps.setInt(2, thisNodeID);
+ ps.setInt(2, Configuration.getServerPeerID());
rs = ps.executeQuery();
@@ -2491,8 +2374,8 @@
filter = filterFactory.createFilter(selector);
}
- Queue queue = new MessagingQueue(thisNodeID, queueName, channelID, ms, pm,
- true, filter, bindingClustered && clustered);
+ Queue queue = new MessagingQueue(Configuration.getServerPeerID(), queueName, channelID, ms, pm,
+ true, filter, bindingClustered && Configuration.isClustered());
if (trace) { log.trace(this + " loaded binding from storage: " + queueName); }
@@ -2530,11 +2413,11 @@
Queue queue = binding.queue;
//Need to broadcast it too
- if (clustered && queue.isClustered())
+ if (Configuration.isClustered() && queue.isClustered())
{
String filterString = queue.getFilter() == null ? null : queue.getFilter().getFilterString();
- MappingInfo info = new MappingInfo(thisNodeID, queue.getName(), binding.condition.toText(), filterString, queue.getChannelID(),
+ MappingInfo info = new MappingInfo(Configuration.getServerPeerID(), queue.getName(), binding.condition.toText(), filterString, queue.getChannelID(),
queue.isRecoverable(), true,
binding.allNodes,
queue.getFullSize(), queue.getPageSize(), queue.getDownCacheSize(),
@@ -2563,8 +2446,8 @@
{
ps = conn.prepareStatement(getSQLStatement("INSERT_BINDING"));
- ps.setString(1, officeName);
- ps.setInt(2, thisNodeID);
+ ps.setString(1, Configuration.getPostOfficeName());
+ ps.setInt(2, Configuration.getServerPeerID());
ps.setString(3, queue.getName());
ps.setString(4, condition.toText());
String filterString = queue.getFilter() != null ? queue.getFilter().getFilterString() : null;
@@ -2620,7 +2503,7 @@
{
ps = conn.prepareStatement(getSQLStatement("DELETE_BINDING"));
- ps.setString(1, officeName);
+ ps.setString(1, Configuration.getPostOfficeName());
ps.setInt(2, queue.getNodeID());
ps.setString(3, queue.getName());
@@ -2640,7 +2523,7 @@
private boolean leaveMessageReceived(Integer nodeId) throws Exception
{
- return leftSet.remove(nodeId);
+ return leftSet.remove(nodeId);
}
/*
@@ -2718,7 +2601,7 @@
}
//remove node id - address info
- nodeIDAddressMap.remove(nodeToRemove);
+ nodeIDAddressMap.remove(nodeToRemove);
synchronized (waitForBindUnbindLock)
{
@@ -2762,12 +2645,12 @@
}
}
- return nodeID;
+ return nodeID;
}
private boolean knowAboutNodeId(int nodeID)
{
- return nodeIDAddressMap.get(new Integer(nodeID)) != null;
+ return nodeIDAddressMap.get(new Integer(nodeID)) != null;
}
private Map copyReplicatedData(Map toCopy)
@@ -2816,7 +2699,7 @@
{
//The failover node has changed - we need to move our replicated deliveries
- if (trace) { log.trace("Failover node has changed from " + oldFailoverNodeID + " to " + failoverNodeID); }
+ if (trace) { log.trace("Failover node has changed from " + oldFailoverNodeID + " to " + failoverNodeID); }
if (!firstNode)
{
@@ -2828,7 +2711,7 @@
{
if (trace) { log.trace("Old failover node still exists, telling it remove replicated deliveries"); }
- ClusterRequest request = new AckAllReplicatedDeliveriesMessage(thisNodeID);
+ ClusterRequest request = new AckAllReplicatedDeliveriesMessage(Configuration.getServerPeerID());
groupMember.unicastData(request, info.getDataChannelAddress());
@@ -2877,7 +2760,7 @@
throw new IllegalStateException("Cannot find address for failover node " + failoverNodeID);
}
- ClusterRequest request = new AddAllReplicatedDeliveriesMessage(thisNodeID, deliveries);
+ ClusterRequest request = new AddAllReplicatedDeliveriesMessage(Configuration.getServerPeerID(), deliveries);
groupMember.unicastData(request, info.getDataChannelAddress());
@@ -2898,7 +2781,7 @@
*/
private void performFailover(Integer failedNodeID) throws Exception
{
- log.info("JBoss Messaging is failing over for failed node " + failedNodeID +
+ log.info("JBoss Messaging is failing over for failed node " + failedNodeID +
". If there are many messages to reload this may take some time...");
ClusterNotification notification = new ClusterNotification(ClusterNotification.TYPE_FAILOVER_START, failedNodeID.intValue(), null);
@@ -2907,7 +2790,7 @@
log.debug(this + " announced it is starting failover procedure");
- pm.mergeTransactions(failedNodeID.intValue(), thisNodeID);
+ pm.mergeTransactions(failedNodeID.intValue(), Configuration.getServerPeerID());
// Need to lock
lock.writeLock().acquire();
@@ -3042,6 +2925,33 @@
log.debug(this + " sent " + notificationType + " JMX notification");
}
+ public void setPm(PersistenceManager pm)
+ {
+ this.pm = pm;
+ }
+
+
+ public PersistenceManager getPm()
+ {
+ return pm;
+ }
+
+
+ public JChannelFactory getChannelFactory()
+ {
+ return channelFactory;
+ }
+
+ public void setChannelFactory(JChannelFactory channelFactory)
+ {
+ this.channelFactory = channelFactory;
+ }
+
+ public void setClusterNotifier(ClusterNotifier clusterNotifier)
+ {
+ this.clusterNotifier = clusterNotifier;
+ }
+
// Inner classes --------------------------------------------------------------------------------
private class SendReplicatedDeliveriesRunnable implements Runnable
@@ -3085,7 +2995,7 @@
if (gotSome)
{
- ClusterRequest req = new AddAllReplicatedDeliveriesMessage(thisNodeID, dels);
+ ClusterRequest req = new AddAllReplicatedDeliveriesMessage(Configuration.getServerPeerID(), dels);
groupMember.unicastData(req, address);
}
Deleted: branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/jmx/JDBCPersistenceManagerService.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/jmx/JDBCPersistenceManagerService.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/jmx/JDBCPersistenceManagerService.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -1,177 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss 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.messaging.core.jmx;
-
-import javax.transaction.TransactionManager;
-
-import org.jboss.messaging.core.contract.MessagingComponent;
-import org.jboss.messaging.core.contract.PersistenceManager;
-import org.jboss.messaging.core.impl.JDBCPersistenceManager;
-import org.jboss.messaging.util.ExceptionUtil;
-
-/**
- * A JDBCPersistenceManagerService
- *
- * MBean wrapper around a JDBCPersistenceManager
- *
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * @version <tt>$Revision: 2684 $</tt>
- *
- * $Id: JDBCPersistenceManagerService.java 2684 2007-05-15 07:31:30Z timfox $
- *
- */
-public class JDBCPersistenceManagerService extends JDBCServiceSupport
-{
- private PersistenceManager persistenceManager;
-
- private boolean started;
-
- private boolean usingBatchUpdates;
-
- private boolean usingBinaryStream = true;
-
- private boolean usingTrailingByte;
-
- private int maxParams = 100;
-
- private boolean supportsBlobOnSelect = true;
-
- // Constructors --------------------------------------------------------
-
- public JDBCPersistenceManagerService()
- {
- }
-
- // ServerPlugin implementation ------------------------------------------
-
- public MessagingComponent getInstance()
- {
- return persistenceManager;
- }
-
- // ServiceMBeanSupport overrides -----------------------------------------
-
- protected synchronized void startService() throws Exception
- {
- if (started)
- {
- throw new IllegalStateException("Service is already started");
- }
-
- super.startService();
-
- try
- {
- TransactionManager tm = getTransactionManagerReference();
-
- persistenceManager =
- new JDBCPersistenceManager(ds, tm, sqlProperties,
- createTablesOnStartup, usingBatchUpdates,
- usingBinaryStream, usingTrailingByte, maxParams,
- supportsBlobOnSelect);
-
- persistenceManager.start();
-
- started = true;
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " startService");
- }
- }
-
- protected void stopService() throws Exception
- {
- if (!started)
- {
- throw new IllegalStateException("Service is not started");
- }
-
- try
- {
- persistenceManager.stop();
-
- persistenceManager = null;
-
- started = false;
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " startService");
- }
-
- log.debug(this + " stopped");
- }
-
- // MBean attributes -------------------------------------------------------
-
- public boolean isUsingBatchUpdates()
- {
- return usingBatchUpdates;
- }
-
- public void setUsingBatchUpdates(boolean b)
- {
- usingBatchUpdates = b;
- }
-
- public int getMaxParams()
- {
- return maxParams;
- }
-
- public void setMaxParams(int maxParams)
- {
- this.maxParams = maxParams;
- }
-
- public boolean isUsingBinaryStream()
- {
- return usingBinaryStream;
- }
-
- public void setUsingBinaryStream(boolean b)
- {
- usingBinaryStream = b;
- }
-
- public boolean isUsingTrailingByte()
- {
- return usingTrailingByte;
- }
-
- public void setUsingTrailingByte(boolean b)
- {
- usingTrailingByte = b;
- }
-
- public boolean isSupportsBlobOnSelect()
- {
- return supportsBlobOnSelect;
- }
-
- public void setSupportsBlobOnSelect(boolean b)
- {
- this.supportsBlobOnSelect = b;
- }
-
-}
Deleted: branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/jmx/MessagingPostOfficeService.java
===================================================================
--- branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/jmx/MessagingPostOfficeService.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/src/main/org/jboss/messaging/core/jmx/MessagingPostOfficeService.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -1,469 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss 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.messaging.core.jmx;
-
-import java.util.Set;
-
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanNotificationInfo;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.management.ObjectName;
-import javax.transaction.TransactionManager;
-
-import org.jboss.jms.server.JMSConditionFactory;
-import org.jboss.jms.server.ServerPeer;
-import org.jboss.jms.server.selector.SelectorFactory;
-import org.jboss.messaging.core.contract.ClusterNotifier;
-import org.jboss.messaging.core.contract.ConditionFactory;
-import org.jboss.messaging.core.contract.FilterFactory;
-import org.jboss.messaging.core.contract.ChannelFactory;
-import org.jboss.messaging.core.contract.MessageStore;
-import org.jboss.messaging.core.contract.MessagingComponent;
-import org.jboss.messaging.core.contract.PersistenceManager;
-import org.jboss.messaging.core.impl.IDManager;
-import org.jboss.messaging.core.impl.jchannelfactory.MultiplexerChannelFactory;
-import org.jboss.messaging.core.impl.jchannelfactory.XMLChannelFactory;
-import org.jboss.messaging.core.impl.postoffice.MessagingPostOffice;
-import org.jboss.messaging.core.impl.tx.TransactionRepository;
-import org.jboss.messaging.util.ExceptionUtil;
-import org.jboss.messaging.util.JMXAccessor;
-import org.w3c.dom.Element;
-
-/**
- * A MessagingPostOfficeService
- *
- * MBean wrapper for a messaging post office
- *
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision: 2684 $</tt>
- *
- * $Id: ClusteredPostOfficeService.java 2684 2007-05-15 07:31:30Z timfox $
- *
- */
-public class MessagingPostOfficeService extends JDBCServiceSupport
-{
- // Constants -----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private boolean started;
-
- // This group of properties is used on JGroups Channel configuration
- private Element controlChannelConfig;
-
- private Element dataChannelConfig;
-
- private ObjectName channelFactoryName;
-
- private String controlChannelName;
-
- private String dataChannelName;
-
- private String channelPartitionName;
-
- private ObjectName serverPeerObjectName;
-
- private String officeName;
-
- private long stateTimeout = 5000;
-
- private long castTimeout = 5000;
-
- private String groupName;
-
- private boolean clustered;
-
- private int maxConcurrentReplications = 25;
-
- private MessagingPostOffice postOffice;
-
- // Constructors --------------------------------------------------
-
- // ServerPlugin implementation -----------------------------------
-
- public MessagingComponent getInstance()
- {
- return postOffice;
- }
-
- // NotificationBroadcaster implementation ------------------------
-
- public void addNotificationListener(NotificationListener listener,
- NotificationFilter filter,
- Object object) throws IllegalArgumentException
- {
- postOffice.addNotificationListener(listener, filter, object);
- }
-
- public void removeNotificationListener(NotificationListener listener)
- throws ListenerNotFoundException
- {
- postOffice.removeNotificationListener(listener);
- }
-
- public MBeanNotificationInfo[] getNotificationInfo()
- {
- return postOffice.getNotificationInfo();
- }
-
-
- // MBean attributes ----------------------------------------------
-
- public synchronized ObjectName getServerPeer()
- {
- return serverPeerObjectName;
- }
-
- public synchronized void setServerPeer(ObjectName on)
- {
- if (started)
- {
- log.warn("Cannot set attribute when service is started");
- return;
- }
- this.serverPeerObjectName = on;
- }
-
- public synchronized String getPostOfficeName()
- {
- return officeName;
- }
-
- public synchronized void setPostOfficeName(String name)
- {
- if (started)
- {
- log.warn("Cannot set attribute when service is started");
- return;
- }
- this.officeName = name;
- }
-
- public ObjectName getChannelFactoryName()
- {
- return channelFactoryName;
- }
-
- public void setChannelFactoryName(ObjectName channelFactoryName)
- {
- if (started)
- {
- log.warn("Cannot set attribute when service is started");
- return;
- }
- this.channelFactoryName = channelFactoryName;
- }
-
- public String getControlChannelName()
- {
- return controlChannelName;
- }
-
- public void setControlChannelName(String controlChannelName)
- {
- if (started)
- {
- log.warn("Cannot set attribute when service is started");
- return;
- }
- this.controlChannelName = controlChannelName;
- }
-
- public String getDataChannelName()
- {
- return dataChannelName;
- }
-
- public void setDataChannelName(String dataChannelName)
- {
- if (started)
- {
- log.warn("Cannot set attribute when service is started");
- return;
- }
- this.dataChannelName = dataChannelName;
- }
-
- public String getChannelPartitionName()
- {
- return channelPartitionName;
- }
-
- public void setChannelPartitionName(String channelPartitionName)
- {
- if (started)
- {
- log.warn("Cannot set attribute when service is started");
- return;
- }
- this.channelPartitionName = channelPartitionName;
- }
-
- public void setControlChannelConfig(Element config) throws Exception
- {
- if (started)
- {
- log.warn("Cannot set attribute when service is started");
- return;
- }
- controlChannelConfig = config;
- }
-
- public Element getControlChannelConfig()
- {
- return controlChannelConfig;
- }
-
- public void setDataChannelConfig(Element config) throws Exception
- {
- if (started)
- {
- log.warn("Cannot set attribute when service is started");
- return;
- }
- dataChannelConfig = config;
- }
-
- public Element getDataChannelConfig()
- {
- return dataChannelConfig;
- }
-
- public void setStateTimeout(long timeout)
- {
- if (started)
- {
- log.warn("Cannot set attribute when service is started");
- return;
- }
- this.stateTimeout = timeout;
- }
-
- public long getStateTimeout()
- {
- return stateTimeout;
- }
-
- public void setCastTimeout(long timeout)
- {
- if (started)
- {
- log.warn("Cannot set attribute when service is started");
- return;
- }
- this.castTimeout = timeout;
- }
-
- public long getCastTimeout()
- {
- return castTimeout;
- }
-
- public void setGroupName(String groupName)
- {
- this.groupName = groupName;
- }
-
- public String getGroupName()
- {
- return groupName;
- }
-
- public boolean isClustered()
- {
- return clustered;
- }
-
- public void setClustered(boolean clustered)
- {
- if (started)
- {
- log.warn("Cannot set attribute when service is started");
- return;
- }
- this.clustered = clustered;
- }
-
- public int getMaxConcurrentReplications()
- {
- return maxConcurrentReplications;
- }
-
- public void setMaxConcurrentReplications(int number)
- {
- this.maxConcurrentReplications = number;
- }
-
- public String listBindings()
- {
- return postOffice.printBindingInformation();
- }
-
- public Set getNodeIDView()
- {
- return postOffice.nodeIDView();
- }
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // ServiceMBeanSupport overrides ---------------------------------
-
- protected synchronized void startService() throws Exception
- {
- if (started)
- {
- throw new IllegalStateException("Service is already started");
- }
-
- super.startService();
-
- try
- {
- TransactionManager tm = getTransactionManagerReference();
-
- ServerPeer serverPeer = (ServerPeer) JMXAccessor.getJMXAttributeOverSecurity(server, serverPeerObjectName, "Instance");
-
- MessageStore ms = serverPeer.getMessageStore();
-
- PersistenceManager pm = serverPeer.getPersistenceManagerInstance();
-
- TransactionRepository tr = serverPeer.getTxRepository();
-
- IDManager idManager = serverPeer.getChannelIDManager();
-
- int nodeId = serverPeer.getServerPeerID();
-
- ClusterNotifier clusterNotifier = serverPeer.getClusterNotifier();
-
- ConditionFactory cf = new JMSConditionFactory();
-
- FilterFactory ff = new SelectorFactory();
-
- if (clustered)
- {
- ChannelFactory jChannelFactory = null;
-
- if (channelFactoryName != null)
- {
- Object info = null;
- try
- {
- info = server.getMBeanInfo(channelFactoryName);
- }
- catch (Exception e)
- {
- // log.error("Error", e);
- // noop... means we couldn't find the channel hence we should use regular
- // XMLChannelFactories
- }
-
- if (info != null)
- {
- log.debug(this + " uses MultiplexerJChannelFactory");
-
- jChannelFactory =
- new MultiplexerChannelFactory(server, channelFactoryName, channelPartitionName,
- controlChannelName, dataChannelName);
- }
- else
- {
- log.debug(this + " uses XMLJChannelFactory");
- jChannelFactory = new XMLChannelFactory(controlChannelConfig, dataChannelConfig);
- }
- }
- else
- {
- log.debug(this + " uses XMLJChannelFactory");
- jChannelFactory = new XMLChannelFactory(controlChannelConfig, dataChannelConfig);
- }
-
- postOffice = new MessagingPostOffice(ds, tm, sqlProperties,
- createTablesOnStartup,
- nodeId, officeName, ms,
- pm,
- tr, ff, cf, idManager,
- clusterNotifier,
- groupName,
- jChannelFactory,
- stateTimeout, castTimeout,
- serverPeer.isSupportsFailover(),
- maxConcurrentReplications);
- }
- else
- {
- postOffice = new MessagingPostOffice(ds, tm, sqlProperties,
- createTablesOnStartup,
- nodeId, officeName, ms,
- pm,
- tr, ff, cf, idManager,
- clusterNotifier);
- }
-
- postOffice.start();
-
- started = true;
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " startService");
- }
- }
-
- protected void stopService() throws Exception
- {
- if (!started)
- {
- throw new IllegalStateException("Service is not started");
- }
-
- super.stopService();
-
- try
- {
- postOffice.stop();
-
- postOffice = null;
-
- started = false;
-
- log.debug(this + " stopped");
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " startService");
- }
- }
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
-
Modified: branches/Branch_MC_Integration_New/tests/src/org/jboss/test/messaging/tools/aop/PoisonInterceptor.java
===================================================================
--- branches/Branch_MC_Integration_New/tests/src/org/jboss/test/messaging/tools/aop/PoisonInterceptor.java 2007-11-02 21:51:14 UTC (rev 3286)
+++ branches/Branch_MC_Integration_New/tests/src/org/jboss/test/messaging/tools/aop/PoisonInterceptor.java 2007-11-05 17:26:49 UTC (rev 3287)
@@ -6,9 +6,6 @@
*/
package org.jboss.test.messaging.tools.aop;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-
import org.jboss.aop.advice.Interceptor;
import org.jboss.aop.joinpoint.Invocation;
import org.jboss.aop.joinpoint.MethodInvocation;
@@ -23,6 +20,9 @@
import org.jboss.logging.Logger;
import org.jboss.test.messaging.tools.container.RMITestServer;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+
/**
* Used to force a "poisoned" server to do all sorts of bad things. Used for testing.
*
@@ -251,7 +251,7 @@
{
try
{
- int serverId = getServerPeer(target).getServerPeerID();
+ int serverId = getServerPeer(target).getConfiguration().getServerPeerID();
//First unregister from the RMI registry
Registry registry = LocateRegistry.getRegistry(RMITestServer.DEFAULT_REGISTRY_PORT);
More information about the jboss-cvs-commits
mailing list