[jboss-cvs] JBoss Messaging SVN: r1761 - in branches/Branch_Client_Failover_Experiment: src/etc/server/default/deploy src/etc/xmdesc src/main/org/jboss/jms/client/container src/main/org/jboss/jms/server src/main/org/jboss/jms/server/connectionfactory src/main/org/jboss/jms/server/destination src/main/org/jboss/jms/server/endpoint src/main/org/jboss/messaging/core/plugin src/main/org/jboss/messaging/core/plugin/contract src/main/org/jboss/messaging/core/plugin/postoffice src/main/org/jboss/messaging/core/plugin/postoffice/cluster tests/src/org/jboss/test/messaging/core tests/src/org/jboss/test/messaging/core/plugin/base tests/src/org/jboss/test/messaging/core/plugin/postoffice tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster tests/src/org/jboss/test/messaging/jms tests/src/org/jboss/test/messaging/jms/clustering tests/src/org/jboss/test/messaging/tools/jmx/rmi
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Dec 11 04:32:26 EST 2006
Author: timfox
Date: 2006-12-11 04:31:53 -0500 (Mon, 11 Dec 2006)
New Revision: 1761
Added:
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/JMSCondition.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/JMSConditionFactory.java
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/SimpleCondition.java
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/SimpleConditionFactory.java
Modified:
branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/clustered-mysql-persistence-service.xml
branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/hsqldb-persistence-service.xml
branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/messaging-service.xml
branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/mysql-persistence-service.xml
branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/oracle-persistence-service.xml
branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/postgresql-persistence-service.xml
branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/sybase-persistence-service.xml
branches/Branch_Client_Failover_Experiment/src/etc/xmdesc/ServerPeer-xmbean.xml
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/client/container/HAAspect.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/ServerPeer.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryJNDIMapper.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/ManagedQueue.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/ManagedTopic.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/QueueService.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/TopicService.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/ClusteredPostOfficeService.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/DefaultPostOfficeService.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/ClusteredPostOffice.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/PostOffice.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/Binding.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/DefaultBinding.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/DefaultPostOffice.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/BindRequest.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/BindingInfo.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/CastMessagesCallback.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/MessageHolder.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/MessageRequest.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/PostOfficeInternal.java
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/base/PostOfficeTestBase.java
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/DefaultPostOfficeTest.java
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOfficeTest.java
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOfficeWithDefaultRouterTest.java
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultRouterTest.java
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RecoveryTest.java
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RedistributionWithDefaultMessagePullPolicyTest.java
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/jms/DurableSubscriberTest.java
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/jms/clustering/HATest.java
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/jms/clustering/SimpleClusteringTest.java
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/rmi/RMITestServer.java
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/rmi/Server.java
Log:
Merge postoffices into one
Modified: branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/clustered-mysql-persistence-service.xml
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/clustered-mysql-persistence-service.xml 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/clustered-mysql-persistence-service.xml 2006-12-11 09:31:53 UTC (rev 1761)
@@ -58,12 +58,12 @@
</mbean>
<mbean code="org.jboss.messaging.core.plugin.ClusteredPostOfficeService"
- name="jboss.messaging:service=QueuePostOffice"
+ name="jboss.messaging:service=PostOffice"
xmbean-dd="xmdesc/ClusteredPostOffice-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>
- <attribute name="PostOfficeName">Clustered Queue</attribute>
+ <attribute name="PostOfficeName">Clustered JMS</attribute>
<attribute name="DataSource">java:/DefaultDS</attribute>
<attribute name="CreateTablesOnStartup">true</attribute>
<attribute name="SqlProperties"><![CDATA[
@@ -121,70 +121,6 @@
</attribute>
</mbean>
- <mbean code="org.jboss.messaging.core.plugin.ClusteredPostOfficeService"
- name="jboss.messaging:service=TopicPostOffice"
- xmbean-dd="xmdesc/ClusteredPostOffice-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>
- <attribute name="PostOfficeName">Clustered Topic</attribute>
- <attribute name="DataSource">java:/DefaultDS</attribute>
- <attribute name="CreateTablesOnStartup">true</attribute>
- <attribute name="SqlProperties"><![CDATA[
-CREATE_POSTOFFICE_TABLE=CREATE TABLE JMS_POSTOFFICE (POSTOFFICE_NAME VARCHAR(255), NODE_ID INTEGER, QUEUE_NAME VARCHAR(1023), COND VARCHAR(1023), SELECTOR VARCHAR(1023), CHANNEL_ID BIGINT, IS_FAILED_OVER VARCHAR(1))
-INSERT_BINDING=INSERT INTO JMS_POSTOFFICE (POSTOFFICE_NAME, NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, IS_FAILED_OVER) VALUES (?, ?, ?, ?, ?, ?, ?)
-DELETE_BINDING=DELETE FROM JMS_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=? AND QUEUE_NAME=?
-LOAD_BINDINGS=SELECT NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, IS_FAILED_OVER FROM JMS_POSTOFFICE WHERE POSTOFFICE_NAME = ?
- ]]></attribute>
- <attribute name="GroupName">Topic</attribute>
- <attribute name="StateTimeout">5000</attribute>
- <attribute name="CastTimeout">5000</attribute>
- <attribute name="StatsSendPeriod">10000</attribute>
- <attribute name="MessagePullPolicy">org.jboss.messaging.core.plugin.postoffice.cluster.NullMessagePullPolicy</attribute>
- <attribute name="ClusterRouterFactory">org.jboss.messaging.core.plugin.postoffice.cluster.DefaultRouterFactory</attribute>
-
- <attribute name="AsyncChannelConfig">
- <config>
- <UDP mcast_recv_buf_size="500000" down_thread="false" ip_mcast="true" mcast_send_buf_size="32000"
- mcast_port="45569" ucast_recv_buf_size="500000" use_incoming_packet_handler="false"
- mcast_addr="228.8.8.8" use_outgoing_packet_handler="true" loopback="true" ucast_send_buf_size="32000" ip_ttl="32" bind_addr="127.0.0.1"/>
- <AUTOCONF down_thread="false" up_thread="false"/>
- <PING timeout="2000" down_thread="false" num_initial_members="3" up_thread="false"/>
- <MERGE2 max_interval="10000" down_thread="false" min_interval="5000" up_thread="false"/>
- <FD timeout="2000" max_tries="3" down_thread="false" up_thread="false" shun="true"/>
- <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
- <pbcast.NAKACK max_xmit_size="8192" down_thread="false" use_mcast_xmit="true" gc_lag="50" up_thread="false"
- retransmit_timeout="100,200,600,1200,2400,4800"/>
- <UNICAST timeout="1200,2400,3600" down_thread="false" up_thread="false"/>
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="20000" down_thread="false" max_bytes="0" up_thread="false"/>
- <FRAG frag_size="8192" down_thread="false" up_thread="false"/>
- <VIEW_SYNC avg_send_interval="60000" down_thread="false" up_thread="false" />
- <pbcast.GMS print_local_addr="true" join_timeout="3000" down_thread="false" join_retry_timeout="2000" up_thread="false" shun="true"/>
- </config>
- </attribute>
-
- <attribute name="SyncChannelConfig">
- <config>
- <UDP mcast_recv_buf_size="500000" down_thread="false" ip_mcast="true" mcast_send_buf_size="32000"
- mcast_port="45570" ucast_recv_buf_size="500000" use_incoming_packet_handler="false"
- mcast_addr="228.8.8.8" use_outgoing_packet_handler="true" loopback="true" ucast_send_buf_size="32000" ip_ttl="32" bind_addr="127.0.0.1"/>
- <AUTOCONF down_thread="false" up_thread="false"/>
- <PING timeout="2000" down_thread="false" num_initial_members="3" up_thread="false"/>
- <MERGE2 max_interval="10000" down_thread="false" min_interval="5000" up_thread="false"/>
- <FD timeout="2000" max_tries="3" down_thread="false" up_thread="false" shun="true"/>
- <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
- <pbcast.NAKACK max_xmit_size="8192" down_thread="false" use_mcast_xmit="true" gc_lag="50" up_thread="false"
- retransmit_timeout="100,200,600,1200,2400,4800"/>
- <UNICAST timeout="1200,2400,3600" down_thread="false" up_thread="false"/>
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="20000" down_thread="false" max_bytes="0" up_thread="false"/>
- <FRAG frag_size="8192" down_thread="false" up_thread="false"/>
- <VIEW_SYNC avg_send_interval="60000" down_thread="false" up_thread="false" />
- <pbcast.GMS print_local_addr="true" join_timeout="3000" down_thread="false" join_retry_timeout="2000" up_thread="false" shun="true"/>
- <pbcast.STATE_TRANSFER down_thread="false" up_thread="false"/>
- </config>
- </attribute>
- </mbean>
-
<mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
name="jboss.messaging:service=JMSUserManager"
xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
Modified: branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/hsqldb-persistence-service.xml
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/hsqldb-persistence-service.xml 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/hsqldb-persistence-service.xml 2006-12-11 09:31:53 UTC (rev 1761)
@@ -22,27 +22,16 @@
<!-- Note that Hypersonic CANNOT be used for clustered post offices -->
<mbean code="org.jboss.messaging.core.plugin.DefaultPostOfficeService"
- name="jboss.messaging:service=QueuePostOffice"
+ name="jboss.messaging:service=PostOffice"
xmbean-dd="xmdesc/DefaultPostOffice-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>
- <attribute name="PostOfficeName">Queue</attribute>
+ <attribute name="PostOfficeName">JMS</attribute>
<attribute name="DataSource">java:/DefaultDS</attribute>
<attribute name="CreateTablesOnStartup">true</attribute>
</mbean>
- <mbean code="org.jboss.messaging.core.plugin.DefaultPostOfficeService"
- name="jboss.messaging:service=TopicPostOffice"
- xmbean-dd="xmdesc/DefaultPostOffice-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>
- <attribute name="PostOfficeName">Topic</attribute>
- <attribute name="DataSource">java:/DefaultDS</attribute>
- <attribute name="CreateTablesOnStartup">true</attribute>
- </mbean>
-
<mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
name="jboss.messaging:service=JMSUserManager"
xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
Modified: branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/messaging-service.xml
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/messaging-service.xml 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/messaging-service.xml 2006-12-11 09:31:53 UTC (rev 1761)
@@ -25,8 +25,7 @@
<depends optional-attribute-name="JMSUserManager">jboss.messaging:service=JMSUserManager</depends>
<depends>jboss.messaging:service=Connector,transport=socket</depends>
- <attribute name="QueuePostOffice">jboss.messaging:service=QueuePostOffice</attribute>
- <attribute name="TopicPostOffice">jboss.messaging:service=TopicPostOffice</attribute>
+ <attribute name="PostOffice">jboss.messaging:service=PostOffice</attribute>
<attribute name="SecurityDomain">java:/jaas/messaging</attribute>
<attribute name="DefaultSecurityConfig">
Modified: branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/mysql-persistence-service.xml
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/mysql-persistence-service.xml 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/mysql-persistence-service.xml 2006-12-11 09:31:53 UTC (rev 1761)
@@ -58,12 +58,12 @@
</mbean>
<mbean code="org.jboss.messaging.core.plugin.DefaultPostOfficeService"
- name="jboss.messaging:service=QueuePostOffice"
+ name="jboss.messaging:service=PostOffice"
xmbean-dd="xmdesc/DefaultPostOffice-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>
- <attribute name="PostOfficeName">Queue</attribute>
+ <attribute name="PostOfficeName">JMS</attribute>
<attribute name="DataSource">java:/DefaultDS</attribute>
<attribute name="CreateTablesOnStartup">true</attribute>
<attribute name="SqlProperties"><![CDATA[
@@ -74,23 +74,6 @@
]]></attribute>
</mbean>
- <mbean code="org.jboss.messaging.core.plugin.DefaultPostOfficeService"
- name="jboss.messaging:service=TopicPostOffice"
- xmbean-dd="xmdesc/DefaultPostOffice-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>
- <attribute name="PostOfficeName">Topic</attribute>
- <attribute name="DataSource">java:/DefaultDS</attribute>
- <attribute name="CreateTablesOnStartup">true</attribute>
- <attribute name="SqlProperties"><![CDATA[
-CREATE_POSTOFFICE_TABLE=CREATE TABLE JMS_POSTOFFICE (POSTOFFICE_NAME VARCHAR(255), NODE_ID INTEGER, QUEUE_NAME VARCHAR(1023), COND VARCHAR(1023), SELECTOR VARCHAR(1023), CHANNEL_ID BIGINT, IS_FAILED_OVER CHAR(1))
-INSERT_BINDING=INSERT INTO JMS_POSTOFFICE (POSTOFFICE_NAME, NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, IS_FAILED_OVER) VALUES (?, ?, ?, ?, ?, ?, ?)
-DELETE_BINDING=DELETE FROM JMS_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=? AND QUEUE_NAME=?
-LOAD_BINDINGS=SELECT NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID FROM JMS_POSTOFFICE WHERE POSTOFFICE_NAME = ?
- ]]></attribute>
- </mbean>
-
<mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
name="jboss.messaging:service=JMSUserManager"
xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
Modified: branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/oracle-persistence-service.xml
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/oracle-persistence-service.xml 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/oracle-persistence-service.xml 2006-12-11 09:31:53 UTC (rev 1761)
@@ -61,46 +61,7 @@
<attribute name="MaxParams">500</attribute>
</mbean>
- <mbean code="org.jboss.messaging.core.plugin.DirectExchange"
- name="jboss.messaging:service=DirectExchange"
- xmbean-dd="xmdesc/Exchange-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 JMS_USER (USERID VARCHAR2(32) NOT NULL, PASSWD VARCHAR2(32) NOT NULL, CLIENTID VARCHAR2(128), PRIMARY KEY(USERID))
-CREATE_ROLE_TABLE=CREATE TABLE JMS_ROLE (ROLEID VARCHAR2(32) NOT NULL, USERID VARCHAR2(32) NOT NULL, PRIMARY KEY(USERID, ROLEID))
-SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JMS_USER WHERE USERID=?
-CREATE_MAPPING_TABLE=CREATE TABLE JMS_CHANNEL_MAPPING (ID INTEGER, TYPE CHAR(1), JMS_DEST_NAME VARCHAR2(1024), JMS_SUB_NAME VARCHAR2(1024), CLIENT_ID VARCHAR2(128), SELECTOR VARCHAR2(1024), NO_LOCAL CHAR(1), PRIMARY KEY(ID))
-INSERT_MAPPING=INSERT INTO JMS_CHANNEL_MAPPING (ID, TYPE, JMS_DEST_NAME, JMS_SUB_NAME, CLIENT_ID, SELECTOR, NO_LOCAL) VALUES (?, ?, ?, ?, ?, ?, ?)
-DELETE_MAPPING=DELETE FROM JMS_CHANNEL_MAPPING WHERE ID = ?
-SELECT_ID_FOR_DESTINATION=SELECT ID FROM JMS_CHANNEL_MAPPING WHERE TYPE=? AND JMS_DEST_NAME=?
-SELECT_DURABLE_SUB=SELECT JMS_DEST_NAME, ID, SELECTOR, NO_LOCAL FROM JMS_CHANNEL_MAPPING WHERE CLIENT_ID=? AND JMS_SUB_NAME=?
-SELECT_SUBSCRIPTIONS_FOR_TOPIC=SELECT ID, CLIENT_ID, JMS_SUB_NAME, SELECTOR, NO_LOCAL FROM JMS_CHANNEL_MAPPING WHERE TYPE='D' AND JMS_DEST_NAME=?
- ]]></attribute>
- </mbean>
- <mbean code="org.jboss.messaging.core.plugin.TopicExchange"
- name="jboss.messaging:service=TopicExchange"
- xmbean-dd="xmdesc/Exchange-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 JMS_USER (USERID VARCHAR2(32) NOT NULL, PASSWD VARCHAR2(32) NOT NULL, CLIENTID VARCHAR2(128), PRIMARY KEY(USERID))
-CREATE_ROLE_TABLE=CREATE TABLE JMS_ROLE (ROLEID VARCHAR2(32) NOT NULL, USERID VARCHAR2(32) NOT NULL, PRIMARY KEY(USERID, ROLEID))
-SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JMS_USER WHERE USERID=?
-CREATE_MAPPING_TABLE=CREATE TABLE JMS_CHANNEL_MAPPING (ID INTEGER, TYPE CHAR(1), JMS_DEST_NAME VARCHAR2(1024), JMS_SUB_NAME VARCHAR2(1024), CLIENT_ID VARCHAR2(128), SELECTOR VARCHAR2(1024), NO_LOCAL CHAR(1), PRIMARY KEY(ID))
-INSERT_MAPPING=INSERT INTO JMS_CHANNEL_MAPPING (ID, TYPE, JMS_DEST_NAME, JMS_SUB_NAME, CLIENT_ID, SELECTOR, NO_LOCAL) VALUES (?, ?, ?, ?, ?, ?, ?)
-DELETE_MAPPING=DELETE FROM JMS_CHANNEL_MAPPING WHERE ID = ?
-SELECT_ID_FOR_DESTINATION=SELECT ID FROM JMS_CHANNEL_MAPPING WHERE TYPE=? AND JMS_DEST_NAME=?
-SELECT_DURABLE_SUB=SELECT JMS_DEST_NAME, ID, SELECTOR, NO_LOCAL FROM JMS_CHANNEL_MAPPING WHERE CLIENT_ID=? AND JMS_SUB_NAME=?
-SELECT_SUBSCRIPTIONS_FOR_TOPIC=SELECT ID, CLIENT_ID, JMS_SUB_NAME, SELECTOR, NO_LOCAL FROM JMS_CHANNEL_MAPPING WHERE TYPE='D' AND JMS_DEST_NAME=?
- ]]></attribute>
- </mbean>
-
<mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManager"
name="jboss.messaging:service=JMSUserManager"
xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
Modified: branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/postgresql-persistence-service.xml
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/postgresql-persistence-service.xml 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/postgresql-persistence-service.xml 2006-12-11 09:31:53 UTC (rev 1761)
@@ -61,46 +61,6 @@
<attribute name="MaxParams">500</attribute>
</mbean>
- <mbean code="org.jboss.messaging.core.plugin.DirectExchange"
- name="jboss.messaging:service=DirectExchange"
- xmbean-dd="xmdesc/Exchange-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 JMS_USER (USERID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, CLIENTID VARCHAR(128), PRIMARY KEY(USERID))
-CREATE_ROLE_TABLE=CREATE TABLE JMS_ROLE (ROLEID VARCHAR(32) NOT NULL, USERID VARCHAR(32) NOT NULL, PRIMARY KEY(USERID, ROLEID))
-SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JMS_USER WHERE USERID=?
-CREATE_MAPPING_TABLE=CREATE TABLE JMS_CHANNEL_MAPPING (ID BIGINT, TYPE CHAR(1), JMS_DEST_NAME VARCHAR(1024), JMS_SUB_NAME VARCHAR(1024), CLIENT_ID VARCHAR(128), SELECTOR VARCHAR(1024), NO_LOCAL CHAR(1), PRIMARY KEY(ID))
-INSERT_MAPPING=INSERT INTO JMS_CHANNEL_MAPPING (ID, TYPE, JMS_DEST_NAME, JMS_SUB_NAME, CLIENT_ID, SELECTOR, NO_LOCAL) VALUES (?, ?, ?, ?, ?, ?, ?)
-DELETE_MAPPING=DELETE FROM JMS_CHANNEL_MAPPING WHERE ID = ?
-SELECT_ID_FOR_DESTINATION=SELECT ID FROM JMS_CHANNEL_MAPPING WHERE TYPE=? AND JMS_DEST_NAME=?
-SELECT_DURABLE_SUB=SELECT JMS_DEST_NAME, ID, SELECTOR, NO_LOCAL FROM JMS_CHANNEL_MAPPING WHERE CLIENT_ID=? AND JMS_SUB_NAME=?
-SELECT_SUBSCRIPTIONS_FOR_TOPIC=SELECT ID, CLIENT_ID, JMS_SUB_NAME, SELECTOR, NO_LOCAL FROM JMS_CHANNEL_MAPPING WHERE TYPE='D' AND JMS_DEST_NAME=?
- ]]></attribute>
- </mbean>
-
- <mbean code="org.jboss.messaging.core.plugin.TopicExchange"
- name="jboss.messaging:service=TopicExchange"
- xmbean-dd="xmdesc/Exchange-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 JMS_USER (USERID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, CLIENTID VARCHAR(128), PRIMARY KEY(USERID))
-CREATE_ROLE_TABLE=CREATE TABLE JMS_ROLE (ROLEID VARCHAR(32) NOT NULL, USERID VARCHAR(32) NOT NULL, PRIMARY KEY(USERID, ROLEID))
-SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JMS_USER WHERE USERID=?
-CREATE_MAPPING_TABLE=CREATE TABLE JMS_CHANNEL_MAPPING (ID BIGINT, TYPE CHAR(1), JMS_DEST_NAME VARCHAR(1024), JMS_SUB_NAME VARCHAR(1024), CLIENT_ID VARCHAR(128), SELECTOR VARCHAR(1024), NO_LOCAL CHAR(1), PRIMARY KEY(ID))
-INSERT_MAPPING=INSERT INTO JMS_CHANNEL_MAPPING (ID, TYPE, JMS_DEST_NAME, JMS_SUB_NAME, CLIENT_ID, SELECTOR, NO_LOCAL) VALUES (?, ?, ?, ?, ?, ?, ?)
-DELETE_MAPPING=DELETE FROM JMS_CHANNEL_MAPPING WHERE ID = ?
-SELECT_ID_FOR_DESTINATION=SELECT ID FROM JMS_CHANNEL_MAPPING WHERE TYPE=? AND JMS_DEST_NAME=?
-SELECT_DURABLE_SUB=SELECT JMS_DEST_NAME, ID, SELECTOR, NO_LOCAL FROM JMS_CHANNEL_MAPPING WHERE CLIENT_ID=? AND JMS_SUB_NAME=?
-SELECT_SUBSCRIPTIONS_FOR_TOPIC=SELECT ID, CLIENT_ID, JMS_SUB_NAME, SELECTOR, NO_LOCAL FROM JMS_CHANNEL_MAPPING WHERE TYPE='D' AND JMS_DEST_NAME=?
- ]]></attribute>
- </mbean>
-
<mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManager"
name="jboss.messaging:service=JMSUserManager"
xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
Modified: branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/sybase-persistence-service.xml
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/sybase-persistence-service.xml 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/etc/server/default/deploy/sybase-persistence-service.xml 2006-12-11 09:31:53 UTC (rev 1761)
@@ -69,56 +69,7 @@
</attribute>
</mbean>
- <mbean code="org.jboss.messaging.core.plugin.DirectExchange"
- name="jboss.messaging:service=DirectExchange"
- xmbean-dd="xmdesc/Exchange-xmbean.xml">
- <!-- TODO this insures the fact that dependency exists. However I need to redundantly specifiy
- the DataSource JNDI name in order to actually get a reference to it. Fix this.
- -->
- <depends>jboss.jca:service=DataSourceBinding,name=SybaseDS</depends>
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
- <attribute name="DataSource">SybaseDS</attribute>
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
-CREATE_USER_TABLE=CREATE TABLE JMS_USER (USERID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, CLIENTID VARCHAR(128) NULL, PRIMARY KEY(USERID))
-CREATE_ROLE_TABLE=CREATE TABLE JMS_ROLE (ROLEID VARCHAR(32) NOT NULL, USERID VARCHAR(32) NOT NULL, PRIMARY KEY(USERID, ROLEID))
-SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JMS_USER WHERE USERID=?
-CREATE_MAPPING_TABLE=CREATE TABLE JMS_CHANNEL_MAPPING (ID INTEGER, TYPE CHAR(1) NULL, JMS_DEST_NAME VARCHAR(1024) NULL, JMS_SUB_NAME VARCHAR(1024) NULL, CLIENT_ID VARCHAR(128) NULL, SELECTOR VARCHAR(1024) NULL, NO_LOCAL CHAR(1) NULL, PRIMARY KEY(ID))
-INSERT_MAPPING=INSERT INTO JMS_CHANNEL_MAPPING (ID, TYPE, JMS_DEST_NAME, JMS_SUB_NAME, CLIENT_ID, SELECTOR, NO_LOCAL) VALUES (?, ?, ?, ?, ?, ?, ?)
-DELETE_MAPPING=DELETE FROM JMS_CHANNEL_MAPPING WHERE ID = ?
-SELECT_ID_FOR_DESTINATION=SELECT ID FROM JMS_CHANNEL_MAPPING WHERE TYPE=? AND JMS_DEST_NAME=?
-SELECT_DURABLE_SUB=SELECT JMS_DEST_NAME, ID, SELECTOR, NO_LOCAL FROM JMS_CHANNEL_MAPPING WHERE CLIENT_ID=? AND JMS_SUB_NAME=?
-SELECT_SUBSCRIPTIONS_FOR_TOPIC=SELECT ID, CLIENT_ID, JMS_SUB_NAME, SELECTOR, NO_LOCAL FROM JMS_CHANNEL_MAPPING WHERE TYPE='D' AND JMS_DEST_NAME=?
- ]]>
- </attribute>
- </mbean>
- <mbean code="org.jboss.messaging.core.plugin.TopicExchange"
- name="jboss.messaging:service=TopicExchange"
- xmbean-dd="xmdesc/Exchange-xmbean.xml">
- <!-- TODO this insures the fact that dependency exists. However I need to redundantly specifiy
- the DataSource JNDI name in order to actually get a reference to it. Fix this.
- -->
- <depends>jboss.jca:service=DataSourceBinding,name=SybaseDS</depends>
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
- <attribute name="DataSource">SybaseDS</attribute>
- <attribute name="CreateTablesOnStartup">true</attribute>
-
- <attribute name="SqlProperties"><![CDATA[
-CREATE_USER_TABLE=CREATE TABLE JMS_USER (USERID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, CLIENTID VARCHAR(128) NULL, PRIMARY KEY(USERID))
-CREATE_ROLE_TABLE=CREATE TABLE JMS_ROLE (ROLEID VARCHAR(32) NOT NULL, USERID VARCHAR(32) NOT NULL, PRIMARY KEY(USERID, ROLEID))
-SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JMS_USER WHERE USERID=?
-CREATE_MAPPING_TABLE=CREATE TABLE JMS_CHANNEL_MAPPING (ID INTEGER, TYPE CHAR(1) NULL, JMS_DEST_NAME VARCHAR(1024) NULL, JMS_SUB_NAME VARCHAR(1024) NULL, CLIENT_ID VARCHAR(128) NULL, SELECTOR VARCHAR(1024) NULL, NO_LOCAL CHAR(1) NULL, PRIMARY KEY(ID))
-INSERT_MAPPING=INSERT INTO JMS_CHANNEL_MAPPING (ID, TYPE, JMS_DEST_NAME, JMS_SUB_NAME, CLIENT_ID, SELECTOR, NO_LOCAL) VALUES (?, ?, ?, ?, ?, ?, ?)
-DELETE_MAPPING=DELETE FROM JMS_CHANNEL_MAPPING WHERE ID = ?
-SELECT_ID_FOR_DESTINATION=SELECT ID FROM JMS_CHANNEL_MAPPING WHERE TYPE=? AND JMS_DEST_NAME=?
-SELECT_DURABLE_SUB=SELECT JMS_DEST_NAME, ID, SELECTOR, NO_LOCAL FROM JMS_CHANNEL_MAPPING WHERE CLIENT_ID=? AND JMS_SUB_NAME=?
-SELECT_SUBSCRIPTIONS_FOR_TOPIC=SELECT ID, CLIENT_ID, JMS_SUB_NAME, SELECTOR, NO_LOCAL FROM JMS_CHANNEL_MAPPING WHERE TYPE='D' AND JMS_DEST_NAME=?
- ]]>
- </attribute>
- </mbean>
-
<mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManager"
name="jboss.messaging:service=JMSUserManager"
xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
Modified: branches/Branch_Client_Failover_Experiment/src/etc/xmdesc/ServerPeer-xmbean.xml
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/etc/xmdesc/ServerPeer-xmbean.xml 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/etc/xmdesc/ServerPeer-xmbean.xml 2006-12-11 09:31:53 UTC (rev 1761)
@@ -34,24 +34,12 @@
<type>javax.management.ObjectName</type>
</attribute>
- <attribute access="read-write" getMethod="getQueuePostOffice" setMethod="setQueuePostOffice">
- <description>The ObjectName of the queue post office</description>
- <name>QueuePostOffice</name>
+ <attribute access="read-write" getMethod="getPostOffice" setMethod="setPostOffice">
+ <description>The ObjectName of the post office</description>
+ <name>PostOffice</name>
<type>javax.management.ObjectName</type>
- </attribute>
+ </attribute>
- <attribute access="read-write" getMethod="getTopicPostOffice" setMethod="setTopicPostOffice">
- <description>The ObjectName of the topic post office</description>
- <name>TopicPostOffice</name>
- <type>javax.management.ObjectName</type>
- </attribute>
-
- <attribute access="read-write" getMethod="getClusteredTopicPostOffice" setMethod="setClusteredTopicPostOffice">
- <description>The ObjectName of the clustered topic post office</description>
- <name>ClusteredTopicPostOffice</name>
- <type>javax.management.ObjectName</type>
- </attribute>
-
<attribute access="read-write" getMethod="getJMSUserManager" setMethod="setJMSUserManager">
<description>The ObjectName of the jms user manager</description>
<name>JMSUserManager</name>
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/client/container/HAAspect.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/client/container/HAAspect.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/client/container/HAAspect.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -483,7 +483,7 @@
{
try
{
- log.info("********* EXCEPTION DETECTED");
+ log.info("********* EXCEPTION DETECTED", throwable);
handleFailure(connection);
}
Added: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/JMSCondition.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/JMSCondition.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/JMSCondition.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -0,0 +1,128 @@
+/*
+ * 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.messaging.core.MessageReference;
+import org.jboss.messaging.core.plugin.contract.Condition;
+
+/**
+ * A JMSCondition
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * @version <tt>$Revision: 1.1 $</tt>
+ *
+ * $Id$
+ *
+ */
+public class JMSCondition implements Condition
+{
+ private boolean queue;
+
+ private String name;
+
+ private static final String QUEUE_PREFIX = "queue.";
+
+ private static final String TOPIC_PREFIX = "topic.";
+
+ //Cache the hash code
+ private int hash = -1;
+
+ public JMSCondition(boolean queue, String name)
+ {
+ this.queue = queue;
+
+ this.name = name;
+ }
+
+ public JMSCondition(String text)
+ {
+ if (text.startsWith(QUEUE_PREFIX))
+ {
+ queue = true;
+
+ name = text.substring(QUEUE_PREFIX.length());
+ }
+ else if (text.startsWith(TOPIC_PREFIX))
+ {
+ queue = false;
+
+ name = text.substring(TOPIC_PREFIX.length());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Illegal text: " + text);
+ }
+
+ }
+
+ public boolean isQueue()
+ {
+ return queue;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public boolean matches(Condition routingCondition, MessageReference ref)
+ {
+ return equals(routingCondition);
+ }
+
+ public boolean equals(Object other)
+ {
+ if (!(other instanceof JMSCondition))
+ {
+ return false;
+ }
+
+ JMSCondition jmsCond = (JMSCondition)other;
+
+ return ((jmsCond.queue == this.queue) && (jmsCond.name.equals(this.name)));
+ }
+
+ public int hashCode()
+ {
+ if (hash == -1)
+ {
+ hash = 17;
+
+ hash = 37 * hash + (queue ? 0 : 1);
+
+ hash = 37 * hash + name.hashCode();
+ }
+
+ return hash;
+ }
+
+ public String toText()
+ {
+ return (queue ? QUEUE_PREFIX : TOPIC_PREFIX) + name;
+ }
+
+ public String toString()
+ {
+ return toText();
+ }
+
+}
Added: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/JMSConditionFactory.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/JMSConditionFactory.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/JMSConditionFactory.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -0,0 +1,45 @@
+/*
+ * 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.messaging.core.plugin.contract.Condition;
+import org.jboss.messaging.core.plugin.contract.ConditionFactory;
+
+/**
+ *
+ * A JMSConditionFactory
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * @version <tt>$Revision: 1.1 $</tt>
+ *
+ * $Id$
+ *
+ */
+public class JMSConditionFactory implements ConditionFactory
+{
+
+ public Condition createCondition(String text) throws Exception
+ {
+ return new JMSCondition(text);
+ }
+
+}
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/ServerPeer.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/ServerPeer.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/ServerPeer.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -125,11 +125,11 @@
protected ObjectName persistenceManagerObjectName;
protected PersistenceManager persistenceManager;
- protected ObjectName queuePostOfficeObjectName;
- protected PostOffice queuePostOffice;
+ protected ObjectName postOfficeObjectName;
+ protected PostOffice postOffice;
- protected ObjectName topicPostOfficeObjectName;
- protected PostOffice topicPostOffice;
+// protected ObjectName topicPostOfficeObjectName;
+// protected PostOffice topicPostOffice;
protected ObjectName jmsUserManagerObjectName;
protected JMSUserManager jmsUserManager;
@@ -312,25 +312,25 @@
persistenceManagerObjectName = on;
}
- public ObjectName getQueuePostOffice()
+ public ObjectName getPostOffice()
{
- return queuePostOfficeObjectName;
+ return postOfficeObjectName;
}
- public void setQueuePostOffice(ObjectName on)
+ public void setPostOffice(ObjectName on)
{
- queuePostOfficeObjectName = on;
+ postOfficeObjectName = on;
}
- public ObjectName getTopicPostOffice()
- {
- return topicPostOfficeObjectName;
- }
-
- public void setTopicPostOffice(ObjectName on)
- {
- topicPostOfficeObjectName = on;
- }
+// public ObjectName getTopicPostOffice()
+// {
+// return topicPostOfficeObjectName;
+// }
+//
+// public void setTopicPostOffice(ObjectName on)
+// {
+// topicPostOfficeObjectName = on;
+// }
public ObjectName getJmsUserManager()
{
@@ -603,7 +603,7 @@
public Replicator getReplicator() throws Exception
{
- PostOffice postOffice = getQueuePostOfficeInstance();
+ PostOffice postOffice = getPostOfficeInstance();
if (!(postOffice instanceof Replicator))
{
throw new IllegalAccessException("This operations is only legal on clustering configurations");
@@ -611,40 +611,40 @@
return (Replicator)postOffice;
}
- public PostOffice getQueuePostOfficeInstance() throws Exception
+ public PostOffice getPostOfficeInstance() throws Exception
{
// We get the reference lazily to avoid problems with MBean circular dependencies
- if (queuePostOffice == null)
+ if (postOffice == null)
{
- queuePostOffice = (PostOffice)getServer().
- getAttribute(queuePostOfficeObjectName, "Instance");
+ postOffice = (PostOffice)getServer().
+ getAttribute(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
- if (!queuePostOffice.isLocal())
+ if (!postOffice.isLocal())
{
- Replicator rep = (Replicator)queuePostOffice;
+ Replicator rep = (Replicator)postOffice;
connFactoryJNDIMapper.injectReplicator(rep);
rep.registerListener(new FailoverListener());
}
}
- return queuePostOffice;
+ return postOffice;
}
- public PostOffice getTopicPostOfficeInstance() throws Exception
- {
- // We get the reference lazily to avoid problems with MBean circular dependencies
- if (topicPostOffice == null)
- {
- topicPostOffice = (PostOffice)getServer().
- getAttribute(topicPostOfficeObjectName, "Instance");
- }
- return topicPostOffice;
- }
+// public PostOffice getTopicPostOfficeInstance() throws Exception
+// {
+// // We get the reference lazily to avoid problems with MBean circular dependencies
+// if (topicPostOffice == null)
+// {
+// topicPostOffice = (PostOffice)getServer().
+// getAttribute(topicPostOfficeObjectName, "Instance");
+// }
+// return topicPostOffice;
+// }
public synchronized int getNextObjectID()
{
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryJNDIMapper.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryJNDIMapper.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryJNDIMapper.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -377,7 +377,7 @@
private void setupReplicator() throws Exception
{
- this.serverPeer.getQueuePostOfficeInstance();
+ this.serverPeer.getPostOfficeInstance();
}
private void recalculateFailoverMap(Map nodeAddressMap) throws Exception
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/ManagedQueue.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/ManagedQueue.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/ManagedQueue.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -27,6 +27,7 @@
import javax.jms.JMSException;
import org.jboss.jms.selector.Selector;
+import org.jboss.jms.server.JMSCondition;
import org.jboss.messaging.core.Queue;
import org.jboss.messaging.core.plugin.postoffice.Binding;
@@ -54,8 +55,10 @@
public int getMessageCount() throws Exception
{
- Binding binding = (Binding)postOffice.listBindingsForCondition(name).iterator().next();
+ JMSCondition queueCond = new JMSCondition(true, name);
+ Binding binding = (Binding)postOffice.listBindingsForCondition(queueCond).iterator().next();
+
if (binding == null)
{
throw new IllegalStateException("Cannot find binding for queue:" + name);
@@ -68,8 +71,10 @@
public void removeAllMessages() throws Throwable
{
- Binding binding = (Binding)postOffice.listBindingsForCondition(name).iterator().next();
+ JMSCondition queueCond = new JMSCondition(true, name);
+ Binding binding = (Binding)postOffice.listBindingsForCondition(queueCond).iterator().next();
+
if (binding == null)
{
throw new IllegalStateException("Cannot find binding for queue:" + name);
@@ -91,8 +96,10 @@
}
}
- Binding binding = (Binding)postOffice.listBindingsForCondition(name).iterator().next();
+ JMSCondition queueCond = new JMSCondition(true, name);
+ Binding binding = (Binding)postOffice.listBindingsForCondition(queueCond).iterator().next();
+
if (binding == null)
{
throw new IllegalStateException("Cannot find binding for queue:" + name);
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/ManagedTopic.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/ManagedTopic.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/ManagedTopic.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -29,6 +29,7 @@
import javax.jms.InvalidSelectorException;
import org.jboss.jms.selector.Selector;
+import org.jboss.jms.server.JMSCondition;
import org.jboss.jms.util.MessageQueueNameHelper;
import org.jboss.messaging.core.Queue;
import org.jboss.messaging.core.plugin.postoffice.Binding;
@@ -52,13 +53,15 @@
public ManagedTopic(String name, int fullSize, int pageSize, int downCacheSize)
{
- super(name, fullSize, pageSize, downCacheSize);
+ super(name, fullSize, pageSize, downCacheSize);
}
public void removeAllMessages() throws Throwable
{
- Collection subs = postOffice.listBindingsForCondition(name);
+ JMSCondition topicCond = new JMSCondition(false, name);
+ Collection subs = postOffice.listBindingsForCondition(topicCond);
+
//XXX How to lock down all subscriptions?
Iterator iter = subs.iterator();
while (iter.hasNext())
@@ -71,15 +74,19 @@
public int subscriptionCount() throws Exception
{
- Collection subs = postOffice.listBindingsForCondition(name);
+ JMSCondition topicCond = new JMSCondition(false, name);
+ Collection subs = postOffice.listBindingsForCondition(topicCond);
+
return subs.size();
}
public int subscriptionCount(boolean durable) throws Exception
{
- Collection subs = postOffice.listBindingsForCondition(name);
+ JMSCondition topicCond = new JMSCondition(false, name);
+ Collection subs = postOffice.listBindingsForCondition(topicCond);
+
Iterator iter = subs.iterator();
int count = 0;
@@ -99,31 +106,39 @@
public String listSubscriptionsAsText() throws Exception
{
- Collection subs = postOffice.listBindingsForCondition(name);
+ JMSCondition topicCond = new JMSCondition(false, name);
+ Collection subs = postOffice.listBindingsForCondition(topicCond);
+
return getSubscriptionsAsText(subs, true) + getSubscriptionsAsText(subs, false);
}
public String listSubscriptionsAsText(boolean durable) throws Exception
{
- Collection subs = postOffice.listBindingsForCondition(name);
+ JMSCondition topicCond = new JMSCondition(false, name);
+ Collection subs = postOffice.listBindingsForCondition(topicCond);
+
return getSubscriptionsAsText(subs, durable);
}
public List listMessagesDurableSub(String subName, String clientID, String selector)
throws Exception
{
- Collection subs = postOffice.listBindingsForCondition(name);
+ JMSCondition topicCond = new JMSCondition(false, name);
+ Collection subs = postOffice.listBindingsForCondition(topicCond);
+
return getMessagesFromDurableSub(subs, subName, clientID, trimSelector(selector));
}
public List listMessagesNonDurableSub(long channelID, String selector)
throws Exception
{
- Collection subs = postOffice.listBindingsForCondition(name);
+ JMSCondition topicCond = new JMSCondition(false, name);
+ Collection subs = postOffice.listBindingsForCondition(topicCond);
+
return getMessagesFromNonDurableSub(subs, channelID, trimSelector(selector));
}
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/QueueService.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/QueueService.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/QueueService.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -9,6 +9,7 @@
import java.util.ArrayList;
import java.util.List;
+import org.jboss.jms.server.JMSCondition;
import org.jboss.jms.util.ExceptionUtil;
import org.jboss.jms.util.XMLUtil;
import org.jboss.messaging.core.local.PagingFilteredQueue;
@@ -78,7 +79,7 @@
try
{
- postOffice = serverPeer.getQueuePostOfficeInstance();
+ postOffice = serverPeer.getPostOfficeInstance();
destination.setPostOffice(postOffice);
@@ -106,13 +107,17 @@
PagingFilteredQueue queue;
+ JMSCondition queueCond = new JMSCondition(true, destination.getName());
+
if (postOffice.isLocal())
{
queue = new PagingFilteredQueue(destination.getName(), idm.getId(), ms, pm, true, true,
executor, null,
destination.getFullSize(), destination.getPageSize(), destination.getDownCacheSize());
- postOffice.bindQueue(destination.getName(), queue);
+
+
+ postOffice.bindQueue(queueCond, queue);
}
else
{
@@ -124,11 +129,11 @@
if (destination.isClustered())
{
- cpo.bindClusteredQueue(destination.getName(), (LocalClusteredQueue)queue);
+ cpo.bindClusteredQueue(queueCond, (LocalClusteredQueue)queue);
}
else
{
- cpo.bindQueue(destination.getName(), (LocalClusteredQueue)queue);
+ cpo.bindQueue(queueCond, (LocalClusteredQueue)queue);
}
}
}
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/TopicService.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/TopicService.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/TopicService.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -13,12 +13,11 @@
import javax.jms.JMSException;
+import org.jboss.jms.server.JMSCondition;
import org.jboss.jms.util.ExceptionUtil;
import org.jboss.jms.util.XMLUtil;
-import org.jboss.messaging.core.Queue;
import org.jboss.messaging.core.local.PagingFilteredQueue;
import org.jboss.messaging.core.plugin.postoffice.Binding;
-import org.jboss.messaging.core.plugin.postoffice.cluster.ClusteredQueue;
/**
* A deployable JBoss Messaging topic.
@@ -64,15 +63,17 @@
try
{
- postOffice = serverPeer.getTopicPostOfficeInstance();
+ postOffice = serverPeer.getPostOfficeInstance();
if (postOffice == null)
throw new IllegalArgumentException("Post Office instance not found. Check your destination configuration.");
destination.setPostOffice(postOffice);
-
+
+ JMSCondition topicCond = new JMSCondition(false, destination.getName());
+
// We deploy any queues corresponding to pre-existing durable subscriptions
- Collection bindings = postOffice.listBindingsForCondition(destination.getName());
+ Collection bindings = postOffice.listBindingsForCondition(topicCond);
Iterator iter = bindings.iterator();
while (iter.hasNext())
{
@@ -113,8 +114,10 @@
//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
- Collection bindings = postOffice.listBindingsForCondition(destination.getName());
+ JMSCondition topicCond = new JMSCondition(false, destination.getName());
+ Collection bindings = postOffice.listBindingsForCondition(topicCond);
+
Iterator iter = bindings.iterator();
while (iter.hasNext())
{
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -38,6 +38,7 @@
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.SecurityManager;
import org.jboss.jms.server.ServerPeer;
import org.jboss.jms.server.endpoint.advised.SessionAdvised;
@@ -106,10 +107,8 @@
private ServerPeer serverPeer;
// access to server's extensions
- private PostOffice queuePostOffice;
+ private PostOffice postOffice;
- private PostOffice topicPostOffice;
-
private SecurityManager sm;
private ConnectionManager cm;
@@ -144,9 +143,8 @@
tr = serverPeer.getTxRepository();
cm = serverPeer.getConnectionManager();
ms = serverPeer.getMessageStore();
- queuePostOffice = serverPeer.getQueuePostOfficeInstance();
- topicPostOffice = serverPeer.getTopicPostOfficeInstance();
-
+ postOffice = serverPeer.getPostOfficeInstance();
+
started = false;
this.connectionID = serverPeer.getNextObjectID();
@@ -307,7 +305,7 @@
if (dest.isQueue())
{
- queuePostOffice.unbindQueue(dest.getName());
+ postOffice.unbindQueue(dest.getName());
}
else
{
@@ -599,14 +597,14 @@
if (dest.isQueue())
{
- if (!queuePostOffice.route(ref, dest.getName(), tx))
+ if (!postOffice.route(ref, new JMSCondition(true, dest.getName()), tx))
{
throw new JMSException("Failed to route message");
}
}
else
{
- topicPostOffice.route(ref, dest.getName(), tx);
+ postOffice.route(ref, new JMSCondition(false, dest.getName()), tx);
}
}
finally
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -365,10 +365,10 @@
if (destination.isTopic())
{
- PostOffice topicPostOffice =
- sessionEndpoint.getConnectionEndpoint().getServerPeer().getTopicPostOfficeInstance();
+ PostOffice postOffice =
+ sessionEndpoint.getConnectionEndpoint().getServerPeer().getPostOfficeInstance();
- Binding binding = topicPostOffice.getBindingForQueueName(queueName);
+ Binding binding = postOffice.getBindingForQueueName(queueName);
//Note binding can be null since there can many competing subscribers for the subscription -
//in which case the first will have removed the subscription and subsequently
@@ -376,7 +376,7 @@
if (binding != null && !binding.getQueue().isRecoverable())
{
- topicPostOffice.unbindQueue(queueName);
+ postOffice.unbindQueue(queueName);
}
}
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -21,7 +21,18 @@
*/
package org.jboss.jms.server.endpoint;
-import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
+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.IllegalStateException;
+import javax.jms.InvalidDestinationException;
+import javax.jms.JMSException;
+
import org.jboss.jms.client.delegate.ClientBrowserDelegate;
import org.jboss.jms.client.delegate.ClientConsumerDelegate;
import org.jboss.jms.delegate.BrowserDelegate;
@@ -32,6 +43,7 @@
import org.jboss.jms.message.JBossMessage;
import org.jboss.jms.selector.Selector;
import org.jboss.jms.server.DestinationManager;
+import org.jboss.jms.server.JMSCondition;
import org.jboss.jms.server.QueuedExecutorPool;
import org.jboss.jms.server.ServerPeer;
import org.jboss.jms.server.destination.ManagedDestination;
@@ -57,10 +69,7 @@
import org.jboss.messaging.core.tx.TransactionRepository;
import org.jboss.util.id.GUID;
-import javax.jms.IllegalStateException;
-import javax.jms.InvalidDestinationException;
-import javax.jms.JMSException;
-import java.util.*;
+import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
/**
* Concrete implementation of SessionEndpoint.
@@ -99,8 +108,7 @@
private IdManager idm;
private QueuedExecutorPool pool;
private TransactionRepository tr;
- private PostOffice topicPostOffice;
- private PostOffice queuePostOffice;
+ private PostOffice postOffice;
private int nodeId;
@@ -118,8 +126,7 @@
pm = sp.getPersistenceManagerInstance();
ms = sp.getMessageStore();
dm = sp.getDestinationManager();
- topicPostOffice = sp.getTopicPostOfficeInstance();
- queuePostOffice = sp.getQueuePostOfficeInstance();
+ postOffice = sp.getPostOfficeInstance();
idm = sp.getChannelIdManager();
pool = sp.getQueuedExecutorPool();
nodeId = sp.getServerPeerID();
@@ -143,23 +150,13 @@
try
{
// fail over channel
- PostOffice postOfficeToUse = null;
- if (jmsDestination.isTopic())
+ if (postOffice.isLocal())
{
- postOfficeToUse = topicPostOffice;
- }
- else
- {
- postOfficeToUse = queuePostOffice;
- }
-
- if (postOfficeToUse.isLocal())
- {
throw new IllegalStateException("Cannot failover on a non clustered post office!");
}
// this is a Clustered operation... so postOffice here must be Clustered
- Binding binding = ((ClusteredPostOffice)postOfficeToUse).getBindingforChannelId(oldChannelID);
+ Binding binding = ((ClusteredPostOffice)postOffice).getBindingforChannelId(oldChannelID);
if (binding == null)
{
throw new IllegalStateException("Can't find failed over channel " + oldChannelID);
@@ -254,6 +251,8 @@
if (jmsDestination.isTopic())
{
+ JMSCondition topicCond = new JMSCondition(false, jmsDestination.getName());
+
if (subscriptionName == null)
{
// non-durable subscription
@@ -264,7 +263,7 @@
PagingFilteredQueue q;
- if (topicPostOffice.isLocal())
+ if (postOffice.isLocal())
{
q = new PagingFilteredQueue(new GUID().toString(), idm.getId(), ms, pm, true, false,
executor, selector,
@@ -272,25 +271,25 @@
mDest.getPageSize(),
mDest.getDownCacheSize());
- binding = topicPostOffice.bindQueue(jmsDestination.getName(), q);
+ binding = postOffice.bindQueue(topicCond, q);
}
else
{
- q = new LocalClusteredQueue(topicPostOffice, nodeId, new GUID().toString(), idm.getId(), ms, pm, true, false,
+ q = new LocalClusteredQueue(postOffice, nodeId, new GUID().toString(), idm.getId(), ms, pm, true, false,
executor, selector, tr,
mDest.getFullSize(),
mDest.getPageSize(),
mDest.getDownCacheSize());
- ClusteredPostOffice cpo = (ClusteredPostOffice)topicPostOffice;
+ ClusteredPostOffice cpo = (ClusteredPostOffice)postOffice;
if (mDest.isClustered())
{
- binding = cpo.bindClusteredQueue(jmsDestination.getName(), (LocalClusteredQueue)q);
+ binding = cpo.bindClusteredQueue(topicCond, (LocalClusteredQueue)q);
}
else
{
- binding = cpo.bindQueue(jmsDestination.getName(), q);
+ binding = cpo.bindQueue(topicCond, q);
}
}
}
@@ -312,7 +311,7 @@
String name = MessageQueueNameHelper.createSubscriptionName(clientID, subscriptionName);
- binding = topicPostOffice.getBindingForQueueName(name);
+ binding = postOffice.getBindingForQueueName(name);
if (binding == null)
{
@@ -323,7 +322,7 @@
QueuedExecutor executor = (QueuedExecutor)pool.get();
PagingFilteredQueue q;
- if (topicPostOffice.isLocal())
+ if (postOffice.isLocal())
{
q = new PagingFilteredQueue(name, idm.getId(), ms, pm, true, true,
executor, selector,
@@ -331,25 +330,25 @@
mDest.getPageSize(),
mDest.getDownCacheSize());
- binding = topicPostOffice.bindQueue(jmsDestination.getName(), q);
+ binding = postOffice.bindQueue(topicCond, q);
}
else
{
- q = new LocalClusteredQueue(topicPostOffice, nodeId, name, idm.getId(), ms, pm, true, true,
+ q = new LocalClusteredQueue(postOffice, nodeId, name, idm.getId(), ms, pm, true, true,
executor, selector, tr,
mDest.getFullSize(),
mDest.getPageSize(),
mDest.getDownCacheSize());
- ClusteredPostOffice cpo = (ClusteredPostOffice)topicPostOffice;
+ ClusteredPostOffice cpo = (ClusteredPostOffice)postOffice;
if (mDest.isClustered())
{
- binding = cpo.bindClusteredQueue(jmsDestination.getName(), (LocalClusteredQueue)q);
+ binding = cpo.bindClusteredQueue(topicCond, (LocalClusteredQueue)q);
}
else
{
- binding = cpo.bindQueue(jmsDestination.getName(), q);
+ binding = cpo.bindQueue(topicCond, q);
}
}
}
@@ -385,15 +384,15 @@
// Unbind the durable subscription
- if (mDest.isClustered() && !topicPostOffice.isLocal())
+ if (mDest.isClustered() && !postOffice.isLocal())
{
- ClusteredPostOffice cpo = (ClusteredPostOffice)topicPostOffice;
+ ClusteredPostOffice cpo = (ClusteredPostOffice)postOffice;
cpo.unbindClusteredQueue(name);
}
else
{
- topicPostOffice.unbindQueue(name);
+ postOffice.unbindQueue(name);
}
// create a fresh new subscription
@@ -401,32 +400,32 @@
QueuedExecutor executor = (QueuedExecutor)pool.get();
PagingFilteredQueue q;
- if (topicPostOffice.isLocal())
+ if (postOffice.isLocal())
{
q = new PagingFilteredQueue(name, idm.getId(), ms, pm, true, true,
executor, selector,
mDest.getFullSize(),
mDest.getPageSize(),
mDest.getDownCacheSize());
- binding = topicPostOffice.bindQueue(jmsDestination.getName(), q);
+ binding = postOffice.bindQueue(topicCond, q);
}
else
{
- q = new LocalClusteredQueue(topicPostOffice, nodeId, name, idm.getId(), ms, pm, true, true,
+ q = new LocalClusteredQueue(postOffice, nodeId, name, idm.getId(), ms, pm, true, true,
executor, selector, tr,
mDest.getFullSize(),
mDest.getPageSize(),
mDest.getDownCacheSize());
- ClusteredPostOffice cpo = (ClusteredPostOffice)topicPostOffice;
+ ClusteredPostOffice cpo = (ClusteredPostOffice)postOffice;
if (mDest.isClustered())
{
- binding = cpo.bindClusteredQueue(jmsDestination.getName(), (LocalClusteredQueue)q);
+ binding = cpo.bindClusteredQueue(topicCond, (LocalClusteredQueue)q);
}
else
{
- binding = cpo.bindQueue(jmsDestination.getName(), (LocalClusteredQueue)q);
+ binding = cpo.bindQueue(topicCond, (LocalClusteredQueue)q);
}
}
}
@@ -438,7 +437,7 @@
//Consumer on a jms queue
//Let's find the binding
- binding = queuePostOffice.getBindingForQueueName(jmsDestination.getName());
+ binding = postOffice.getBindingForQueueName(jmsDestination.getName());
if (binding == null)
{
@@ -495,7 +494,7 @@
throw new InvalidDestinationException("No such destination: " + jmsDestination);
}
- Binding binding = queuePostOffice.getBindingForQueueName(jmsDestination.getName()); // todo
+ Binding binding = postOffice.getBindingForQueueName(jmsDestination.getName()); // todo
int browserID = connectionEndpoint.getServerPeer().getNextObjectID();
@@ -729,12 +728,10 @@
PagingFilteredQueue q =
new PagingFilteredQueue(dest.getName(), idm.getId(), ms, pm, true, false,
- executor, null, fullSize, pageSize, downCacheSize);
+ executor, null, fullSize, pageSize, downCacheSize);
-
-
//Make a binding for this queue
- queuePostOffice.bindQueue(dest.getName(), q);
+ postOffice.bindQueue(new JMSCondition(true, dest.getName()), q);
}
}
catch (Throwable t)
@@ -767,12 +764,12 @@
if (dest.isQueue())
{
//Unbind
- queuePostOffice.unbindQueue(dest.getName());
+ postOffice.unbindQueue(dest.getName());
}
else
{
//Topic
- Collection bindings = topicPostOffice.listBindingsForCondition(dest.getName());
+ Collection bindings = postOffice.listBindingsForCondition(new JMSCondition(false, dest.getName()));
if (!bindings.isEmpty())
{
@@ -814,7 +811,7 @@
String queueName = MessageQueueNameHelper.createSubscriptionName(clientID, subscriptionName);
- Binding binding = topicPostOffice.getBindingForQueueName(queueName);
+ Binding binding = postOffice.getBindingForQueueName(queueName);
if (binding == null)
{
@@ -836,19 +833,24 @@
}
//Look up the topic
- ManagedDestination mDest = dm.getDestination(binding.getCondition(), false);
+ JMSCondition topicCond = (JMSCondition)binding.getCondition();
+
+ String topicName = topicCond.getName();
+
+ ManagedDestination mDest = dm.getDestination(topicName, false);
+
//Unbind it
- if (mDest.isClustered() && !topicPostOffice.isLocal())
+ if (mDest.isClustered() && !postOffice.isLocal())
{
- ClusteredPostOffice cpo = (ClusteredPostOffice)topicPostOffice;
+ ClusteredPostOffice cpo = (ClusteredPostOffice)postOffice;
cpo.unbindClusteredQueue(queueName);
}
else
{
- topicPostOffice.unbindQueue(queueName);
+ postOffice.unbindQueue(queueName);
}
}
catch (Throwable t)
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/ClusteredPostOfficeService.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/ClusteredPostOfficeService.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/ClusteredPostOfficeService.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -24,10 +24,12 @@
import javax.management.ObjectName;
import javax.transaction.TransactionManager;
import org.jboss.jms.selector.SelectorFactory;
+import org.jboss.jms.server.JMSConditionFactory;
import org.jboss.jms.server.QueuedExecutorPool;
import org.jboss.jms.server.ServerPeer;
import org.jboss.jms.util.ExceptionUtil;
import org.jboss.messaging.core.FilterFactory;
+import org.jboss.messaging.core.plugin.contract.ConditionFactory;
import org.jboss.messaging.core.plugin.contract.FailoverMapper;
import org.jboss.messaging.core.plugin.contract.MessageStore;
import org.jboss.messaging.core.plugin.contract.MessagingComponent;
@@ -250,13 +252,15 @@
ClusterRouterFactory rf = (ClusterRouterFactory)clazz.newInstance();
+ ConditionFactory cf = new JMSConditionFactory();
+
FilterFactory ff = new SelectorFactory();
FailoverMapper mapper = new DefaultFailoverMapper();
postOffice = new DefaultClusteredPostOffice(ds, tm, sqlProperties,
createTablesOnStartup,
nodeId, officeName, ms,
- pm, tr, ff, pool,
+ pm, tr, ff, cf, pool,
groupName,
syncChannelConfig,
asyncChannelConfig,
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/DefaultPostOfficeService.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/DefaultPostOfficeService.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/DefaultPostOfficeService.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -25,10 +25,12 @@
import javax.transaction.TransactionManager;
import org.jboss.jms.selector.SelectorFactory;
+import org.jboss.jms.server.JMSConditionFactory;
import org.jboss.jms.server.QueuedExecutorPool;
import org.jboss.jms.server.ServerPeer;
import org.jboss.jms.util.ExceptionUtil;
import org.jboss.messaging.core.FilterFactory;
+import org.jboss.messaging.core.plugin.contract.ConditionFactory;
import org.jboss.messaging.core.plugin.contract.MessageStore;
import org.jboss.messaging.core.plugin.contract.MessagingComponent;
import org.jboss.messaging.core.plugin.contract.PersistenceManager;
@@ -135,10 +137,12 @@
int nodeId = serverPeer.getServerPeerID();
FilterFactory ff = new SelectorFactory();
+
+ ConditionFactory cf = new JMSConditionFactory();
postOffice = new DefaultPostOffice(ds, tm, sqlProperties,
createTablesOnStartup,
- nodeId, officeName, ms, pm, tr, ff, pool);
+ nodeId, officeName, ms, pm, tr, ff, cf, pool);
postOffice.start();
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/ClusteredPostOffice.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/ClusteredPostOffice.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/ClusteredPostOffice.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -48,7 +48,7 @@
* @return
* @throws Exception
*/
- Binding bindClusteredQueue(String condition, LocalClusteredQueue queue) throws Exception;
+ Binding bindClusteredQueue(Condition condition, LocalClusteredQueue queue) throws Exception;
/**
* Unbind a clustered queue from the post office
@@ -58,7 +58,7 @@
*/
Binding unbindClusteredQueue(String queueName) throws Throwable;
- Collection listAllBindingsForCondition(String condition) throws Exception;
+ Collection listAllBindingsForCondition(Condition condition) throws Exception;
Binding getBindingforChannelId(long channelId) throws Exception;
}
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/PostOffice.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/PostOffice.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/PostOffice.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -51,10 +51,9 @@
public interface PostOffice extends MessagingComponent
{
String getOfficeName();
+
+ Binding bindQueue(Condition condition, Queue queue) throws Exception;
- Binding bindQueue(String condition, Queue queue) throws Exception;
-
-
Binding unbindQueue(String queueName) throws Throwable;
/**
@@ -63,7 +62,7 @@
* @return
* @throws Exception
*/
- Collection listBindingsForCondition(String condition) throws Exception;
+ Collection listBindingsForCondition(Condition condition) throws Exception;
/**
* Get the binding for the specified queue name
@@ -83,7 +82,11 @@
* @return true if ref was accepted by at least one queue
* @throws Exception
*/
- boolean route(MessageReference ref, String condition, Transaction tx) throws Exception;
+ boolean route(MessageReference ref, Condition condition, Transaction tx) throws Exception;
+ /**
+ *
+ * @return true if it is a non clustered post office
+ */
boolean isLocal();
}
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/Binding.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/Binding.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/Binding.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -22,6 +22,7 @@
package org.jboss.messaging.core.plugin.postoffice;
import org.jboss.messaging.core.Queue;
+import org.jboss.messaging.core.plugin.contract.Condition;
/**
* A Binding
@@ -36,7 +37,7 @@
{
public int getNodeId();
- public String getCondition();
+ public Condition getCondition();
public Queue getQueue();
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/DefaultBinding.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/DefaultBinding.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/DefaultBinding.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -22,6 +22,7 @@
package org.jboss.messaging.core.plugin.postoffice;
import org.jboss.messaging.core.Queue;
+import org.jboss.messaging.core.plugin.contract.Condition;
/**
*
@@ -37,7 +38,7 @@
{
private int nodeId;
- private String condition;
+ private Condition condition;
private Queue queue;
@@ -47,7 +48,7 @@
{
}
- public DefaultBinding(int nodeId, String condition, Queue queue, boolean failed)
+ public DefaultBinding(int nodeId, Condition condition, Queue queue, boolean failed)
{
this.nodeId = nodeId;
@@ -63,7 +64,7 @@
return nodeId;
}
- public String getCondition()
+ public Condition getCondition()
{
return condition;
}
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/DefaultPostOffice.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/DefaultPostOffice.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/DefaultPostOffice.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -21,30 +21,45 @@
*/
package org.jboss.messaging.core.plugin.postoffice;
-import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
-import EDU.oswego.cs.dl.util.concurrent.ReadWriteLock;
-import EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Types;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+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.QueuedExecutorPool;
import org.jboss.logging.Logger;
-import org.jboss.messaging.core.*;
+import org.jboss.messaging.core.Delivery;
+import org.jboss.messaging.core.Filter;
+import org.jboss.messaging.core.FilterFactory;
+import org.jboss.messaging.core.MessageReference;
import org.jboss.messaging.core.Queue;
import org.jboss.messaging.core.local.PagingFilteredQueue;
import org.jboss.messaging.core.plugin.JDBCSupport;
+import org.jboss.messaging.core.plugin.contract.Condition;
+import org.jboss.messaging.core.plugin.contract.ConditionFactory;
import org.jboss.messaging.core.plugin.contract.MessageStore;
import org.jboss.messaging.core.plugin.contract.PersistenceManager;
import org.jboss.messaging.core.plugin.contract.PostOffice;
import org.jboss.messaging.core.tx.Transaction;
import org.jboss.messaging.core.tx.TransactionRepository;
+import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
+import EDU.oswego.cs.dl.util.concurrent.ReadWriteLock;
+import EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock;
+
/**
*
* A DefaultPostOffice
@@ -84,6 +99,8 @@
protected FilterFactory filterFactory;
+ protected ConditionFactory conditionFactory;
+
protected QueuedExecutorPool pool;
public DefaultPostOffice()
@@ -95,6 +112,7 @@
int nodeId, String officeName, MessageStore ms,
PersistenceManager pm,
TransactionRepository tr, FilterFactory filterFactory,
+ ConditionFactory conditionFactory,
QueuedExecutorPool pool)
{
super (ds, tm, sqlProperties, createTablesOnStartup);
@@ -117,6 +135,8 @@
this.filterFactory = filterFactory;
+ this.conditionFactory = conditionFactory;
+
this.pool = pool;
}
@@ -154,7 +174,7 @@
return officeName;
}
- public Binding bindQueue(String condition, Queue queue) throws Exception
+ public Binding bindQueue(Condition condition, Queue queue) throws Exception
{
if (trace) { log.trace(this + " binding queue " + queue.getName() + " with condition " + condition); }
@@ -237,15 +257,12 @@
}
}
- public Collection listBindingsForCondition(String condition) throws Exception
+ public Collection listBindingsForCondition(Condition condition) throws Exception
{
return listBindingsForConditionInternal(condition, true);
}
-
-
-
- public Binding getBindingForQueueName(String queueName) throws Exception
+ public Binding getBindingForQueueName(String queueName) throws Exception
{
if (queueName == null)
{
@@ -283,13 +300,8 @@
return binding;
}
- public void recover() throws Exception
+ public boolean route(MessageReference ref, Condition condition, Transaction tx) throws Exception
{
- //NOOP
- }
-
- public boolean route(MessageReference ref, String condition, Transaction tx) throws Exception
- {
if (trace) { log.trace(this + " routing ref " + ref + " with condition " + condition + " and transaction " + tx); }
if (ref == null)
@@ -377,7 +389,7 @@
// Protected -----------------------------------------------------
- protected Collection listBindingsForConditionInternal(String condition, boolean localOnly) throws Exception
+ protected Collection listBindingsForConditionInternal(Condition condition, boolean localOnly) throws Exception
{
if (condition == null)
{
@@ -448,7 +460,7 @@
String queueName = rs.getString(2);
- String condition = rs.getString(3);
+ String conditionText = rs.getString(3);
String selector = rs.getString(4);
@@ -461,9 +473,12 @@
boolean failed = rs.getString(6).equals("Y");
- log.info("PostOffice " + this.officeName + " nodeId=" + nodeId + " condition=" + condition + " queueName=" + queueName + " channelId=" + channelId + " selector=" + selector);
+ log.info("PostOffice " + this.officeName + " nodeId=" + nodeId + " condition=" + conditionText + " queueName=" + queueName + " channelId=" + channelId + " selector=" + selector);
+ Condition condition = conditionFactory.createCondition(conditionText);
+
Binding binding = this.createBinding(nodeId, condition, queueName, channelId, selector, true, failed);
+
binding.getQueue().deactivate();
addBinding(binding);
@@ -489,35 +504,35 @@
}
}
- protected Binding createBinding(int nodeId, String condition, String queueName, long channelId, String filterString, boolean durable, boolean failed) throws Exception
+ protected Binding createBinding(int nodeId, Condition condition, String queueName, long channelId, String filterString, boolean durable, boolean failed) throws Exception
{
Filter filter = filterFactory.createFilter(filterString);
-
- return createBinding(nodeId, condition, queueName, channelId, filter, durable, failed);
+
+ return createBinding(nodeId, condition, queueName, channelId, filter, durable, failed);
}
-
- protected Binding createBinding(int nodeId, String condition, String queueName, long channelId, Filter filter, boolean durable, boolean failed)
- {
- Queue queue;
- if (nodeId == this.currentNodeId)
- {
- QueuedExecutor executor = (QueuedExecutor)pool.get();
-
- queue = new PagingFilteredQueue(queueName, channelId, ms, pm, true,
- true, executor, filter);
- }
- else
- {
- throw new IllegalStateException("This is a non clustered post office - should not have bindings from different nodes!");
- }
-
- Binding binding = new DefaultBinding(nodeId, condition, queue, failed);
-
- return binding;
-
- }
-
+
+ protected Binding createBinding(int nodeId, Condition condition, String queueName, long channelId, Filter filter, boolean durable, boolean failed)
+ {
+ Queue queue;
+ if (nodeId == this.currentNodeId)
+ {
+ QueuedExecutor executor = (QueuedExecutor)pool.get();
+
+ queue = new PagingFilteredQueue(queueName, channelId, ms, pm, true,
+ true, executor, filter);
+ }
+ else
+ {
+ throw new IllegalStateException("This is a non clustered post office - should not have bindings from different nodes!");
+ }
+
+ Binding binding = new DefaultBinding(nodeId, condition, queue, failed);
+
+ return binding;
+
+ }
+
protected void insertBinding(Binding binding) throws Exception
{
Connection conn = null;
@@ -535,7 +550,7 @@
ps.setString(1, this.officeName);
ps.setInt(2, this.currentNodeId);
ps.setString(3, binding.getQueue().getName());
- ps.setString(4, binding.getCondition());
+ ps.setString(4, binding.getCondition().toText());
if (filterString != null)
{
ps.setString(5, filterString);
@@ -711,7 +726,7 @@
protected void addToConditionMap(Binding binding)
{
- String condition = binding.getCondition();
+ Condition condition = binding.getCondition();
Bindings bindings = (Bindings)conditionMap.get(condition);
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/BindRequest.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/BindRequest.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/BindRequest.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -43,16 +43,16 @@
{
}
- BindRequest(int nodeId, String queueName, String condition, String filterString,
+ BindRequest(int nodeId, String queueName, String conditionText, String filterString,
long channelId, boolean durable, boolean failed)
{
- bindingInfo = new BindingInfo(nodeId, queueName, condition, filterString,
+ bindingInfo = new BindingInfo(nodeId, queueName, conditionText, filterString,
channelId, durable, failed);
}
Object execute(PostOfficeInternal office) throws Exception
{
- office.addBindingFromCluster(bindingInfo.getNodeId(), bindingInfo.getQueueName(), bindingInfo.getCondition(),
+ office.addBindingFromCluster(bindingInfo.getNodeId(), bindingInfo.getQueueName(), bindingInfo.getConditionText(),
bindingInfo.getFilterString(), bindingInfo.getChannelId(), bindingInfo.isDurable(),
bindingInfo.isFailed());
return null;
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/BindingInfo.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/BindingInfo.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/BindingInfo.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -42,7 +42,7 @@
private String queueName;
- private String condition;
+ private String conditionText;
private String filterString;
@@ -56,14 +56,14 @@
{
}
- BindingInfo(int nodeId, String queueName, String condition, String filterString,
+ BindingInfo(int nodeId, String queueName, String conditionText, String filterString,
long channelId, boolean durable, boolean failed)
{
this.nodeId = nodeId;
this.queueName = queueName;
- this.condition = condition;
+ this.conditionText = conditionText;
this.filterString = filterString;
@@ -76,7 +76,7 @@
public void execute(PostOfficeInternal office) throws Exception
{
- office.addBindingFromCluster(nodeId, queueName, condition,
+ office.addBindingFromCluster(nodeId, queueName, conditionText,
filterString, channelId, durable, failed);
}
@@ -87,7 +87,7 @@
queueName = in.readUTF();
- condition = in.readUTF();
+ conditionText = in.readUTF();
filterString = (String)StreamUtils.readObject(in, false);
@@ -102,7 +102,7 @@
out.writeUTF(queueName);
- out.writeUTF(condition);
+ out.writeUTF(conditionText);
StreamUtils.writeObject(out, filterString, false, false);
@@ -116,9 +116,9 @@
return channelId;
}
- String getCondition()
+ String getConditionText()
{
- return condition;
+ return conditionText;
}
boolean isDurable()
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/CastMessagesCallback.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/CastMessagesCallback.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/CastMessagesCallback.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -27,6 +27,7 @@
import org.jboss.logging.Logger;
import org.jboss.messaging.core.Message;
+import org.jboss.messaging.core.plugin.contract.Condition;
import org.jboss.messaging.core.tx.TransactionException;
import org.jboss.messaging.core.tx.TxCallback;
@@ -120,7 +121,7 @@
*/
private long checkChannelID;
- void addMessage(String routingKey, Message message, Map queueNameToNodeIdMap,
+ void addMessage(Condition routingKey, Message message, Map queueNameToNodeIdMap,
int lastNodeId, long channelID)
{
//If we only ever send messages to the same node for this tx, then we can unicast rather than multicast
@@ -141,7 +142,7 @@
}
}
- MessageHolder holder = new MessageHolder(routingKey, message, queueNameToNodeIdMap);
+ MessageHolder holder = new MessageHolder(routingKey.toText(), message, queueNameToNodeIdMap);
if (message.isReliable())
{
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -21,7 +21,6 @@
*/
package org.jboss.messaging.core.plugin.postoffice.cluster;
-import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
@@ -41,9 +40,11 @@
import java.util.Map;
import java.util.Properties;
import java.util.Set;
+
import javax.jms.TextMessage;
import javax.sql.DataSource;
import javax.transaction.TransactionManager;
+
import org.jboss.jms.server.QueuedExecutorPool;
import org.jboss.logging.Logger;
import org.jboss.messaging.core.Delivery;
@@ -52,6 +53,8 @@
import org.jboss.messaging.core.MessageReference;
import org.jboss.messaging.core.Queue;
import org.jboss.messaging.core.plugin.contract.ClusteredPostOffice;
+import org.jboss.messaging.core.plugin.contract.Condition;
+import org.jboss.messaging.core.plugin.contract.ConditionFactory;
import org.jboss.messaging.core.plugin.contract.FailoverMapper;
import org.jboss.messaging.core.plugin.contract.MessageStore;
import org.jboss.messaging.core.plugin.contract.PersistenceManager;
@@ -76,6 +79,8 @@
import org.jgroups.blocks.RequestHandler;
import org.w3c.dom.Element;
+import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
+
/**
*
* A DefaultClusteredPostOffice
@@ -177,6 +182,7 @@
PersistenceManager pm,
TransactionRepository tr,
FilterFactory filterFactory,
+ ConditionFactory conditionFactory,
QueuedExecutorPool pool,
String groupName,
Element syncChannelConfig,
@@ -189,7 +195,7 @@
throws Exception
{
this(ds, tm, sqlProperties, createTablesOnStartup, nodeId, officeName, ms,
- pm, tr, filterFactory, pool, groupName, stateTimeout, castTimeout, redistributionPolicy,
+ pm, tr, filterFactory, conditionFactory, pool, groupName, stateTimeout, castTimeout, redistributionPolicy,
rf, failoverMapper, statsSendPeriod);
this.syncChannelConfigElement = syncChannelConfig;
@@ -209,6 +215,7 @@
PersistenceManager pm,
TransactionRepository tr,
FilterFactory filterFactory,
+ ConditionFactory conditionFactory,
QueuedExecutorPool pool,
String groupName,
String syncChannelConfig,
@@ -220,7 +227,7 @@
long statsSendPeriod) throws Exception
{
this(ds, tm, sqlProperties, createTablesOnStartup, nodeId, officeName, ms,
- pm, tr, filterFactory, pool, groupName, stateTimeout, castTimeout, redistributionPolicy,
+ pm, tr, filterFactory, conditionFactory, pool, groupName, stateTimeout, castTimeout, redistributionPolicy,
rf, failoverMapper, statsSendPeriod);
this.syncChannelConfig = syncChannelConfig;
@@ -237,6 +244,7 @@
PersistenceManager pm,
TransactionRepository tr,
FilterFactory filterFactory,
+ ConditionFactory conditionFactory,
QueuedExecutorPool pool,
String groupName,
long stateTimeout, long castTimeout,
@@ -246,7 +254,7 @@
long statsSendPeriod)
{
super (ds, tm, sqlProperties, createTablesOnStartup, nodeId, officeName, ms, pm, tr,
- filterFactory, pool);
+ filterFactory, conditionFactory, pool);
this.groupName = groupName;
@@ -410,7 +418,7 @@
// ClusteredPostOffice implementation ----------------------------
- public Binding bindClusteredQueue(String condition, LocalClusteredQueue queue) throws Exception
+ public Binding bindClusteredQueue(Condition condition, LocalClusteredQueue queue) throws Exception
{
if (trace)
{
@@ -431,11 +439,11 @@
return binding;
}
- private void sendBindRequest(String condition, LocalClusteredQueue queue, Binding binding)
+ private void sendBindRequest(Condition condition, LocalClusteredQueue queue, Binding binding)
throws Exception
{
BindRequest request =
- new BindRequest(this.currentNodeId, queue.getName(), condition, queue.getFilter() == null ? null : queue.getFilter().getFilterString(),
+ new BindRequest(this.currentNodeId, queue.getName(), condition.toText(), queue.getFilter() == null ? null : queue.getFilter().getFilterString(),
binding.getQueue().getChannelID(), queue.isRecoverable(), binding.isFailed());
syncSendRequest(request);
@@ -457,7 +465,7 @@
return binding;
}
- public boolean route(MessageReference ref, String condition, Transaction tx) throws Exception
+ public boolean route(MessageReference ref, Condition condition, Transaction tx) throws Exception
{
if (trace)
{
@@ -595,14 +603,14 @@
if (trace) { log.trace(this.currentNodeId + " unicasting message to " + lastNodeId); }
//Unicast - only one node is interested in the message
- asyncSendRequest(new MessageRequest(condition, ref.getMessage(), null), lastNodeId);
+ asyncSendRequest(new MessageRequest(condition.toText(), ref.getMessage(), null), lastNodeId);
}
else
{
if (trace) { log.trace(this.currentNodeId + " multicasting message to group"); }
//Multicast - more than one node is interested
- asyncSendRequest(new MessageRequest(condition, ref.getMessage(), queueNameNodeIdMap));
+ asyncSendRequest(new MessageRequest(condition.toText(), ref.getMessage(), queueNameNodeIdMap));
}
}
else
@@ -651,7 +659,7 @@
return false;
}
- public Collection listAllBindingsForCondition(String condition) throws Exception
+ public Collection listAllBindingsForCondition(Condition condition) throws Exception
{
return listBindingsForConditionInternal(condition, false);
}
@@ -807,7 +815,7 @@
/*
* Called when another node adds a binding
*/
- public void addBindingFromCluster(int nodeId, String queueName, String condition,
+ public void addBindingFromCluster(int nodeId, String queueName, String conditionText,
String filterString, long channelID, boolean durable, boolean failed)
throws Exception
{
@@ -815,9 +823,12 @@
if (trace)
{
- log.info(this.currentNodeId + " adding binding from node: " + nodeId + " queue: " + queueName + " with condition: " + condition);
+ log.info(this.currentNodeId + " adding binding from node: " + nodeId +
+ " queue: " + queueName + " with condition: " + conditionText);
}
+ Condition condition = conditionFactory.createCondition(conditionText);
+
try
{
//Sanity
@@ -839,7 +850,8 @@
if (binding != null && failed)
{
- throw new IllegalArgumentException(this.currentNodeId + " Binding already exists for node Id " + nodeId + " queue name " + queueName);
+ throw new IllegalArgumentException(this.currentNodeId +
+ " Binding already exists for node Id " + nodeId + " queue name " + queueName);
}
binding = this.createBinding(nodeId, condition, queueName, channelID, filterString, durable, failed);
@@ -880,22 +892,22 @@
}
}
- public void routeFromCluster(org.jboss.messaging.core.Message message, String routingKey,
+ public void routeFromCluster(org.jboss.messaging.core.Message message, String routingKeyText,
Map queueNameNodeIdMap) throws Exception
{
if (trace)
{
log.trace(this.currentNodeId + " routing from cluster, message: " + message + " routing key " +
- routingKey + " map " + queueNameNodeIdMap);
+ routingKeyText + " map " + queueNameNodeIdMap);
}
log.info(this.currentNodeId + " routing from cluster, message: " + message + " routing key " +
- routingKey + " map " + queueNameNodeIdMap);
+ routingKeyText + " map " + queueNameNodeIdMap);
+ Condition routingKey = conditionFactory.createCondition(routingKeyText);
+
+ lock.readLock().acquire();
-
- lock.readLock().acquire();
-
// Need to reference the message
MessageReference ref = null;
try
@@ -1771,7 +1783,7 @@
protected void addToConditionMap(Binding binding)
{
- String condition = binding.getCondition();
+ Condition condition = binding.getCondition();
ClusteredBindings bindings = (ClusteredBindings)conditionMap.get(condition);
@@ -1877,7 +1889,7 @@
}
}
- protected Binding createBinding(int nodeId, String condition, String queueName, long channelId, Filter filter, boolean durable, boolean failed)
+ protected Binding createBinding(int nodeId, Condition condition, String queueName, long channelId, Filter filter, boolean durable, boolean failed)
{
Queue queue;
if (nodeId == this.currentNodeId)
@@ -2121,7 +2133,7 @@
Queue queue = binding.getQueue();
BindingInfo info = new BindingInfo(binding.getNodeId(), queue.getName(),
- binding.getCondition(),
+ binding.getCondition().toText(),
queue.getFilter() == null ? null : queue.getFilter().getFilterString(),
queue.getChannelID(),
queue.isRecoverable(),
@@ -2166,7 +2178,9 @@
{
BindingInfo info = (BindingInfo)iter.next();
- Binding binding = this.createBinding(info.getNodeId(), info.getCondition(), info.getQueueName(), info.getChannelId(),
+ Condition condition = conditionFactory.createCondition(info.getConditionText());
+
+ Binding binding = this.createBinding(info.getNodeId(), condition, info.getQueueName(), info.getChannelId(),
info.getFilterString(), info.isDurable(),info.isFailed());
if (binding.getNodeId() == this.currentNodeId)
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/MessageHolder.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/MessageHolder.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/MessageHolder.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -41,7 +41,7 @@
*/
class MessageHolder implements Streamable
{
- private String routingKey;
+ private String routingKeyText;
private Message message;
@@ -51,9 +51,9 @@
{
}
- MessageHolder(String routingKey, Message message, Map queueNameToNodeIdMap)
+ MessageHolder(String routingKeyText, Message message, Map queueNameToNodeIdMap)
{
- this.routingKey = routingKey;
+ this.routingKeyText = routingKeyText;
this.message = message;
@@ -62,7 +62,7 @@
String getRoutingKey()
{
- return routingKey;
+ return routingKeyText;
}
Message getMessage()
@@ -77,7 +77,7 @@
public void read(DataInputStream in) throws Exception
{
- routingKey = in.readUTF();
+ routingKeyText = in.readUTF();
byte type = in.readByte();
@@ -89,7 +89,7 @@
public void write(DataOutputStream out) throws Exception
{
- out.writeUTF(routingKey);
+ out.writeUTF(routingKeyText);
out.writeByte(message.getType());
message.write(out);
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/MessageRequest.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/MessageRequest.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/MessageRequest.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -44,7 +44,7 @@
{
static final int TYPE = 3;
- private String routingKey;
+ private String routingConditionText;
private Message message;
@@ -54,9 +54,9 @@
{
}
- MessageRequest(String routingKey, Message message, Map queueNameNodeIdMap)
+ MessageRequest(String routingConditionText, Message message, Map queueNameNodeIdMap)
{
- this.routingKey = routingKey;
+ this.routingConditionText = routingConditionText;
this.message = message;
@@ -65,7 +65,7 @@
Object execute(PostOfficeInternal office) throws Exception
{
- office.routeFromCluster(message, routingKey, queueNameNodeIdMap);
+ office.routeFromCluster(message, routingConditionText, queueNameNodeIdMap);
return null;
}
@@ -76,7 +76,7 @@
public void read(DataInputStream in) throws Exception
{
- routingKey = in.readUTF();
+ routingConditionText = in.readUTF();
byte type = in.readByte();
message = MessageFactory.createMessage(type);
@@ -87,7 +87,7 @@
public void write(DataOutputStream out) throws Exception
{
- out.writeUTF(routingKey);
+ out.writeUTF(routingConditionText);
out.writeByte(message.getType());
message.write(out);
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/PostOfficeInternal.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/PostOfficeInternal.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/PostOfficeInternal.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -43,7 +43,7 @@
*/
interface PostOfficeInternal extends ClusteredPostOffice
{
- void addBindingFromCluster(int nodeId, String queueName, String condition,
+ void addBindingFromCluster(int nodeId, String queueName, String conditionText,
String filterString, long channelId, boolean durable, boolean failed)
throws Exception;
@@ -56,7 +56,7 @@
boolean removeReplicantLocally(int nodeId, Serializable key) throws Exception;
- void routeFromCluster(Message message, String routingKey, Map queueNameNodeIdMap) throws Exception;
+ void routeFromCluster(Message message, String routingKeyText, Map queueNameNodeIdMap) throws Exception;
void asyncSendRequest(ClusterRequest request) throws Exception;
Added: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/SimpleCondition.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/SimpleCondition.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/SimpleCondition.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -0,0 +1,72 @@
+/*
+ * 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.test.messaging.core;
+
+import org.jboss.messaging.core.MessageReference;
+import org.jboss.messaging.core.plugin.contract.Condition;
+
+/**
+ * A SimpleCondition
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * @version <tt>$Revision: 1.1 $</tt>
+ *
+ * $Id$
+ *
+ */
+public class SimpleCondition implements Condition
+{
+ private String name;
+
+ public SimpleCondition(String name)
+ {
+ this.name = name;
+ }
+
+ public boolean matches(Condition routingCondition, MessageReference ref)
+ {
+ return equals(routingCondition);
+ }
+
+ public String toText()
+ {
+ return name;
+ }
+
+ public boolean equals(Object other)
+ {
+ if (!(other instanceof SimpleCondition))
+ {
+ return false;
+ }
+
+ SimpleCondition sother = (SimpleCondition)other;
+
+ return sother.name.equals(this.name);
+ }
+
+ public int hashCode()
+ {
+ return name.hashCode();
+ }
+
+}
Added: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/SimpleConditionFactory.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/SimpleConditionFactory.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/SimpleConditionFactory.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -0,0 +1,44 @@
+/*
+ * 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.test.messaging.core;
+
+import org.jboss.messaging.core.plugin.contract.Condition;
+import org.jboss.messaging.core.plugin.contract.ConditionFactory;
+
+/**
+ * A SimpleConditionFactory
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * @version <tt>$Revision: 1.1 $</tt>
+ *
+ * $Id$
+ *
+ */
+public class SimpleConditionFactory implements ConditionFactory
+{
+
+ public Condition createCondition(String text) throws Exception
+ {
+ return new SimpleCondition(text);
+ }
+
+}
Modified: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/base/PostOfficeTestBase.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/base/PostOfficeTestBase.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/base/PostOfficeTestBase.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -39,6 +39,8 @@
import org.jboss.messaging.core.plugin.IdManager;
import org.jboss.messaging.core.plugin.JDBCPersistenceManager;
import org.jboss.messaging.core.plugin.SimpleMessageStore;
+import org.jboss.messaging.core.plugin.contract.Condition;
+import org.jboss.messaging.core.plugin.contract.ConditionFactory;
import org.jboss.messaging.core.plugin.contract.MessageStore;
import org.jboss.messaging.core.plugin.contract.PersistenceManager;
import org.jboss.messaging.core.plugin.contract.PostOffice;
@@ -46,6 +48,7 @@
import org.jboss.messaging.core.tx.Transaction;
import org.jboss.messaging.core.tx.TransactionRepository;
import org.jboss.test.messaging.MessagingTestCase;
+import org.jboss.test.messaging.core.SimpleConditionFactory;
import org.jboss.test.messaging.core.SimpleFilterFactory;
import org.jboss.test.messaging.core.SimpleReceiver;
import org.jboss.test.messaging.tools.ServerManagement;
@@ -85,6 +88,8 @@
protected QueuedExecutorPool pool;
+ protected ConditionFactory conditionFactory;
+
// Constructors --------------------------------------------------
public PostOfficeTestBase(String name)
@@ -121,6 +126,8 @@
channelIdManager = new IdManager("CHANNEL_ID", 10, pm);
channelIdManager.start();
+
+ conditionFactory = new SimpleConditionFactory();
log.debug("setup done");
}
@@ -147,9 +154,11 @@
{
FilterFactory ff = new SimpleFilterFactory();
+ ConditionFactory cf= new SimpleConditionFactory();
+
DefaultPostOffice postOffice =
new DefaultPostOffice(sc.getDataSource(), sc.getTransactionManager(),
- sc.getPostOfficeSQLProperties(), true, 1, "Simple", ms, pm, tr, ff, pool);
+ sc.getPostOfficeSQLProperties(), true, 1, "Simple", ms, pm, tr, ff, cf, pool);
postOffice.start();
@@ -261,7 +270,7 @@
private static long msgCount;
- protected List sendMessages(String condition, boolean persistent, PostOffice office, int num, Transaction tx) throws Exception
+ protected List sendMessages(String conditionText, boolean persistent, PostOffice office, int num, Transaction tx) throws Exception
{
List list = new ArrayList();
@@ -271,6 +280,8 @@
MessageReference ref = ms.reference(msg);
+ Condition condition = conditionFactory.createCondition(conditionText);
+
boolean routed = office.route(ref, condition, null);
assertTrue(routed);
Modified: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/DefaultPostOfficeTest.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/DefaultPostOfficeTest.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/DefaultPostOfficeTest.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -21,44 +21,23 @@
*/
package org.jboss.test.messaging.core.plugin.postoffice;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
-import javax.naming.InitialContext;
-import javax.sql.DataSource;
-import javax.transaction.TransactionManager;
-
import org.jboss.jms.selector.Selector;
-import org.jboss.jms.server.QueuedExecutorPool;
import org.jboss.messaging.core.Filter;
-import org.jboss.messaging.core.FilterFactory;
import org.jboss.messaging.core.Message;
import org.jboss.messaging.core.MessageReference;
import org.jboss.messaging.core.local.PagingFilteredQueue;
-import org.jboss.messaging.core.plugin.IdManager;
-import org.jboss.messaging.core.plugin.JDBCPersistenceManager;
-import org.jboss.messaging.core.plugin.SimpleMessageStore;
-import org.jboss.messaging.core.plugin.contract.MessageStore;
-import org.jboss.messaging.core.plugin.contract.PersistenceManager;
import org.jboss.messaging.core.plugin.contract.PostOffice;
import org.jboss.messaging.core.plugin.postoffice.Binding;
-import org.jboss.messaging.core.plugin.postoffice.DefaultPostOffice;
import org.jboss.messaging.core.tx.Transaction;
-import org.jboss.messaging.core.tx.TransactionRepository;
-import org.jboss.test.messaging.MessagingTestCase;
+import org.jboss.test.messaging.core.SimpleCondition;
import org.jboss.test.messaging.core.SimpleFilter;
-import org.jboss.test.messaging.core.SimpleFilterFactory;
import org.jboss.test.messaging.core.SimpleReceiver;
import org.jboss.test.messaging.core.plugin.base.PostOfficeTestBase;
-import org.jboss.test.messaging.tools.ServerManagement;
-import org.jboss.test.messaging.tools.jmx.ServiceContainer;
import org.jboss.test.messaging.util.CoreMessageFactory;
-import org.jboss.tm.TransactionManagerService;
import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
@@ -124,12 +103,12 @@
Binding binding1 =
- office1.bindQueue("condition1", queue1);
+ office1.bindQueue(new SimpleCondition("condition1"), queue1);
//Binding twice with the same name should fail
try
{
- Binding bindFail = office1.bindQueue("condition1", queue1);
+ Binding bindFail = office1.bindQueue(new SimpleCondition("condition1"), queue1);
fail();
}
catch (IllegalArgumentException e)
@@ -141,7 +120,7 @@
PagingFilteredQueue queue2 = new PagingFilteredQueue("nonDurableQueue", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding2 =
- office1.bindQueue("condition2", queue2);
+ office1.bindQueue(new SimpleCondition("condition2"), queue2);
//Check they're there
@@ -231,60 +210,60 @@
PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding1 =
- office.bindQueue("condition1", queue1);
+ office.bindQueue(new SimpleCondition("condition1"), queue1);
PagingFilteredQueue queue2 = new PagingFilteredQueue("queue2", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding2 =
- office.bindQueue("condition1", queue2);
+ office.bindQueue(new SimpleCondition("condition1"), queue2);
PagingFilteredQueue queue3 = new PagingFilteredQueue("queue3", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding3 =
- office.bindQueue("condition1", queue3);
+ office.bindQueue(new SimpleCondition("condition1"), queue3);
PagingFilteredQueue queue4 = new PagingFilteredQueue("queue4", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding4 =
- office.bindQueue("condition1", queue4);
+ office.bindQueue(new SimpleCondition("condition1"), queue4);
PagingFilteredQueue queue5 = new PagingFilteredQueue("queue5", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding5 =
- office.bindQueue("condition2", queue5);
+ office.bindQueue(new SimpleCondition("condition2"), queue5);
PagingFilteredQueue queue6 = new PagingFilteredQueue("queue6", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding6 =
- office.bindQueue("condition2", queue6);
+ office.bindQueue(new SimpleCondition("condition2"), queue6);
PagingFilteredQueue queue7 = new PagingFilteredQueue("queue7", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding7 =
- office.bindQueue("condition2", queue7);
+ office.bindQueue(new SimpleCondition("condition2"), queue7);
PagingFilteredQueue queue8 = new PagingFilteredQueue("queue8", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding8 =
- office.bindQueue("condition2", queue8);
+ office.bindQueue(new SimpleCondition("condition2"), queue8);
- Collection bindings = office.listBindingsForCondition("dummy");
+ Collection bindings = office.listBindingsForCondition(new SimpleCondition("dummy"));
assertNotNull(bindings);
assertTrue(bindings.isEmpty());
//We don't match on substrings
- bindings = office.listBindingsForCondition("condition123");
+ bindings = office.listBindingsForCondition(new SimpleCondition("condition123"));
assertNotNull(bindings);
assertTrue(bindings.isEmpty());
//We don't currently support hierarchies
- bindings = office.listBindingsForCondition("condition1.subcondition");
+ bindings = office.listBindingsForCondition(new SimpleCondition("condition1.subcondition"));
assertNotNull(bindings);
assertTrue(bindings.isEmpty());
//We currently just do an exact match
- bindings = office.listBindingsForCondition("condition1");
+ bindings = office.listBindingsForCondition(new SimpleCondition("condition1"));
assertNotNull(bindings);
assertEquals(4, bindings.size());
@@ -294,7 +273,7 @@
assertEquivalent((Binding)iter.next(), binding3);
assertEquivalent((Binding)iter.next(), binding4);
- bindings = office.listBindingsForCondition("condition2");
+ bindings = office.listBindingsForCondition(new SimpleCondition("condition2"));
assertNotNull(bindings);
assertEquals(4, bindings.size());
@@ -357,32 +336,32 @@
PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding1 =
- postOffice.bindQueue("topic1", queue1);
+ postOffice.bindQueue(new SimpleCondition("topic1"), queue1);
PagingFilteredQueue queue2 = new PagingFilteredQueue("queue2", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding2 =
- postOffice.bindQueue("topic1", queue2);
+ postOffice.bindQueue(new SimpleCondition("topic1"), queue2);
PagingFilteredQueue queue3 = new PagingFilteredQueue("queue3", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding3 =
- postOffice.bindQueue("topic1", queue3);
+ postOffice.bindQueue(new SimpleCondition("topic1"), queue3);
PagingFilteredQueue queue4 = new PagingFilteredQueue("queue4", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding4 =
- postOffice.bindQueue("topic2", queue4);
+ postOffice.bindQueue(new SimpleCondition("topic2"), queue4);
PagingFilteredQueue queue5 = new PagingFilteredQueue("queue5", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding5 =
- postOffice.bindQueue("topic2", queue5);
+ postOffice.bindQueue(new SimpleCondition("topic2"), queue5);
PagingFilteredQueue queue6 = new PagingFilteredQueue("queue6", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding6 =
- postOffice.bindQueue("topic2", queue6);
+ postOffice.bindQueue(new SimpleCondition("topic2"), queue6);
SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue1.add(receiver1);
@@ -412,7 +391,7 @@
Message msg1 = CoreMessageFactory.createCoreMessage(1);
MessageReference ref1 = ms.reference(msg1);
- boolean routed = postOffice.route(ref1, "topic1", null);
+ boolean routed = postOffice.route(ref1, new SimpleCondition("topic1"), null);
assertTrue(routed);
List msgs = receiver1.getMessages();
@@ -450,7 +429,7 @@
Message msg2 = CoreMessageFactory.createCoreMessage(2);
MessageReference ref2 = ms.reference(msg2);
- routed = postOffice.route(ref2, "topic2", null);
+ routed = postOffice.route(ref2, new SimpleCondition("topic2"), null);
assertTrue(routed);
msgs = receiver1.getMessages();
@@ -509,7 +488,7 @@
PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding1 =
- postOffice.bindQueue("condition1", queue1);
+ postOffice.bindQueue(new SimpleCondition("condition1"), queue1);
SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;
queue1.add(receiver1);
@@ -519,7 +498,7 @@
Message msg1 = CoreMessageFactory.createCoreMessage(1);
MessageReference ref1 = ms.reference(msg1);
- boolean routed = postOffice.route(ref1, "this won't match anything", null);
+ boolean routed = postOffice.route(ref1, new SimpleCondition("this won't match anything"), null);
assertFalse(routed);
@@ -561,17 +540,17 @@
PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), filter);
Binding binding1 =
- postOffice.bindQueue("topic1", queue1);
+ postOffice.bindQueue(new SimpleCondition("topic1"), queue1);
PagingFilteredQueue queue2 = new PagingFilteredQueue("queue2", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding2 =
- postOffice.bindQueue("topic1", queue2);
+ postOffice.bindQueue(new SimpleCondition("topic1"), queue2);
PagingFilteredQueue queue3 = new PagingFilteredQueue("queue3", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding3 =
- postOffice.bindQueue("topic1", queue3);
+ postOffice.bindQueue(new SimpleCondition("topic1"), queue3);
SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue1.add(receiver1);
@@ -582,15 +561,15 @@
Message msg1 = CoreMessageFactory.createCoreMessage(1);
MessageReference ref1 = ms.reference(msg1);
- boolean routed = postOffice.route(ref1, "topic1", null);
+ boolean routed = postOffice.route(ref1, new SimpleCondition("topic1"), null);
assertTrue(routed);
Message msg2 = CoreMessageFactory.createCoreMessage(2);
MessageReference ref2 = ms.reference(msg2);
- routed = postOffice.route(ref2, "topic1", null);
+ routed = postOffice.route(ref2, new SimpleCondition("topic1"), null);
assertTrue(routed);
Message msg3 = CoreMessageFactory.createCoreMessage(3);
MessageReference ref3 = ms.reference(msg3);
- routed = postOffice.route(ref3, "topic1", null);
+ routed = postOffice.route(ref3, new SimpleCondition("topic1"), null);
assertTrue(routed);
List msgs = receiver1.getMessages();
@@ -663,32 +642,32 @@
PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding1 =
- postOffice.bindQueue("topic1", queue1);
+ postOffice.bindQueue(new SimpleCondition("topic1"), queue1);
PagingFilteredQueue queue2 = new PagingFilteredQueue("queue2", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding2 =
- postOffice.bindQueue("topic1", queue2);
+ postOffice.bindQueue(new SimpleCondition("topic1"), queue2);
PagingFilteredQueue queue3 = new PagingFilteredQueue("queue3", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding3 =
- postOffice.bindQueue("topic1", queue3);
+ postOffice.bindQueue(new SimpleCondition("topic1"), queue3);
PagingFilteredQueue queue4 = new PagingFilteredQueue("queue4", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null);
Binding binding4 =
- postOffice.bindQueue("topic2", queue4);
+ postOffice.bindQueue(new SimpleCondition("topic2"), queue4);
PagingFilteredQueue queue5 = new PagingFilteredQueue("queue5", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null);
Binding binding5 =
- postOffice.bindQueue("topic2", queue5);
+ postOffice.bindQueue(new SimpleCondition("topic2"), queue5);
PagingFilteredQueue queue6 = new PagingFilteredQueue("queue6", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null);
Binding binding6 =
- postOffice.bindQueue("topic2", queue6);
+ postOffice.bindQueue(new SimpleCondition("topic2"), queue6);
SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;
queue1.add(receiver1);
@@ -713,7 +692,7 @@
Message msg1 = CoreMessageFactory.createCoreMessage(1, persistentMessage, null);
MessageReference ref1 = ms.reference(msg1);
- boolean routed = postOffice.route(ref1, "topic1", null);
+ boolean routed = postOffice.route(ref1, new SimpleCondition("topic1"), null);
assertTrue(routed);
List msgs = receiver1.getMessages();
@@ -766,7 +745,7 @@
Message msg2 = CoreMessageFactory.createCoreMessage(2, persistentMessage, null);
MessageReference ref2 = ms.reference(msg2);
- routed = postOffice.route(ref2, "topic2", null);
+ routed = postOffice.route(ref2, new SimpleCondition("topic2"), null);
assertTrue(routed);
msgs = receiver4.getMessages();
@@ -837,12 +816,12 @@
PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
Binding binding1 =
- postOffice.bindQueue("topic1", queue1);
+ postOffice.bindQueue(new SimpleCondition("topic1"), queue1);
PagingFilteredQueue queue2 = new PagingFilteredQueue("queue2", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null);
Binding binding2 =
- postOffice.bindQueue("topic1", queue2);
+ postOffice.bindQueue(new SimpleCondition("topic1"), queue2);
SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;
queue1.add(receiver1);
@@ -861,9 +840,9 @@
Transaction tx = tr.createTransaction();
- boolean routed = postOffice.route(ref1, "topic1", tx);
+ boolean routed = postOffice.route(ref1, new SimpleCondition("topic1"), tx);
assertTrue(routed);
- routed = postOffice.route(ref2, "topic1", tx);
+ routed = postOffice.route(ref2, new SimpleCondition("topic1"), tx);
assertTrue(routed);
List msgs = queue1.browse();
@@ -919,9 +898,9 @@
tx = tr.createTransaction();
- routed = postOffice.route(ref3, "topic1", tx);
+ routed = postOffice.route(ref3, new SimpleCondition("topic1"), tx);
assertTrue(routed);
- routed = postOffice.route(ref4, "topic1", tx);
+ routed = postOffice.route(ref4, new SimpleCondition("topic1"), tx);
assertTrue(routed);
msgs = queue1.browse();
@@ -953,9 +932,9 @@
Message msg6 = CoreMessageFactory.createCoreMessage(6, persistentMessage, null);
MessageReference ref6 = ms.reference(msg6);
- routed = postOffice.route(ref5, "topic1", null);
+ routed = postOffice.route(ref5, new SimpleCondition("topic1"), null);
assertTrue(routed);
- routed = postOffice.route(ref6, "topic1", null);
+ routed = postOffice.route(ref6, new SimpleCondition("topic1"), null);
assertTrue(routed);
msgs = receiver1.getMessages();
@@ -1020,9 +999,9 @@
Message msg8 = CoreMessageFactory.createCoreMessage(8, persistentMessage, null);
MessageReference ref8 = ms.reference(msg8);
- routed = postOffice.route(ref7, "topic1", null);
+ routed = postOffice.route(ref7, new SimpleCondition("topic1"), null);
assertTrue(routed);
- routed = postOffice.route(ref8, "topic1", null);
+ routed = postOffice.route(ref8, new SimpleCondition("topic1"), null);
assertTrue(routed);
msgs = receiver1.getMessages();
Modified: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOfficeTest.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOfficeTest.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOfficeTest.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -30,6 +30,7 @@
import org.jboss.messaging.core.MessageReference;
import org.jboss.messaging.core.local.PagingFilteredQueue;
import org.jboss.messaging.core.plugin.contract.ClusteredPostOffice;
+import org.jboss.messaging.core.plugin.contract.ConditionFactory;
import org.jboss.messaging.core.plugin.contract.FailoverMapper;
import org.jboss.messaging.core.plugin.postoffice.Binding;
import org.jboss.messaging.core.plugin.postoffice.cluster.ClusterRouterFactory;
@@ -40,6 +41,8 @@
import org.jboss.messaging.core.plugin.postoffice.cluster.MessagePullPolicy;
import org.jboss.messaging.core.plugin.postoffice.cluster.NullMessagePullPolicy;
import org.jboss.messaging.core.tx.Transaction;
+import org.jboss.test.messaging.core.SimpleCondition;
+import org.jboss.test.messaging.core.SimpleConditionFactory;
import org.jboss.test.messaging.core.SimpleFilter;
import org.jboss.test.messaging.core.SimpleFilterFactory;
import org.jboss.test.messaging.core.SimpleReceiver;
@@ -157,17 +160,17 @@
LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "sub1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 =
- office1.bindClusteredQueue("topic1", queue1);
+ office1.bindClusteredQueue(new SimpleCondition("topic1"), queue1);
LocalClusteredQueue queue2 = new LocalClusteredQueue(office1, 1, "sub2", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 =
- office1.bindClusteredQueue("topic1", queue2);
+ office1.bindClusteredQueue(new SimpleCondition("topic1"), queue2);
//Start another office - make sure it picks up the bindings from the first node
office2 = createClusteredPostOffice(2, "testgroup");
- Collection bindings = office2.listAllBindingsForCondition("topic1");
+ Collection bindings = office2.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(2, bindings.size());
@@ -180,11 +183,11 @@
LocalClusteredQueue queue3 = new LocalClusteredQueue(office2, 2, "sub3", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding3 =
- office2.bindClusteredQueue("topic1", queue3);
+ office2.bindClusteredQueue(new SimpleCondition("topic1"), queue3);
//Make sure both nodes pick it up
- bindings = office1.listAllBindingsForCondition("topic1");
+ bindings = office1.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(3, bindings.size());
@@ -193,7 +196,7 @@
assertEquivalent(binding2, (Binding)iter.next());
assertEquivalent(binding3, (Binding)iter.next());
- bindings = office2.listAllBindingsForCondition("topic1");
+ bindings = office2.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(3, bindings.size());
@@ -206,11 +209,11 @@
LocalClusteredQueue queue4 = new LocalClusteredQueue(office2, 2, "sub4", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding4 =
- office2.bindClusteredQueue("topic1", queue4);
+ office2.bindClusteredQueue(new SimpleCondition("topic1"), queue4);
// Make sure both nodes pick it up
- bindings = office1.listAllBindingsForCondition("topic1");
+ bindings = office1.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(4, bindings.size());
@@ -220,7 +223,7 @@
assertEquivalent(binding3, (Binding)iter.next());
assertEquivalent(binding4, (Binding)iter.next());
- bindings = office2.listAllBindingsForCondition("topic1");
+ bindings = office2.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(4, bindings.size());
@@ -236,7 +239,7 @@
//Make sure bindings are not longer available on either node
- bindings = office1.listAllBindingsForCondition("topic1");
+ bindings = office1.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(2, bindings.size());
@@ -244,7 +247,7 @@
assertEquivalent(binding3, (Binding)iter.next());
assertEquivalent(binding4, (Binding)iter.next());
- bindings = office2.listAllBindingsForCondition("topic1");
+ bindings = office2.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(2, bindings.size());
@@ -258,7 +261,7 @@
//Maks sure it picks up the bindings
- bindings = office3.listAllBindingsForCondition("topic1");
+ bindings = office3.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(2, bindings.size());
@@ -271,11 +274,11 @@
LocalClusteredQueue queue5 = new LocalClusteredQueue(office3, 3, "sub5", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding5 =
- office3.bindClusteredQueue("topic1", queue5);
+ office3.bindClusteredQueue(new SimpleCondition("topic1"), queue5);
// Make sure all nodes pick it up
- bindings = office1.listAllBindingsForCondition("topic1");
+ bindings = office1.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(3, bindings.size());
@@ -284,7 +287,7 @@
assertEquivalent(binding4, (Binding)iter.next());
assertEquivalent(binding5, (Binding)iter.next());
- bindings = office2.listAllBindingsForCondition("topic1");
+ bindings = office2.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(3, bindings.size());
@@ -293,7 +296,7 @@
assertEquivalent(binding4, (Binding)iter.next());
assertEquivalent(binding5, (Binding)iter.next());
- bindings = office3.listAllBindingsForCondition("topic1");
+ bindings = office3.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(3, bindings.size());
@@ -307,16 +310,16 @@
LocalClusteredQueue queue6 = new LocalClusteredQueue(office1, 1, "sub6", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding6 =
- office1.bindClusteredQueue("topic1", queue6);
+ office1.bindClusteredQueue(new SimpleCondition("topic1"), queue6);
LocalClusteredQueue queue7 = new LocalClusteredQueue(office1, 1, "sub7", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
Binding binding7 =
- office1.bindClusteredQueue("topic1", queue7);
+ office1.bindClusteredQueue(new SimpleCondition("topic1"), queue7);
// Make sure all nodes pick them up
- bindings = office1.listAllBindingsForCondition("topic1");
+ bindings = office1.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(5, bindings.size());
@@ -327,7 +330,7 @@
assertEquivalent(binding6, (Binding)iter.next());
assertEquivalent(binding7, (Binding)iter.next());
- bindings = office2.listAllBindingsForCondition("topic1");
+ bindings = office2.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(5, bindings.size());
@@ -338,7 +341,7 @@
assertEquivalent(binding6, (Binding)iter.next());
assertEquivalent(binding7, (Binding)iter.next());
- bindings = office3.listAllBindingsForCondition("topic1");
+ bindings = office3.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(5, bindings.size());
@@ -360,7 +363,7 @@
//All it's non durable bindings should be removed from the other nodes
//Durable bindings should remain
- bindings = office2.listAllBindingsForCondition("topic1");
+ bindings = office2.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(4, bindings.size());
@@ -370,7 +373,7 @@
assertEquivalent(binding5, (Binding)iter.next());
assertEquivalent(binding6, (Binding)iter.next());
- bindings = office3.listAllBindingsForCondition("topic1");
+ bindings = office3.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(4, bindings.size());
@@ -383,7 +386,7 @@
//Stop office 2
office2.stop();
- bindings = office3.listAllBindingsForCondition("topic1");
+ bindings = office3.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(2, bindings.size());
@@ -396,7 +399,7 @@
office2 = createClusteredPostOffice(2, "testgroup");
- bindings = office1.listAllBindingsForCondition("topic1");
+ bindings = office1.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(2, bindings.size());
@@ -404,7 +407,7 @@
assertEquivalent(binding5, (Binding)iter.next());
assertEquivalent(binding6, (Binding)iter.next());
- bindings = office2.listAllBindingsForCondition("topic1");
+ bindings = office2.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(2, bindings.size());
@@ -412,7 +415,7 @@
assertEquivalent(binding5, (Binding)iter.next());
assertEquivalent(binding6, (Binding)iter.next());
- bindings = office3.listAllBindingsForCondition("topic1");
+ bindings = office3.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(2, bindings.size());
@@ -433,21 +436,21 @@
//Only the durable queue should survive
- bindings = office1.listAllBindingsForCondition("topic1");
+ bindings = office1.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(1, bindings.size());
iter = bindings.iterator();
assertEquivalent(binding6, (Binding)iter.next());
- bindings = office2.listAllBindingsForCondition("topic1");
+ bindings = office2.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(1, bindings.size());
iter = bindings.iterator();
assertEquivalent(binding6, (Binding)iter.next());
- bindings = office3.listAllBindingsForCondition("topic1");
+ bindings = office3.listAllBindingsForCondition(new SimpleCondition("topic1"));
assertNotNull(bindings);
assertEquals(1, bindings.size());
@@ -597,17 +600,17 @@
LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding1 = office1.bindClusteredQueue("queue1", queue1);
+ Binding binding1 = office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);
LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding2 = office2.bindClusteredQueue("queue1", queue2);
+ Binding binding2 = office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);
LocalClusteredQueue queue3 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
try
{
- Binding binding3 = office1.bindClusteredQueue("queue1", queue3);
+ Binding binding3 = office1.bindClusteredQueue(new SimpleCondition("queue1"), queue3);
fail();
}
catch (Exception e)
@@ -618,7 +621,7 @@
try
{
- Binding binding4 = office2.bindClusteredQueue("queue1", queue4);
+ Binding binding4 = office2.bindClusteredQueue(new SimpleCondition("queue1"), queue4);
fail();
}
catch (Exception e)
@@ -632,12 +635,12 @@
LocalClusteredQueue queue5 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding5 = office1.bindClusteredQueue("queue1", queue5);
+ Binding binding5 = office1.bindClusteredQueue(new SimpleCondition("queue1"), queue5);
PagingFilteredQueue queue6 = new PagingFilteredQueue("queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null);
try
{
- Binding binding6 = office1.bindQueue("queue1", queue6);
+ Binding binding6 = office1.bindQueue(new SimpleCondition("queue1"), queue6);
fail();
}
catch (Exception e)
@@ -649,15 +652,15 @@
//It should be possible to bind queues locally into a clustered post office
LocalClusteredQueue queue7 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding7 = office1.bindQueue("queue1", queue7);
+ Binding binding7 = office1.bindQueue(new SimpleCondition("queue1"), queue7);
LocalClusteredQueue queue8 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding8 = office2.bindQueue("queue1", queue8);
+ Binding binding8 = office2.bindQueue(new SimpleCondition("queue1"), queue8);
LocalClusteredQueue queue9 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
try
{
- Binding binding9 = office1.bindQueue("queue1", queue9);
+ Binding binding9 = office1.bindQueue(new SimpleCondition("queue1"), queue9);
fail();
}
catch (Exception e)
@@ -700,15 +703,15 @@
LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), filter1, tr);
Binding binding1 =
- office1.bindClusteredQueue("topic1", queue1);
+ office1.bindClusteredQueue(new SimpleCondition("topic1"), queue1);
LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue2", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), filter2, tr);
Binding binding2 =
- office2.bindClusteredQueue("topic1", queue2);
+ office2.bindClusteredQueue(new SimpleCondition("topic1"), queue2);
LocalClusteredQueue queue3 = new LocalClusteredQueue(office2, 2, "queue3", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
Binding binding3 =
- office2.bindClusteredQueue("topic1", queue3);
+ office2.bindClusteredQueue(new SimpleCondition("topic1"), queue3);
SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue1.add(receiver1);
@@ -719,17 +722,17 @@
Message msg1 = CoreMessageFactory.createCoreMessage(1);
MessageReference ref1 = ms.reference(msg1);
- boolean routed = office1.route(ref1, "topic1", null);
+ boolean routed = office1.route(ref1, new SimpleCondition("topic1"), null);
assertTrue(routed);
Message msg2 = CoreMessageFactory.createCoreMessage(2);
MessageReference ref2 = ms.reference(msg2);
- routed = office1.route(ref2, "topic1", null);
+ routed = office1.route(ref2, new SimpleCondition("topic1"), null);
assertTrue(routed);
Message msg3 = CoreMessageFactory.createCoreMessage(3);
MessageReference ref3 = ms.reference(msg3);
- routed = office1.route(ref3, "topic1", null);
+ routed = office1.route(ref3, new SimpleCondition("topic1"), null);
assertTrue(routed);
Thread.sleep(1000);
@@ -808,52 +811,52 @@
Binding[] bindings = new Binding[16];
queues[0] = new LocalClusteredQueue(office1, 1, "sub1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[0] = office1.bindClusteredQueue("topic1", queues[0]);
+ bindings[0] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[0]);
queues[1] = new LocalClusteredQueue(office1, 1, "sub2", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[1] = office1.bindClusteredQueue("topic1", queues[1]);
+ bindings[1] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[1]);
queues[2] = new LocalClusteredQueue(office2, 2, "sub3", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[2] = office2.bindClusteredQueue("topic1", queues[2]);
+ bindings[2] = office2.bindClusteredQueue(new SimpleCondition("topic1"), queues[2]);
queues[3] = new LocalClusteredQueue(office2, 2, "sub4", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[3] = office2.bindClusteredQueue("topic1", queues[3]);
+ bindings[3] = office2.bindClusteredQueue(new SimpleCondition("topic1"), queues[3]);
queues[4] = new LocalClusteredQueue(office2, 2, "sub5", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- bindings[4] = office2.bindClusteredQueue("topic1", queues[4]);
+ bindings[4] = office2.bindClusteredQueue(new SimpleCondition("topic1"), queues[4]);
queues[5] = new LocalClusteredQueue(office1, 1, "sub6", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[5] = office1.bindClusteredQueue("topic1", queues[5]);
+ bindings[5] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[5]);
queues[6] = new LocalClusteredQueue(office1, 1, "sub7", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- bindings[6] = office1.bindClusteredQueue("topic1", queues[6]);
+ bindings[6] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[6]);
queues[7] = new LocalClusteredQueue(office1, 1, "sub8", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- bindings[7] = office1.bindClusteredQueue("topic1", queues[7]);
+ bindings[7] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[7]);
queues[8] = new LocalClusteredQueue(office1, 1, "sub9", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[8] = office1.bindClusteredQueue("topic2", queues[8]);
+ bindings[8] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[8]);
queues[9] = new LocalClusteredQueue(office1, 1, "sub10", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[9] = office1.bindClusteredQueue("topic2", queues[9]);
+ bindings[9] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[9]);
queues[10] = new LocalClusteredQueue(office2, 2, "sub11", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[10] = office2.bindClusteredQueue("topic2", queues[10]);
+ bindings[10] = office2.bindClusteredQueue(new SimpleCondition("topic2"), queues[10]);
queues[11] = new LocalClusteredQueue(office2, 2, "sub12", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[11] = office2.bindClusteredQueue("topic2", queues[11]);
+ bindings[11] = office2.bindClusteredQueue(new SimpleCondition("topic2"), queues[11]);
queues[12] = new LocalClusteredQueue(office2, 2, "sub13", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- bindings[12] = office2.bindClusteredQueue("topic2", queues[12]);
+ bindings[12] = office2.bindClusteredQueue(new SimpleCondition("topic2"), queues[12]);
queues[13] = new LocalClusteredQueue(office1, 1, "sub14", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[13] = office1.bindClusteredQueue("topic2", queues[13]);
+ bindings[13] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[13]);
queues[14] = new LocalClusteredQueue(office1, 1, "sub15", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- bindings[14] = office1.bindClusteredQueue("topic2", queues[14]);
+ bindings[14] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[14]);
queues[15] = new LocalClusteredQueue(office1, 1, "sub16", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- bindings[15] = office1.bindClusteredQueue("topic2", queues[15]);
+ bindings[15] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[15]);
SimpleReceiver[] receivers = new SimpleReceiver[16];
@@ -866,7 +869,7 @@
Message msg = CoreMessageFactory.createCoreMessage(1, persistentMessage, null);
MessageReference ref = ms.reference(msg);
- boolean routed = office1.route(ref, "topic1", null);
+ boolean routed = office1.route(ref, new SimpleCondition("topic1"), null);
assertTrue(routed);
//Messages are sent asych so may take some finite time to arrive
@@ -901,7 +904,7 @@
msg = CoreMessageFactory.createCoreMessage(2, persistentMessage, null);;
ref = ms.reference(msg);
- routed = office1.route(ref, "topic2", null);
+ routed = office1.route(ref, new SimpleCondition("topic2"), null);
assertTrue(routed);
//Messages are sent asych so may take some finite time to arrive
Thread.sleep(1000);
@@ -998,27 +1001,27 @@
//We don't deploy on node 6
LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
- Binding binding1 = office1.bindClusteredQueue("queue1", queue1);
+ Binding binding1 = office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);
SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue1.add(receiver1);
LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
- Binding binding2 = office2.bindClusteredQueue("queue1", queue2);
+ Binding binding2 = office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);
SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue2.add(receiver2);
LocalClusteredQueue queue3 = new LocalClusteredQueue(office3, 3, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
- Binding binding3 = office3.bindClusteredQueue("queue1", queue3);
+ Binding binding3 = office3.bindClusteredQueue(new SimpleCondition("queue1"), queue3);
SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue3.add(receiver3);
LocalClusteredQueue queue4 = new LocalClusteredQueue(office4, 4, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
- Binding binding4 = office4.bindClusteredQueue("queue1", queue4);
+ Binding binding4 = office4.bindClusteredQueue(new SimpleCondition("queue1"), queue4);
SimpleReceiver receiver4 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue4.add(receiver4);
LocalClusteredQueue queue5 = new LocalClusteredQueue(office5, 5, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
- Binding binding5 = office5.bindClusteredQueue("queue1", queue5);
+ Binding binding5 = office5.bindClusteredQueue(new SimpleCondition("queue1"), queue5);
SimpleReceiver receiver5 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue5.add(receiver5);
@@ -1026,7 +1029,7 @@
Message msg = CoreMessageFactory.createCoreMessage(1, persistentMessage, null);
MessageReference ref = ms.reference(msg);
- boolean routed = office1.route(ref, "queue1", null);
+ boolean routed = office1.route(ref, new SimpleCondition("queue1"), null);
assertTrue(routed);
checkContainsAndAcknowledge(msg, receiver1, queue1);
this.checkEmpty(receiver2);
@@ -1036,7 +1039,7 @@
msg = CoreMessageFactory.createCoreMessage(1, persistentMessage, null);
ref = ms.reference(msg);
- routed = office2.route(ref, "queue1", null);
+ routed = office2.route(ref, new SimpleCondition("queue1"), null);
assertTrue(routed);
this.checkEmpty(receiver1);
checkContainsAndAcknowledge(msg, receiver2, queue2);
@@ -1046,7 +1049,7 @@
msg = CoreMessageFactory.createCoreMessage(1, persistentMessage, null);
ref = ms.reference(msg);
- routed = office3.route(ref, "queue1", null);
+ routed = office3.route(ref, new SimpleCondition("queue1"), null);
assertTrue(routed);
this.checkEmpty(receiver1);
this.checkEmpty(receiver2);
@@ -1056,7 +1059,7 @@
msg = CoreMessageFactory.createCoreMessage(1, persistentMessage, null);
ref = ms.reference(msg);
- routed = office4.route(ref, "queue1", null);
+ routed = office4.route(ref, new SimpleCondition("queue1"), null);
assertTrue(routed);
this.checkEmpty(receiver1);
this.checkEmpty(receiver2);
@@ -1066,7 +1069,7 @@
msg = CoreMessageFactory.createCoreMessage(1, persistentMessage, null);
ref = ms.reference(msg);
- routed = office5.route(ref, "queue1", null);
+ routed = office5.route(ref, new SimpleCondition("queue1"), null);
assertTrue(routed);
this.checkEmpty(receiver1);
this.checkEmpty(receiver2);
@@ -1076,7 +1079,7 @@
msg = CoreMessageFactory.createCoreMessage(1, persistentMessage, null);
ref = ms.reference(msg);
- routed = office6.route(ref, "queue1", null);
+ routed = office6.route(ref, new SimpleCondition("queue1"), null);
assertTrue(routed);
//The actual queue that receives the mesage is determined by the routing policy
@@ -1151,17 +1154,17 @@
office3 = createClusteredPostOffice(3, "testgroup");
LocalClusteredQueue sub1 = new LocalClusteredQueue(office1, 1, "sub1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
- Binding binding1 = office1.bindQueue("topic", sub1);
+ Binding binding1 = office1.bindQueue(new SimpleCondition("topic"), sub1);
SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
sub1.add(receiver1);
LocalClusteredQueue sub2 = new LocalClusteredQueue(office2, 2, "sub2", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
- Binding binding2 = office2.bindQueue("topic", sub2);
+ Binding binding2 = office2.bindQueue(new SimpleCondition("topic"), sub2);
SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
sub2.add(receiver2);
LocalClusteredQueue sub3 = new LocalClusteredQueue(office3, 3, "sub3", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
- Binding binding3 = office3.bindQueue("topic", sub3);
+ Binding binding3 = office3.bindQueue(new SimpleCondition("topic"), sub3);
SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
sub3.add(receiver3);
@@ -1169,7 +1172,7 @@
Message msg = CoreMessageFactory.createCoreMessage(1, persistentMessage, null);
MessageReference ref = ms.reference(msg);
- boolean routed = office1.route(ref, "topic", null);
+ boolean routed = office1.route(ref, new SimpleCondition("topic"), null);
assertTrue(routed);
Thread.sleep(500);
checkContainsAndAcknowledge(msg, receiver1, sub1);
@@ -1178,7 +1181,7 @@
msg = CoreMessageFactory.createCoreMessage(2, persistentMessage, null);
ref = ms.reference(msg);
- routed = office2.route(ref, "topic", null);
+ routed = office2.route(ref, new SimpleCondition("topic"), null);
assertTrue(routed);
Thread.sleep(500);
this.checkEmpty(receiver1);
@@ -1187,7 +1190,7 @@
msg = CoreMessageFactory.createCoreMessage(3, persistentMessage, null);
ref = ms.reference(msg);
- routed = office3.route(ref, "topic", null);
+ routed = office3.route(ref, new SimpleCondition("topic"), null);
assertTrue(routed);
Thread.sleep(500);
this.checkEmpty(receiver1);
@@ -1268,13 +1271,13 @@
//Non durable 1 on node 2
LocalClusteredQueue nonDurable1 = new LocalClusteredQueue(office2, 2, "nondurable1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding1 = office2.bindClusteredQueue("topic", nonDurable1);
+ Binding binding1 = office2.bindClusteredQueue(new SimpleCondition("topic"), nonDurable1);
SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
nonDurable1.add(receiver1);
//Non durable 2 on node 2
LocalClusteredQueue nonDurable2 = new LocalClusteredQueue(office2, 2, "nondurable2", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding2 = office2.bindClusteredQueue("topic", nonDurable2);
+ Binding binding2 = office2.bindClusteredQueue(new SimpleCondition("topic"), nonDurable2);
SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
nonDurable2.add(receiver2);
@@ -1283,13 +1286,13 @@
//Non shared durable
LocalClusteredQueue nonSharedDurable1 = new LocalClusteredQueue(office3, 3, "nonshareddurable1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- Binding binding3 = office3.bindClusteredQueue("topic", nonSharedDurable1);
+ Binding binding3 = office3.bindClusteredQueue(new SimpleCondition("topic"), nonSharedDurable1);
SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
nonSharedDurable1.add(receiver3);
//Non durable
LocalClusteredQueue nonDurable3 = new LocalClusteredQueue(office3, 3, "nondurable3", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding4 = office3.bindClusteredQueue("topic", nonDurable3);
+ Binding binding4 = office3.bindClusteredQueue(new SimpleCondition("topic"), nonDurable3);
SimpleReceiver receiver4 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
nonDurable3.add(receiver4);
@@ -1298,31 +1301,31 @@
//Shared durable
LocalClusteredQueue sharedDurable1 = new LocalClusteredQueue(office4, 4, "shareddurable1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- Binding binding5 = office4.bindClusteredQueue("topic", sharedDurable1);
+ Binding binding5 = office4.bindClusteredQueue(new SimpleCondition("topic"), sharedDurable1);
SimpleReceiver receiver5 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
sharedDurable1.add(receiver5);
//Non shared durable
LocalClusteredQueue nonSharedDurable2 = new LocalClusteredQueue(office4, 4, "nonshareddurable2", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- Binding binding6 = office4.bindClusteredQueue("topic", nonSharedDurable2);
+ Binding binding6 = office4.bindClusteredQueue(new SimpleCondition("topic"), nonSharedDurable2);
SimpleReceiver receiver6 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
nonSharedDurable2.add(receiver6);
//Non durable
LocalClusteredQueue nonDurable4 = new LocalClusteredQueue(office4, 4, "nondurable4", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding7 = office4.bindClusteredQueue("topic", nonDurable4);
+ Binding binding7 = office4.bindClusteredQueue(new SimpleCondition("topic"), nonDurable4);
SimpleReceiver receiver7 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
nonDurable4.add(receiver7);
// Non durable
LocalClusteredQueue nonDurable5 = new LocalClusteredQueue(office4, 4, "nondurable5", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding8 = office4.bindClusteredQueue("topic", nonDurable5);
+ Binding binding8 = office4.bindClusteredQueue(new SimpleCondition("topic"), nonDurable5);
SimpleReceiver receiver8 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
nonDurable5.add(receiver8);
//Non durable
LocalClusteredQueue nonDurable6 = new LocalClusteredQueue(office4, 4, "nondurable6", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding9 = office4.bindClusteredQueue("topic", nonDurable6);
+ Binding binding9 = office4.bindClusteredQueue(new SimpleCondition("topic"), nonDurable6);
SimpleReceiver receiver9 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
nonDurable6.add(receiver9);
@@ -1330,32 +1333,32 @@
//=======
//Shared durable
LocalClusteredQueue sharedDurable2 = new LocalClusteredQueue(office5, 5, "shareddurable1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- Binding binding10 = office5.bindClusteredQueue("topic", sharedDurable2);
+ Binding binding10 = office5.bindClusteredQueue(new SimpleCondition("topic"), sharedDurable2);
SimpleReceiver receiver10 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
sharedDurable2.add(receiver10);
//Shared durable
LocalClusteredQueue sharedDurable3 = new LocalClusteredQueue(office5, 5, "shareddurable2", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- Binding binding11 = office5.bindClusteredQueue("topic", sharedDurable3);
+ Binding binding11 = office5.bindClusteredQueue(new SimpleCondition("topic"), sharedDurable3);
SimpleReceiver receiver11 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
sharedDurable3.add(receiver11);
// Node 6
//=========
LocalClusteredQueue sharedDurable4 = new LocalClusteredQueue(office6, 6, "shareddurable2", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- Binding binding12 = office6.bindClusteredQueue("topic", sharedDurable4);
+ Binding binding12 = office6.bindClusteredQueue(new SimpleCondition("topic"), sharedDurable4);
SimpleReceiver receiver12 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
sharedDurable4.add(receiver12);
LocalClusteredQueue nonDurable7 = new LocalClusteredQueue(office6, 6, "nondurable7", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding13 = office6.bindClusteredQueue("topic", nonDurable7);
+ Binding binding13 = office6.bindClusteredQueue(new SimpleCondition("topic"), nonDurable7);
SimpleReceiver receiver13 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
nonDurable7.add(receiver13);
//Node 7
//=======
LocalClusteredQueue sharedDurable5 = new LocalClusteredQueue(office7, 7, "shareddurable2", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- Binding binding14 = office7.bindClusteredQueue("topic", sharedDurable5);
+ Binding binding14 = office7.bindClusteredQueue(new SimpleCondition("topic"), sharedDurable5);
SimpleReceiver receiver14 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
sharedDurable5.add(receiver14);
@@ -1687,52 +1690,52 @@
Binding[] bindings = new Binding[16];
queues[0] = new LocalClusteredQueue(office1, 1, "sub1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[0] = office1.bindClusteredQueue("topic1", queues[0]);
+ bindings[0] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[0]);
queues[1] = new LocalClusteredQueue(office1, 1, "sub2", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[1] = office1.bindClusteredQueue("topic1", queues[1]);
+ bindings[1] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[1]);
queues[2] = new LocalClusteredQueue(office2, 2, "sub3", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[2] = office2.bindClusteredQueue("topic1", queues[2]);
+ bindings[2] = office2.bindClusteredQueue(new SimpleCondition("topic1"), queues[2]);
queues[3] = new LocalClusteredQueue(office2, 2, "sub4", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[3] = office2.bindClusteredQueue("topic1", queues[3]);
+ bindings[3] = office2.bindClusteredQueue(new SimpleCondition("topic1"), queues[3]);
queues[4] = new LocalClusteredQueue(office2, 2, "sub5", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- bindings[4] = office2.bindClusteredQueue("topic1", queues[4]);
+ bindings[4] = office2.bindClusteredQueue(new SimpleCondition("topic1"), queues[4]);
queues[5] = new LocalClusteredQueue(office1, 1, "sub6", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[5] = office1.bindClusteredQueue("topic1", queues[5]);
+ bindings[5] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[5]);
queues[6] = new LocalClusteredQueue(office1, 1, "sub7", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- bindings[6] = office1.bindClusteredQueue("topic1", queues[6]);
+ bindings[6] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[6]);
queues[7] = new LocalClusteredQueue(office1, 1, "sub8", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- bindings[7] = office1.bindClusteredQueue("topic1", queues[7]);
+ bindings[7] = office1.bindClusteredQueue(new SimpleCondition("topic1"), queues[7]);
queues[8] = new LocalClusteredQueue(office1, 1, "sub9", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[8] = office1.bindClusteredQueue("topic2", queues[8]);
+ bindings[8] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[8]);
queues[9] = new LocalClusteredQueue(office1, 1, "sub10", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[9] = office1.bindClusteredQueue("topic2", queues[9]);
+ bindings[9] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[9]);
queues[10] = new LocalClusteredQueue(office2, 2, "sub11", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[10] = office2.bindClusteredQueue("topic2", queues[10]);
+ bindings[10] = office2.bindClusteredQueue(new SimpleCondition("topic2"), queues[10]);
queues[11] = new LocalClusteredQueue(office2, 2, "sub12", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[11] = office2.bindClusteredQueue("topic2", queues[11]);
+ bindings[11] = office2.bindClusteredQueue(new SimpleCondition("topic2"), queues[11]);
queues[12] = new LocalClusteredQueue(office2, 2, "sub13", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- bindings[12] = office2.bindClusteredQueue("topic2", queues[12]);
+ bindings[12] = office2.bindClusteredQueue(new SimpleCondition("topic2"), queues[12]);
queues[13] = new LocalClusteredQueue(office1, 1, "sub14", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- bindings[13] = office1.bindClusteredQueue("topic2", queues[13]);
+ bindings[13] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[13]);
queues[14] = new LocalClusteredQueue(office1, 1, "sub15", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- bindings[14] = office1.bindClusteredQueue("topic2", queues[14]);
+ bindings[14] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[14]);
queues[15] = new LocalClusteredQueue(office1, 1, "sub16", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
- bindings[15] = office1.bindClusteredQueue("topic2", queues[15]);
+ bindings[15] = office1.bindClusteredQueue(new SimpleCondition("topic2"), queues[15]);
SimpleReceiver[] receivers = new SimpleReceiver[16];
@@ -1752,9 +1755,9 @@
Transaction tx = tr.createTransaction();
- boolean routed = office1.route(ref1, "topic1", tx);
+ boolean routed = office1.route(ref1, new SimpleCondition("topic1"), tx);
assertTrue(routed);
- routed = office1.route(ref2, "topic1", tx);
+ routed = office1.route(ref2, new SimpleCondition("topic1"), tx);
assertTrue(routed);
@@ -1808,9 +1811,9 @@
tx = tr.createTransaction();
- routed = office1.route(ref1, "topic1", tx);
+ routed = office1.route(ref1, new SimpleCondition("topic1"), tx);
assertTrue(routed);
- routed = office1.route(ref2, "topic1", tx);
+ routed = office1.route(ref2, new SimpleCondition("topic1"), tx);
assertTrue(routed);
//Messages are sent asych so may take some finite time to arrive
@@ -1846,9 +1849,9 @@
msg2 = CoreMessageFactory.createCoreMessage(2, persistent, null);
ref2 = ms.reference(msg2);
- routed = office1.route(ref1, "topic1", null);
+ routed = office1.route(ref1, new SimpleCondition("topic1"), null);
assertTrue(routed);
- routed = office1.route(ref2, "topic1", null);
+ routed = office1.route(ref2, new SimpleCondition("topic1"), null);
assertTrue(routed);
//Messages are sent asych so may take some finite time to arrive
@@ -1914,9 +1917,9 @@
msg2 = CoreMessageFactory.createCoreMessage(2, persistent, null);;
ref2 = ms.reference(msg2);
- routed = office1.route(ref1, "topic1", null);
+ routed = office1.route(ref1, new SimpleCondition("topic1"), null);
assertTrue(routed);
- routed = office1.route(ref2, "topic1", null);
+ routed = office1.route(ref2, new SimpleCondition("topic1"), null);
assertTrue(routed);
Thread.sleep(1000);
@@ -2005,9 +2008,9 @@
tx = tr.createTransaction();
- routed = office1.route(ref1, "topic2", tx);
+ routed = office1.route(ref1, new SimpleCondition("topic2"), tx);
assertTrue(routed);
- routed = office1.route(ref2, "topic2", tx);
+ routed = office1.route(ref2, new SimpleCondition("topic2"), tx);
assertTrue(routed);
@@ -2062,9 +2065,9 @@
tx = tr.createTransaction();
- routed = office1.route(ref1, "topic1", tx);
+ routed = office1.route(ref1, new SimpleCondition("topic1"), tx);
assertTrue(routed);
- routed = office1.route(ref2, "topic1", tx);
+ routed = office1.route(ref2, new SimpleCondition("topic1"), tx);
assertTrue(routed);
for (int i = 0; i < 16; i++)
@@ -2097,9 +2100,9 @@
msg2 = CoreMessageFactory.createCoreMessage(2, persistent, null);
ref2 = ms.reference(msg2);
- routed = office1.route(ref1, "topic2", null);
+ routed = office1.route(ref1, new SimpleCondition("topic2"), null);
assertTrue(routed);
- routed = office1.route(ref2, "topic2", null);
+ routed = office1.route(ref2, new SimpleCondition("topic2"), null);
assertTrue(routed);
Thread.sleep(1000);
@@ -2166,9 +2169,9 @@
msg2 = CoreMessageFactory.createCoreMessage(2, persistent, null);;
ref2 = ms.reference(msg2);
- routed = office1.route(ref1, "topic2", null);
+ routed = office1.route(ref1, new SimpleCondition("topic2"), null);
assertTrue(routed);
- routed = office1.route(ref2, "topic2", null);
+ routed = office1.route(ref2, new SimpleCondition("topic2"), null);
assertTrue(routed);
Thread.sleep(1000);
@@ -2300,9 +2303,12 @@
FailoverMapper mapper = new DefaultFailoverMapper();
+ ConditionFactory cf = new SimpleConditionFactory();
+
DefaultClusteredPostOffice postOffice =
new DefaultClusteredPostOffice(sc.getDataSource(), sc.getTransactionManager(),
- sc.getClusteredPostOfficeSQLProperties(), true, nodeId, "Clustered", ms, pm, tr, ff, pool,
+ sc.getClusteredPostOfficeSQLProperties(), true, nodeId,
+ "Clustered", ms, pm, tr, ff, cf, pool,
groupName,
JGroupsUtil.getControlStackProperties(),
JGroupsUtil.getDataStackProperties(),
Modified: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOfficeWithDefaultRouterTest.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOfficeWithDefaultRouterTest.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOfficeWithDefaultRouterTest.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -21,10 +21,11 @@
*/
package org.jboss.test.messaging.core.plugin.postoffice.cluster;
-import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
import java.util.List;
+
import org.jboss.messaging.core.FilterFactory;
import org.jboss.messaging.core.plugin.contract.ClusteredPostOffice;
+import org.jboss.messaging.core.plugin.contract.ConditionFactory;
import org.jboss.messaging.core.plugin.contract.FailoverMapper;
import org.jboss.messaging.core.plugin.postoffice.Binding;
import org.jboss.messaging.core.plugin.postoffice.cluster.ClusterRouterFactory;
@@ -34,10 +35,14 @@
import org.jboss.messaging.core.plugin.postoffice.cluster.LocalClusteredQueue;
import org.jboss.messaging.core.plugin.postoffice.cluster.MessagePullPolicy;
import org.jboss.messaging.core.plugin.postoffice.cluster.NullMessagePullPolicy;
+import org.jboss.test.messaging.core.SimpleCondition;
+import org.jboss.test.messaging.core.SimpleConditionFactory;
import org.jboss.test.messaging.core.SimpleFilterFactory;
import org.jboss.test.messaging.core.SimpleReceiver;
import org.jboss.test.messaging.core.plugin.base.PostOfficeTestBase;
+import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
+
/**
*
* A DefaultClusteredPostOfficeWithDefaultRouterTest
@@ -124,27 +129,27 @@
office6 = createClusteredPostOffice(6, "testgroup");
LocalClusteredQueue queue1 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding1 = office2.bindClusteredQueue("topic", queue1);
+ Binding binding1 = office2.bindClusteredQueue(new SimpleCondition("topic"), queue1);
SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue1.add(receiver1);
LocalClusteredQueue queue2 = new LocalClusteredQueue(office3, 3, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding2 = office3.bindClusteredQueue("topic", queue2);
+ Binding binding2 = office3.bindClusteredQueue(new SimpleCondition("topic"), queue2);
SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue2.add(receiver2);
LocalClusteredQueue queue3 = new LocalClusteredQueue(office4, 4, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding3 = office4.bindClusteredQueue("topic", queue3);
+ Binding binding3 = office4.bindClusteredQueue(new SimpleCondition("topic"), queue3);
SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue3.add(receiver3);
LocalClusteredQueue queue4 = new LocalClusteredQueue(office5, 5, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding4 = office5.bindClusteredQueue("topic", queue4);
+ Binding binding4 = office5.bindClusteredQueue(new SimpleCondition("topic"), queue4);
SimpleReceiver receiver4 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue4.add(receiver4);
LocalClusteredQueue queue5 = new LocalClusteredQueue(office6, 6, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding5 = office6.bindClusteredQueue("topic", queue5);
+ Binding binding5 = office6.bindClusteredQueue(new SimpleCondition("topic"), queue5);
SimpleReceiver receiver5 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue5.add(receiver5);
@@ -265,27 +270,27 @@
office6 = createClusteredPostOffice(6, "testgroup");
LocalClusteredQueue queue1 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding1 = office2.bindClusteredQueue("topic", queue1);
+ Binding binding1 = office2.bindClusteredQueue(new SimpleCondition("topic"), queue1);
SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue1.add(receiver1);
LocalClusteredQueue queue2 = new LocalClusteredQueue(office3, 3, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding2 = office3.bindClusteredQueue("topic", queue2);
+ Binding binding2 = office3.bindClusteredQueue(new SimpleCondition("topic"), queue2);
SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue2.add(receiver2);
LocalClusteredQueue queue3 = new LocalClusteredQueue(office4, 4, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding3 = office4.bindClusteredQueue("topic", queue3);
+ Binding binding3 = office4.bindClusteredQueue(new SimpleCondition("topic"), queue3);
SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue3.add(receiver3);
LocalClusteredQueue queue4 = new LocalClusteredQueue(office5, 5, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding4 = office5.bindClusteredQueue("topic", queue4);
+ Binding binding4 = office5.bindClusteredQueue(new SimpleCondition("topic"), queue4);
SimpleReceiver receiver4 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue4.add(receiver4);
LocalClusteredQueue queue5 = new LocalClusteredQueue(office6, 6, "queue1", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
- Binding binding5 = office6.bindClusteredQueue("topic", queue5);
+ Binding binding5 = office6.bindClusteredQueue(new SimpleCondition("topic"), queue5);
SimpleReceiver receiver5 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue5.add(receiver5);
@@ -380,9 +385,12 @@
FailoverMapper mapper = new DefaultFailoverMapper();
+ ConditionFactory cf = new SimpleConditionFactory();
+
DefaultClusteredPostOffice postOffice =
new DefaultClusteredPostOffice(sc.getDataSource(), sc.getTransactionManager(),
- sc.getClusteredPostOfficeSQLProperties(), true, nodeId, "Clustered", ms, pm, tr, ff, pool,
+ sc.getClusteredPostOfficeSQLProperties(), true, nodeId,
+ "Clustered", ms, pm, tr, ff, cf, pool,
groupName,
JGroupsUtil.getControlStackProperties(),
JGroupsUtil.getDataStackProperties(),
Modified: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultRouterTest.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultRouterTest.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultRouterTest.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -34,6 +34,7 @@
import org.jboss.messaging.core.Receiver;
import org.jboss.messaging.core.SimpleDelivery;
import org.jboss.messaging.core.plugin.contract.ClusteredPostOffice;
+import org.jboss.messaging.core.plugin.contract.ConditionFactory;
import org.jboss.messaging.core.plugin.contract.FailoverMapper;
import org.jboss.messaging.core.plugin.postoffice.cluster.ClusterRouter;
import org.jboss.messaging.core.plugin.postoffice.cluster.ClusterRouterFactory;
@@ -46,6 +47,7 @@
import org.jboss.messaging.core.plugin.postoffice.cluster.NullMessagePullPolicy;
import org.jboss.messaging.core.plugin.postoffice.cluster.QueueStats;
import org.jboss.messaging.core.tx.Transaction;
+import org.jboss.test.messaging.core.SimpleConditionFactory;
import org.jboss.test.messaging.core.SimpleFilterFactory;
import org.jboss.test.messaging.core.SimpleReceiver;
import org.jboss.test.messaging.core.plugin.base.PostOfficeTestBase;
@@ -356,9 +358,12 @@
FailoverMapper mapper = new DefaultFailoverMapper();
+ ConditionFactory cf = new SimpleConditionFactory();
+
DefaultClusteredPostOffice postOffice =
new DefaultClusteredPostOffice(sc.getDataSource(), sc.getTransactionManager(),
- sc.getClusteredPostOfficeSQLProperties(), true, nodeId, "Clustered", ms, pm, tr, ff, pool,
+ sc.getClusteredPostOfficeSQLProperties(), true, nodeId,
+ "Clustered", ms, pm, tr, ff, cf, pool,
groupName,
JGroupsUtil.getControlStackProperties(),
JGroupsUtil.getDataStackProperties(),
Modified: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RecoveryTest.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RecoveryTest.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RecoveryTest.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -21,12 +21,13 @@
*/
package org.jboss.test.messaging.core.plugin.postoffice.cluster;
-import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
import java.util.List;
+
import org.jboss.messaging.core.FilterFactory;
import org.jboss.messaging.core.Message;
import org.jboss.messaging.core.MessageReference;
import org.jboss.messaging.core.plugin.contract.ClusteredPostOffice;
+import org.jboss.messaging.core.plugin.contract.ConditionFactory;
import org.jboss.messaging.core.plugin.contract.FailoverMapper;
import org.jboss.messaging.core.plugin.postoffice.Binding;
import org.jboss.messaging.core.plugin.postoffice.cluster.ClusterRouterFactory;
@@ -38,11 +39,15 @@
import org.jboss.messaging.core.plugin.postoffice.cluster.NullMessagePullPolicy;
import org.jboss.messaging.core.tx.Transaction;
import org.jboss.messaging.core.tx.TransactionException;
+import org.jboss.test.messaging.core.SimpleCondition;
+import org.jboss.test.messaging.core.SimpleConditionFactory;
import org.jboss.test.messaging.core.SimpleFilterFactory;
import org.jboss.test.messaging.core.SimpleReceiver;
import org.jboss.test.messaging.core.plugin.base.PostOfficeTestBase;
import org.jboss.test.messaging.util.CoreMessageFactory;
+import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
+
/**
*
* A RecoveryTest
@@ -98,15 +103,15 @@
LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 =
- office1.bindClusteredQueue("topic1", queue1);
+ office1.bindClusteredQueue(new SimpleCondition("topic1"), queue1);
LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue2", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 =
- office2.bindClusteredQueue("topic1", queue2);
+ office2.bindClusteredQueue(new SimpleCondition("topic1"), queue2);
LocalClusteredQueue queue3 = new LocalClusteredQueue(office3, 3, "queue3", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding3 =
- office3.bindClusteredQueue("topic1", queue3);
+ office3.bindClusteredQueue(new SimpleCondition("topic1"), queue3);
SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue1.add(receiver1);
@@ -129,7 +134,7 @@
MessageReference ref = ms.reference(msg);
- office1.route(ref, "topic1", tx);
+ office1.route(ref, new SimpleCondition("topic1"), tx);
}
Thread.sleep(1000);
@@ -233,15 +238,15 @@
LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 =
- office1.bindClusteredQueue("topic1", queue1);
+ office1.bindClusteredQueue(new SimpleCondition("topic1"), queue1);
LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue2", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 =
- office2.bindClusteredQueue("topic1", queue2);
+ office2.bindClusteredQueue(new SimpleCondition("topic1"), queue2);
LocalClusteredQueue queue3 = new LocalClusteredQueue(office3, 3, "queue3", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding3 =
- office3.bindClusteredQueue("topic1", queue3);
+ office3.bindClusteredQueue(new SimpleCondition("topic1"), queue3);
SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
queue1.add(receiver1);
@@ -264,7 +269,7 @@
MessageReference ref = ms.reference(msg);
- office1.route(ref, "topic1", tx);
+ office1.route(ref, new SimpleCondition("topic1"), tx);
}
Thread.sleep(1000);
@@ -357,9 +362,12 @@
FailoverMapper mapper = new DefaultFailoverMapper();
+ ConditionFactory cf = new SimpleConditionFactory();
+
DefaultClusteredPostOffice postOffice =
new DefaultClusteredPostOffice(sc.getDataSource(), sc.getTransactionManager(),
- sc.getClusteredPostOfficeSQLProperties(), true, nodeId, "Clustered", ms, pm, tr, ff, pool,
+ sc.getClusteredPostOfficeSQLProperties(), true, nodeId, "Clustered",
+ ms, pm, tr, ff, cf, pool,
groupName,
JGroupsUtil.getControlStackProperties(),
JGroupsUtil.getDataStackProperties(),
Modified: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RedistributionWithDefaultMessagePullPolicyTest.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RedistributionWithDefaultMessagePullPolicyTest.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RedistributionWithDefaultMessagePullPolicyTest.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -21,11 +21,10 @@
*/
package org.jboss.test.messaging.core.plugin.postoffice.cluster;
-import EDU.oswego.cs.dl.util.concurrent.Executor;
-import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+
import org.jboss.messaging.core.Channel;
import org.jboss.messaging.core.Delivery;
import org.jboss.messaging.core.DeliveryObserver;
@@ -35,6 +34,7 @@
import org.jboss.messaging.core.Receiver;
import org.jboss.messaging.core.SimpleDelivery;
import org.jboss.messaging.core.plugin.contract.ClusteredPostOffice;
+import org.jboss.messaging.core.plugin.contract.ConditionFactory;
import org.jboss.messaging.core.plugin.contract.FailoverMapper;
import org.jboss.messaging.core.plugin.postoffice.Binding;
import org.jboss.messaging.core.plugin.postoffice.cluster.ClusterRouterFactory;
@@ -45,11 +45,16 @@
import org.jboss.messaging.core.plugin.postoffice.cluster.LocalClusteredQueue;
import org.jboss.messaging.core.plugin.postoffice.cluster.MessagePullPolicy;
import org.jboss.messaging.core.tx.Transaction;
+import org.jboss.test.messaging.core.SimpleCondition;
+import org.jboss.test.messaging.core.SimpleConditionFactory;
import org.jboss.test.messaging.core.SimpleFilterFactory;
import org.jboss.test.messaging.core.SimpleReceiver;
import org.jboss.test.messaging.core.plugin.base.PostOfficeTestBase;
import org.jboss.test.messaging.util.CoreMessageFactory;
+import EDU.oswego.cs.dl.util.concurrent.Executor;
+import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
+
/**
*
* A RedistributionWithDefaultMessagePullPolicyTest
@@ -141,18 +146,18 @@
LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 =
- office1.bindClusteredQueue("queue1", queue1);
+ office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);
LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 =
- office2.bindClusteredQueue("queue1", queue2);
+ office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);
Message msg = CoreMessageFactory.createCoreMessage(1);
msg.setReliable(true);
MessageReference ref = ms.reference(msg);
- office1.route(ref, "queue1", null);
+ office1.route(ref, new SimpleCondition("queue1"), null);
Thread.sleep(2000);
@@ -235,18 +240,18 @@
LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 =
- office1.bindClusteredQueue("queue1", queue1);
+ office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);
LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 =
- office2.bindClusteredQueue("queue1", queue2);
+ office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);
Message msg = CoreMessageFactory.createCoreMessage(1);
msg.setReliable(true);
MessageReference ref = ms.reference(msg);
- office1.route(ref, "queue1", null);
+ office1.route(ref, new SimpleCondition("queue1"), null);
Thread.sleep(2000);
@@ -335,18 +340,18 @@
LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 =
- office1.bindClusteredQueue("queue1", queue1);
+ office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);
LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 =
- office2.bindClusteredQueue("queue1", queue2);
+ office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);
Message msg = CoreMessageFactory.createCoreMessage(1);
msg.setReliable(true);
MessageReference ref = ms.reference(msg);
- office1.route(ref, "queue1", null);
+ office1.route(ref, new SimpleCondition("queue1"), null);
Thread.sleep(2000);
@@ -431,18 +436,18 @@
LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding1 =
- office1.bindClusteredQueue("queue1", queue1);
+ office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);
LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);
Binding binding2 =
- office2.bindClusteredQueue("queue1", queue2);
+ office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);
Message msg = CoreMessageFactory.createCoreMessage(1);
msg.setReliable(true);
MessageReference ref = ms.reference(msg);
- office1.route(ref, "queue1", null);
+ office1.route(ref, new SimpleCondition("queue1"), null);
Thread.sleep(2000);
@@ -529,19 +534,19 @@
office5 = (DefaultClusteredPostOffice)createClusteredPostOffice(5, "testgroup");
LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
- Binding binding1 = office1.bindClusteredQueue("queue1", queue1);
+ Binding binding1 = office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);
LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
- Binding binding2 = office2.bindClusteredQueue("queue1", queue2);
+ Binding binding2 = office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);
LocalClusteredQueue queue3 = new LocalClusteredQueue(office3, 3, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
- Binding binding3 = office3.bindClusteredQueue("queue1", queue3);
+ Binding binding3 = office3.bindClusteredQueue(new SimpleCondition("queue1"), queue3);
LocalClusteredQueue queue4 = new LocalClusteredQueue(office4, 4, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
- Binding binding4 = office4.bindClusteredQueue("queue1", queue4);
+ Binding binding4 = office4.bindClusteredQueue(new SimpleCondition("queue1"), queue4);
LocalClusteredQueue queue5 = new LocalClusteredQueue(office5, 5, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
- Binding binding5 = office5.bindClusteredQueue("queue1", queue5);
+ Binding binding5 = office5.bindClusteredQueue(new SimpleCondition("queue1"), queue5);
final int NUM_MESSAGES = 100;
@@ -689,19 +694,19 @@
office5 = (DefaultClusteredPostOffice)createClusteredPostOffice(5, "testgroup");
LocalClusteredQueue queue1 = new LocalClusteredQueue(office1, 1, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
- Binding binding1 = office1.bindClusteredQueue("queue1", queue1);
+ Binding binding1 = office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);
LocalClusteredQueue queue2 = new LocalClusteredQueue(office2, 2, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
- Binding binding2 = office2.bindClusteredQueue("queue1", queue2);
+ Binding binding2 = office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);
LocalClusteredQueue queue3 = new LocalClusteredQueue(office3, 3, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
- Binding binding3 = office3.bindClusteredQueue("queue1", queue3);
+ Binding binding3 = office3.bindClusteredQueue(new SimpleCondition("queue1"), queue3);
LocalClusteredQueue queue4 = new LocalClusteredQueue(office4, 4, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
- Binding binding4 = office4.bindClusteredQueue("queue1", queue4);
+ Binding binding4 = office4.bindClusteredQueue(new SimpleCondition("queue1"), queue4);
LocalClusteredQueue queue5 = new LocalClusteredQueue(office5, 5, "queue1", channelIdManager.getId(), ms, pm, true, recoverable, (QueuedExecutor)pool.get(), null, tr);
- Binding binding5 = office5.bindClusteredQueue("queue1", queue5);
+ Binding binding5 = office5.bindClusteredQueue(new SimpleCondition("queue1"), queue5);
final int NUM_MESSAGES = 100;
@@ -1148,9 +1153,12 @@
FailoverMapper mapper = new DefaultFailoverMapper();
+ ConditionFactory cf = new SimpleConditionFactory();
+
DefaultClusteredPostOffice postOffice =
new DefaultClusteredPostOffice(sc.getDataSource(), sc.getTransactionManager(),
- sc.getClusteredPostOfficeSQLProperties(), true, nodeId, "Clustered", ms, pm, tr, ff, pool,
+ sc.getClusteredPostOfficeSQLProperties(), true, nodeId,
+ "Clustered", ms, pm, tr, ff, cf, pool,
groupName,
JGroupsUtil.getControlStackProperties(),
JGroupsUtil.getDataStackProperties(),
Modified: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/jms/DurableSubscriberTest.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/jms/DurableSubscriberTest.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/jms/DurableSubscriberTest.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -133,12 +133,15 @@
conn.start();
- TextMessage tm = (TextMessage)durable.receive();
+ TextMessage tm = (TextMessage)durable.receive(1000);
assertEquals("k", tm.getText());
Message m = durable.receive(1000);
assertNull(m);
+
+ conn.close();
}
+
/**
* JMS 1.1 6.11.1: A client can change an existing durable subscription by creating a durable
@@ -184,6 +187,8 @@
ServerManagement.undeployTopic("CompletelyNewTopic");
ServerManagement.undeployTopic("CompletelyNewTopic2");
+
+ conn.close();
}
/**
@@ -258,6 +263,8 @@
assertNull(m);
ServerManagement.undeployTopic("CompletelyNewTopic2");
+
+ conn.close();
}
/**
@@ -462,6 +469,8 @@
{
// OK
}
+
+ c.close();
}
Modified: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/jms/clustering/HATest.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/jms/clustering/HATest.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/jms/clustering/HATest.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -36,6 +36,7 @@
import org.jboss.jms.client.delegate.ClientConnectionDelegate;
import org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate;
import org.jboss.jms.client.delegate.ClusteredClientConnectionFactoryDelegate;
+import org.jboss.jms.client.delegate.DelegateSupport;
import org.jboss.jms.client.state.ConnectionState;
import org.jboss.jms.message.MessageProxy;
import org.jboss.test.messaging.jms.clustering.base.ClusteringTestBase;
@@ -74,349 +75,348 @@
* Test that connections created using a clustered connection factory are created round robin on
* different servers
*/
-// public void testRoundRobinConnectionCreation() throws Exception
-// {
-// JBossConnectionFactory factory = (JBossConnectionFactory )ic0.lookup("/ConnectionFactory");
-//
-// ClusteredClientConnectionFactoryDelegate delegate =
-// (ClusteredClientConnectionFactoryDelegate)factory.getDelegate();
-//
-// log.info ("number of delegates = " + delegate.getDelegates().length);
-// log.info ("number of servers = " + ServerManagement.getServer(0).getNumberOfNodesOnCluster());
-//
-// assertEquals(3, delegate.getDelegates().length);
-//
-// ClientConnectionFactoryDelegate cf1 = delegate.getDelegates()[0];
-//
-// ClientConnectionFactoryDelegate cf2 = delegate.getDelegates()[1];
-//
-// ClientConnectionFactoryDelegate cf3 = delegate.getDelegates()[2];
-//
-// assertEquals(0, cf1.getServerId());
-//
-// assertEquals(1, cf2.getServerId());
-//
-// assertEquals(2, cf3.getServerId());
-//
-// assertEquals(3, ServerManagement.getServer(0).getNumberOfNodesOnCluster());
-//
-// Connection conn1 = null;
-//
-// Connection conn2 = null;
-//
-// Connection conn3 = null;
-//
-// Connection conn4 = null;
-//
-// Connection conn5 = null;
-//
-// try
-// {
-// conn1 = factory.createConnection();
-//
-// conn2 = factory.createConnection();
-//
-// conn3 = factory.createConnection();
-//
-// conn4 = factory.createConnection();
-//
-// conn5 = factory.createConnection();
-//
-// ConnectionState state1 = (ConnectionState)(((DelegateSupport)((JBossConnection)conn1).getDelegate()).getState());
-//
-// ConnectionState state2 = (ConnectionState)(((DelegateSupport)((JBossConnection)conn2).getDelegate()).getState());
-//
-// ConnectionState state3 = (ConnectionState)(((DelegateSupport)((JBossConnection)conn3).getDelegate()).getState());
-//
-// ConnectionState state4 = (ConnectionState)(((DelegateSupport)((JBossConnection)conn4).getDelegate()).getState());
-//
-// ConnectionState state5 = (ConnectionState)(((DelegateSupport)((JBossConnection)conn5).getDelegate()).getState());
-//
-// int serverID1 = state1.getServerID();
-//
-// int serverID2 = state2.getServerID();
-//
-// int serverID3 = state3.getServerID();
-//
-// int serverID4 = state4.getServerID();
-//
-// int serverID5 = state5.getServerID();
-//
-// log.info("server id 1: " + serverID1);
-//
-// log.info("server id 2: " + serverID2);
-//
-// log.info("server id 3: " + serverID3);
-//
-// log.info("server id 4: " + serverID4);
-//
-// log.info("server id 5: " + serverID5);
-//
-// assertEquals(0, serverID1);
-//
-// assertEquals(1, serverID2);
-//
-// assertEquals(2, serverID3);
-//
-// assertEquals(0, serverID4);
-//
-// assertEquals(1, serverID5);
-// }
-// finally
-// {
-// if (conn1 != null)
-// {
-// conn1.close();
-// }
-//
-// if (conn2 != null)
-// {
-// conn2.close();
-// }
-//
-// if (conn3 != null)
-// {
-// conn3.close();
-// }
-//
-// if (conn4 != null)
-// {
-// conn4.close();
-// }
-//
-// if (conn5 != null)
-// {
-// conn5.close();
-// }
-// }
-//
-// }
-//
-// /*
-// * Test that the failover mapping is created correctly and updated properly when nodes leave
-// * or join
-// */
-// public void testDefaultFailoverMap() throws Exception
-// {
-// {
-// JBossConnectionFactory factory = (JBossConnectionFactory )ic0.lookup("/ConnectionFactory");
-//
-// ClusteredClientConnectionFactoryDelegate delegate =
-// (ClusteredClientConnectionFactoryDelegate)factory.getDelegate();
-//
-// assertEquals(3, ServerManagement.getServer(0).getNumberOfNodesOnCluster());
-//
-// ClientConnectionFactoryDelegate[] delegates = delegate.getDelegates();
-//
-// ClientConnectionFactoryDelegate cf1 = delegate.getDelegates()[0];
-//
-// ClientConnectionFactoryDelegate cf2 = delegate.getDelegates()[1];
-//
-// ClientConnectionFactoryDelegate cf3 = delegate.getDelegates()[2];
-//
-// //The order here depends on the order the servers were started in
-//
-// //If any servers get stopped and then started then the order will change
-//
-// log.info("cf1 serverid=" + cf1.getServerId());
-//
-// log.info("cf2 serverid=" + cf2.getServerId());
-//
-// log.info("cf3 serverid=" + cf3.getServerId());
-//
-//
-// assertEquals(0, cf1.getServerId());
-//
-// assertEquals(1, cf2.getServerId());
-//
-// assertEquals(2, cf3.getServerId());
-//
-// Map failoverMap = delegate.getFailoverMap();
-//
-// assertEquals(3, delegates.length);
-//
-// assertEquals(3, failoverMap.size());
-//
-// // Default failover policy just chooses the node to the right
-//
-// assertEquals(cf2.getServerId(), ((Integer)failoverMap.get(new Integer(cf1.getServerId()))).intValue());
-//
-// assertEquals(cf3.getServerId(), ((Integer)failoverMap.get(new Integer(cf2.getServerId()))).intValue());
-//
-// assertEquals(cf1.getServerId(), ((Integer)failoverMap.get(new Integer(cf3.getServerId()))).intValue());
-// }
-//
-// //Now cleanly stop one of the servers
-//
-//
-// log.info("************** STOPPING SERVER 0");
-// ServerManagement.stop(0, true);
-//
-// log.info("server stopped");
-//
-// assertEquals(2, ServerManagement.getServer(1).getNumberOfNodesOnCluster());
-//
-// {
-// //Lookup another connection factory
-//
-// JBossConnectionFactory factory = (JBossConnectionFactory )ic1.lookup("/ConnectionFactory");
-//
-// log.info("Got connection factory");
-//
-// ClusteredClientConnectionFactoryDelegate delegate =
-// (ClusteredClientConnectionFactoryDelegate)factory.getDelegate();
-//
-// ClientConnectionFactoryDelegate[] delegates = delegate.getDelegates();
-//
-// Map failoverMap = delegate.getFailoverMap();
-//
-// log.info("Got failover map");
-//
-// assertEquals(2, delegates.length);
-//
-// ClientConnectionFactoryDelegate cf1 = delegate.getDelegates()[0];
-//
-// ClientConnectionFactoryDelegate cf2 = delegate.getDelegates()[1];
-//
-// //Order here depends on order servers were started in
-//
-// log.info("cf1 serverid=" + cf1.getServerId());
-//
-// log.info("cf2 serverid=" + cf2.getServerId());
-//
-// assertEquals(1, cf1.getServerId());
-//
-// assertEquals(2, cf2.getServerId());
-//
-//
-// assertEquals(2, failoverMap.size());
-//
-// assertEquals(cf2.getServerId(), ((Integer)failoverMap.get(new Integer(cf1.getServerId()))).intValue());
-//
-// assertEquals(cf1.getServerId(), ((Integer)failoverMap.get(new Integer(cf2.getServerId()))).intValue());
-// }
-//
-// //Cleanly stop another server
-//
-// log.info("Server 1 is started: " + ServerManagement.getServer(1).isServerPeerStarted());
-//
-// ServerManagement.stop(1, true);
-//
-// assertEquals(1, ServerManagement.getServer(2).getNumberOfNodesOnCluster());
-//
-// {
-// //Lookup another connection factory
-//
-// JBossConnectionFactory factory = (JBossConnectionFactory )ic2.lookup("/ConnectionFactory");
-//
-// ClusteredClientConnectionFactoryDelegate delegate =
-// (ClusteredClientConnectionFactoryDelegate)factory.getDelegate();
-//
-// ClientConnectionFactoryDelegate[] delegates = delegate.getDelegates();
-//
-// Map failoverMap = delegate.getFailoverMap();
-//
-// assertEquals(1, delegates.length);
-//
-// ClientConnectionFactoryDelegate cf1 = delegate.getDelegates()[0];
-//
-// assertEquals(2, cf1.getServerId());
-//
-//
-// assertEquals(1, failoverMap.size());
-//
-// assertEquals(cf1.getServerId(), ((Integer)failoverMap.get(new Integer(cf1.getServerId()))).intValue());
-// }
-//
-// //Restart server 0
-//
-// ServerManagement.start("all", 0);
-//
-// {
-// JBossConnectionFactory factory = (JBossConnectionFactory )ic0.lookup("/ConnectionFactory");
-//
-// log.info("Got connection factory");
-//
-// ClusteredClientConnectionFactoryDelegate delegate =
-// (ClusteredClientConnectionFactoryDelegate)factory.getDelegate();
-//
-// ClientConnectionFactoryDelegate[] delegates = delegate.getDelegates();
-//
-// Map failoverMap = delegate.getFailoverMap();
-//
-// log.info("Got failover map");
-//
-// assertEquals(2, delegates.length);
-//
-// ClientConnectionFactoryDelegate cf1 = delegate.getDelegates()[0];
-//
-// ClientConnectionFactoryDelegate cf2 = delegate.getDelegates()[1];
-//
-// log.info("cf1 serverid=" + cf1.getServerId());
-//
-// log.info("cf2 serverid=" + cf2.getServerId());
-//
-// assertEquals(2, cf1.getServerId());
-//
-// assertEquals(0, cf2.getServerId());
-//
-//
-// assertEquals(2, failoverMap.size());
-//
-// assertEquals(cf2.getServerId(), ((Integer)failoverMap.get(new Integer(cf1.getServerId()))).intValue());
-//
-// assertEquals(cf1.getServerId(), ((Integer)failoverMap.get(new Integer(cf2.getServerId()))).intValue());
-// }
-//
-//
-// //Restart server 1
-//
-// ServerManagement.start("all", 1);
-//
-// {
-// JBossConnectionFactory factory = (JBossConnectionFactory )ic1.lookup("/ConnectionFactory");
-//
-// log.info("Got connection factory");
-//
-// ClusteredClientConnectionFactoryDelegate delegate =
-// (ClusteredClientConnectionFactoryDelegate)factory.getDelegate();
-//
-// ClientConnectionFactoryDelegate[] delegates = delegate.getDelegates();
-//
-// Map failoverMap = delegate.getFailoverMap();
-//
-// log.info("Got failover map");
-//
-// assertEquals(3, delegates.length);
-//
-// ClientConnectionFactoryDelegate cf1 = delegate.getDelegates()[0];
-//
-// ClientConnectionFactoryDelegate cf2 = delegate.getDelegates()[1];
-//
-// ClientConnectionFactoryDelegate cf3 = delegate.getDelegates()[2];
-//
-// log.info("cf1 serverid=" + cf1.getServerId());
-//
-// log.info("cf2 serverid=" + cf2.getServerId());
-//
-// log.info("cf3 serverid=" + cf3.getServerId());
-//
-// assertEquals(2, cf1.getServerId());
-//
-// assertEquals(0, cf2.getServerId());
-//
-// assertEquals(1, cf3.getServerId());
-//
-//
-// assertEquals(3, failoverMap.size());
-//
-// assertEquals(cf2.getServerId(), ((Integer)failoverMap.get(new Integer(cf1.getServerId()))).intValue());
-//
-// assertEquals(cf3.getServerId(), ((Integer)failoverMap.get(new Integer(cf2.getServerId()))).intValue());
-//
-// assertEquals(cf1.getServerId(), ((Integer)failoverMap.get(new Integer(cf3.getServerId()))).intValue());
-// }
-// }
+ public void testRoundRobinConnectionCreation() throws Exception
+ {
+ JBossConnectionFactory factory = (JBossConnectionFactory )ic0.lookup("/ConnectionFactory");
+
+ ClusteredClientConnectionFactoryDelegate delegate =
+ (ClusteredClientConnectionFactoryDelegate)factory.getDelegate();
+
+ log.info ("number of delegates = " + delegate.getDelegates().length);
+ log.info ("number of servers = " + ServerManagement.getServer(0).getNodeIDView().size());
+
+ assertEquals(3, delegate.getDelegates().length);
+
+ ClientConnectionFactoryDelegate cf1 = delegate.getDelegates()[0];
+
+ ClientConnectionFactoryDelegate cf2 = delegate.getDelegates()[1];
+
+ ClientConnectionFactoryDelegate cf3 = delegate.getDelegates()[2];
+
+ assertEquals(0, cf1.getServerId());
+
+ assertEquals(1, cf2.getServerId());
+
+ assertEquals(2, cf3.getServerId());
+
+ assertEquals(3, ServerManagement.getServer(0).getNodeIDView().size());
+
+ Connection conn1 = null;
+
+ Connection conn2 = null;
+
+ Connection conn3 = null;
+
+ Connection conn4 = null;
+
+ Connection conn5 = null;
+
+ try
+ {
+ conn1 = factory.createConnection();
+
+ conn2 = factory.createConnection();
+
+ conn3 = factory.createConnection();
+
+ conn4 = factory.createConnection();
+
+ conn5 = factory.createConnection();
+
+ ConnectionState state1 = (ConnectionState)(((DelegateSupport)((JBossConnection)conn1).getDelegate()).getState());
+
+ ConnectionState state2 = (ConnectionState)(((DelegateSupport)((JBossConnection)conn2).getDelegate()).getState());
+
+ ConnectionState state3 = (ConnectionState)(((DelegateSupport)((JBossConnection)conn3).getDelegate()).getState());
+
+ ConnectionState state4 = (ConnectionState)(((DelegateSupport)((JBossConnection)conn4).getDelegate()).getState());
+
+ ConnectionState state5 = (ConnectionState)(((DelegateSupport)((JBossConnection)conn5).getDelegate()).getState());
+
+ int serverID1 = state1.getServerID();
+
+ int serverID2 = state2.getServerID();
+
+ int serverID3 = state3.getServerID();
+
+ int serverID4 = state4.getServerID();
+
+ int serverID5 = state5.getServerID();
+
+ log.info("server id 1: " + serverID1);
+
+ log.info("server id 2: " + serverID2);
+
+ log.info("server id 3: " + serverID3);
+
+ log.info("server id 4: " + serverID4);
+
+ log.info("server id 5: " + serverID5);
+
+ assertEquals(0, serverID1);
+
+ assertEquals(1, serverID2);
+
+ assertEquals(2, serverID3);
+
+ assertEquals(0, serverID4);
+
+ assertEquals(1, serverID5);
+ }
+ finally
+ {
+ if (conn1 != null)
+ {
+ conn1.close();
+ }
+
+ if (conn2 != null)
+ {
+ conn2.close();
+ }
+
+ if (conn3 != null)
+ {
+ conn3.close();
+ }
+
+ if (conn4 != null)
+ {
+ conn4.close();
+ }
+
+ if (conn5 != null)
+ {
+ conn5.close();
+ }
+ }
+
+ }
+
+ /*
+ * Test that the failover mapping is created correctly and updated properly when nodes leave
+ * or join
+ */
+ public void testDefaultFailoverMap() throws Exception
+ {
+ {
+ JBossConnectionFactory factory = (JBossConnectionFactory )ic0.lookup("/ConnectionFactory");
+
+ ClusteredClientConnectionFactoryDelegate delegate =
+ (ClusteredClientConnectionFactoryDelegate)factory.getDelegate();
+
+ assertEquals(3, ServerManagement.getServer(0).getNodeIDView().size());
+
+ ClientConnectionFactoryDelegate[] delegates = delegate.getDelegates();
+
+ ClientConnectionFactoryDelegate cf1 = delegate.getDelegates()[0];
+
+ ClientConnectionFactoryDelegate cf2 = delegate.getDelegates()[1];
+
+ ClientConnectionFactoryDelegate cf3 = delegate.getDelegates()[2];
+
+ //The order here depends on the order the servers were started in
+
+ //If any servers get stopped and then started then the order will change
+
+ log.info("cf1 serverid=" + cf1.getServerId());
+
+ log.info("cf2 serverid=" + cf2.getServerId());
+
+ log.info("cf3 serverid=" + cf3.getServerId());
+
+
+ assertEquals(0, cf1.getServerId());
+
+ assertEquals(1, cf2.getServerId());
+
+ assertEquals(2, cf3.getServerId());
+
+ Map failoverMap = delegate.getFailoverMap();
+
+ assertEquals(3, delegates.length);
+
+ assertEquals(3, failoverMap.size());
+
+ // Default failover policy just chooses the node to the right
+
+ assertEquals(cf2.getServerId(), ((Integer)failoverMap.get(new Integer(cf1.getServerId()))).intValue());
+
+ assertEquals(cf3.getServerId(), ((Integer)failoverMap.get(new Integer(cf2.getServerId()))).intValue());
+
+ assertEquals(cf1.getServerId(), ((Integer)failoverMap.get(new Integer(cf3.getServerId()))).intValue());
+ }
+
+ //Now cleanly stop one of the servers
+
+ log.info("************** STOPPING SERVER 0");
+ ServerManagement.stop(0);
+
+ log.info("server stopped");
+
+ assertEquals(2, ServerManagement.getServer(1).getNodeIDView().size());
+
+ {
+ //Lookup another connection factory
+
+ JBossConnectionFactory factory = (JBossConnectionFactory )ic1.lookup("/ConnectionFactory");
+
+ log.info("Got connection factory");
+
+ ClusteredClientConnectionFactoryDelegate delegate =
+ (ClusteredClientConnectionFactoryDelegate)factory.getDelegate();
+
+ ClientConnectionFactoryDelegate[] delegates = delegate.getDelegates();
+
+ Map failoverMap = delegate.getFailoverMap();
+
+ log.info("Got failover map");
+
+ assertEquals(2, delegates.length);
+
+ ClientConnectionFactoryDelegate cf1 = delegate.getDelegates()[0];
+
+ ClientConnectionFactoryDelegate cf2 = delegate.getDelegates()[1];
+
+ //Order here depends on order servers were started in
+
+ log.info("cf1 serverid=" + cf1.getServerId());
+
+ log.info("cf2 serverid=" + cf2.getServerId());
+
+ assertEquals(1, cf1.getServerId());
+
+ assertEquals(2, cf2.getServerId());
+
+
+ assertEquals(2, failoverMap.size());
+
+ assertEquals(cf2.getServerId(), ((Integer)failoverMap.get(new Integer(cf1.getServerId()))).intValue());
+
+ assertEquals(cf1.getServerId(), ((Integer)failoverMap.get(new Integer(cf2.getServerId()))).intValue());
+ }
+
+ //Cleanly stop another server
+
+ log.info("Server 1 is started: " + ServerManagement.getServer(1).isServerPeerStarted());
+
+ ServerManagement.stop(1);
+
+ assertEquals(1, ServerManagement.getServer(2).getNodeIDView().size());
+
+ {
+ //Lookup another connection factory
+
+ JBossConnectionFactory factory = (JBossConnectionFactory )ic2.lookup("/ConnectionFactory");
+
+ ClusteredClientConnectionFactoryDelegate delegate =
+ (ClusteredClientConnectionFactoryDelegate)factory.getDelegate();
+
+ ClientConnectionFactoryDelegate[] delegates = delegate.getDelegates();
+
+ Map failoverMap = delegate.getFailoverMap();
+
+ assertEquals(1, delegates.length);
+
+ ClientConnectionFactoryDelegate cf1 = delegate.getDelegates()[0];
+
+ assertEquals(2, cf1.getServerId());
+
+
+ assertEquals(1, failoverMap.size());
+
+ assertEquals(cf1.getServerId(), ((Integer)failoverMap.get(new Integer(cf1.getServerId()))).intValue());
+ }
+
+ //Restart server 0
+
+ ServerManagement.start("all", 0);
+
+ {
+ JBossConnectionFactory factory = (JBossConnectionFactory )ic0.lookup("/ConnectionFactory");
+
+ log.info("Got connection factory");
+
+ ClusteredClientConnectionFactoryDelegate delegate =
+ (ClusteredClientConnectionFactoryDelegate)factory.getDelegate();
+
+ ClientConnectionFactoryDelegate[] delegates = delegate.getDelegates();
+
+ Map failoverMap = delegate.getFailoverMap();
+
+ log.info("Got failover map");
+
+ assertEquals(2, delegates.length);
+
+ ClientConnectionFactoryDelegate cf1 = delegate.getDelegates()[0];
+
+ ClientConnectionFactoryDelegate cf2 = delegate.getDelegates()[1];
+
+ log.info("cf1 serverid=" + cf1.getServerId());
+
+ log.info("cf2 serverid=" + cf2.getServerId());
+
+ assertEquals(2, cf1.getServerId());
+
+ assertEquals(0, cf2.getServerId());
+
+
+ assertEquals(2, failoverMap.size());
+
+ assertEquals(cf2.getServerId(), ((Integer)failoverMap.get(new Integer(cf1.getServerId()))).intValue());
+
+ assertEquals(cf1.getServerId(), ((Integer)failoverMap.get(new Integer(cf2.getServerId()))).intValue());
+ }
+
+
+ //Restart server 1
+
+ ServerManagement.start("all", 1);
+
+ {
+ JBossConnectionFactory factory = (JBossConnectionFactory )ic1.lookup("/ConnectionFactory");
+
+ log.info("Got connection factory");
+
+ ClusteredClientConnectionFactoryDelegate delegate =
+ (ClusteredClientConnectionFactoryDelegate)factory.getDelegate();
+
+ ClientConnectionFactoryDelegate[] delegates = delegate.getDelegates();
+
+ Map failoverMap = delegate.getFailoverMap();
+
+ log.info("Got failover map");
+
+ assertEquals(3, delegates.length);
+
+ ClientConnectionFactoryDelegate cf1 = delegate.getDelegates()[0];
+
+ ClientConnectionFactoryDelegate cf2 = delegate.getDelegates()[1];
+
+ ClientConnectionFactoryDelegate cf3 = delegate.getDelegates()[2];
+
+ log.info("cf1 serverid=" + cf1.getServerId());
+
+ log.info("cf2 serverid=" + cf2.getServerId());
+
+ log.info("cf3 serverid=" + cf3.getServerId());
+
+ assertEquals(2, cf1.getServerId());
+
+ assertEquals(0, cf2.getServerId());
+
+ assertEquals(1, cf3.getServerId());
+
+
+ assertEquals(3, failoverMap.size());
+
+ assertEquals(cf2.getServerId(), ((Integer)failoverMap.get(new Integer(cf1.getServerId()))).intValue());
+
+ assertEquals(cf3.getServerId(), ((Integer)failoverMap.get(new Integer(cf2.getServerId()))).intValue());
+
+ assertEquals(cf1.getServerId(), ((Integer)failoverMap.get(new Integer(cf3.getServerId()))).intValue());
+ }
+ }
public void testSimpleFailover() throws Exception
{
@@ -538,45 +538,45 @@
}
}
-//
-// public void testEvenSimplerFailover() throws Exception
-// {
-// JBossConnectionFactory factory = (JBossConnectionFactory )ic0.lookup("/ConnectionFactory");
-//
-// Connection conn = null;
-//
-// try
-// {
-// conn = factory.createConnection();
-//
-// log.info("************ KILLING (CRASHING) SERVER 0");
-//
-// ServerManagement.getServer(0).destroy();
-//
-// log.info("killed server, now waiting");
-//
-// Thread.sleep(25000);
-//
-// log.info("done wait");
-// }
-// finally
-// {
-// if (conn != null)
-// {
-// try
-// {
-// conn.close();
-// }
-// catch (Exception e)
-// {
-// e.printStackTrace();
-// }
-// }
-// }
-//
-// }
+ public void testEvenSimplerFailover() throws Exception
+ {
+ JBossConnectionFactory factory = (JBossConnectionFactory )ic0.lookup("/ConnectionFactory");
+
+ Connection conn = null;
+
+ try
+ {
+ conn = factory.createConnection();
+
+ log.info("************ KILLING (CRASHING) SERVER 0");
+
+ ServerManagement.getServer(0).destroy();
+
+ log.info("killed server, now waiting");
+
+ Thread.sleep(25000);
+
+ log.info("done wait");
+ }
+ finally
+ {
+ if (conn != null)
+ {
+ try
+ {
+ conn.close();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ }
+
// public void testConnectionFactoryConnect() throws Exception
// {
// try
Modified: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/jms/clustering/SimpleClusteringTest.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/jms/clustering/SimpleClusteringTest.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/jms/clustering/SimpleClusteringTest.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -101,10 +101,10 @@
}
- public void testKill() throws Exception
- {
- ServerManagement.getServer(0).destroy();
- }
+// public void testKill() throws Exception
+// {
+// ServerManagement.getServer(0).destroy();
+// }
public void testDistributedTopic() throws Exception
{
Modified: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -79,8 +79,7 @@
// service dependencies
private ObjectName persistenceManagerObjectName;
- private ObjectName queuePostOfficeObjectName;
- private ObjectName topicPostOfficeObjectName;
+ private ObjectName postOfficeObjectName;
private ObjectName jmsUserManagerObjectName;
// the server MBean itself
@@ -347,18 +346,12 @@
sc.invoke(serverPeerObjectName, "create", new Object[0], new String[0]);
sc.invoke(serverPeerObjectName, "start", new Object[0], new String[0]);
- MBeanConfigurationElement queuePostOfficeConfig =
- (MBeanConfigurationElement)pdd.query("service", "QueuePostOffice").iterator().next();
- queuePostOfficeObjectName = sc.registerAndConfigureService(queuePostOfficeConfig);
- sc.invoke(queuePostOfficeObjectName, "create", new Object[0], new String[0]);
- sc.invoke(queuePostOfficeObjectName, "start", new Object[0], new String[0]);
+ MBeanConfigurationElement postOfficeConfig =
+ (MBeanConfigurationElement)pdd.query("service", "PostOffice").iterator().next();
+ postOfficeObjectName = sc.registerAndConfigureService(postOfficeConfig);
+ sc.invoke(postOfficeObjectName, "create", new Object[0], new String[0]);
+ sc.invoke(postOfficeObjectName, "start", new Object[0], new String[0]);
- MBeanConfigurationElement topicPostOfficeConfig =
- (MBeanConfigurationElement)pdd.query("service", "TopicPostOffice").iterator().next();
- topicPostOfficeObjectName = sc.registerAndConfigureService(topicPostOfficeConfig);
- sc.invoke(topicPostOfficeObjectName, "create", new Object[0], new String[0]);
- sc.invoke(topicPostOfficeObjectName, "start", new Object[0], new String[0]);
-
log.debug("deploying connection factories");
List connFactoryElements = cfdd.query("service", "ConnectionFactory");
@@ -478,9 +471,9 @@
try
{
- sc.invoke(queuePostOfficeObjectName, "stop", new Object[0], new String[0]);
- sc.invoke(queuePostOfficeObjectName, "destroy", new Object[0], new String[0]);
- sc.unregisterService(queuePostOfficeObjectName);
+ sc.invoke(postOfficeObjectName, "stop", new Object[0], new String[0]);
+ sc.invoke(postOfficeObjectName, "destroy", new Object[0], new String[0]);
+ sc.unregisterService(postOfficeObjectName);
}
catch (Exception ignore)
{
@@ -488,21 +481,7 @@
//services may be started. The ones that didn't start will fail when attempting to shut
//them down.
//Hence we must catch and ignore or we won't shut everything down
- }
-
- try
- {
- sc.invoke(topicPostOfficeObjectName, "stop", new Object[0], new String[0]);
- sc.invoke(topicPostOfficeObjectName, "destroy", new Object[0], new String[0]);
- sc.unregisterService(topicPostOfficeObjectName);
- }
- catch (Exception ignore)
- {
- //If the serverpeer failed when starting up previously, then only some of the
- //services may be started. The ones that didn't start will fail when attempting to shut
- //them down.
- //Hence we must catch and ignore or we won't shut everything down
- }
+ }
try
{
@@ -588,25 +567,6 @@
return serverPeer.getPersistenceManagerInstance();
}
- public PostOffice getQueuePostOffice() throws Exception
- {
- return (PostOffice)sc.
- getAttribute(queuePostOfficeObjectName, "Instance");
- }
-
- public PostOffice internalGetQueuePostOffice() throws Exception
- {
- return (PostOffice)sc.
- getAttribute(queuePostOfficeObjectName, "Instance");
- }
-
- public PostOffice getTopicPostOffice() throws Exception
- {
- return (PostOffice)sc.
- getAttribute(topicPostOfficeObjectName, "Instance");
- }
-
-
/**
* Only for in-VM use!
*/
@@ -845,7 +805,7 @@
public Set getNodeIDView() throws Exception
{
- return (Set)sc.getAttribute(queuePostOfficeObjectName, "NodeIDView");
+ return (Set)sc.getAttribute(postOfficeObjectName, "NodeIDView");
}
// Public --------------------------------------------------------
Modified: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/rmi/RMITestServer.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/rmi/RMITestServer.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/rmi/RMITestServer.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -268,16 +268,6 @@
return server.getPersistenceManager();
}
- public PostOffice getQueuePostOffice() throws Exception
- {
- return server.getQueuePostOffice();
- }
-
- public PostOffice getTopicPostOffice() throws Exception
- {
- return server.getTopicPostOffice();
- }
-
public ObjectName getServerPeerObjectName() throws Exception
{
return server.getServerPeerObjectName();
Modified: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/rmi/Server.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/rmi/Server.java 2006-12-11 01:05:12 UTC (rev 1760)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/rmi/Server.java 2006-12-11 09:31:53 UTC (rev 1761)
@@ -118,13 +118,6 @@
PersistenceManager getPersistenceManager() throws Exception;
/**
- * Only for in-VM use!
- */
- PostOffice getQueuePostOffice() throws Exception;
-
- PostOffice getTopicPostOffice() throws Exception;
-
- /**
* Only for in-VM use
*/
ServerPeer getServerPeer() throws Exception;
More information about the jboss-cvs-commits
mailing list