[jboss-cvs] JBoss Messaging SVN: r3877 - in branches/Branch_JBossMessaging_1_4_0_SP3_CP: src/etc/xmdesc and 7 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Mar 14 10:39:20 EDT 2008
Author: timfox
Date: 2008-03-14 10:39:19 -0400 (Fri, 14 Mar 2008)
New Revision: 3877
Added:
branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/etc/server/default/deploy/null-persistence-service.xml
branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/etc/xmdesc/NullPersistenceManager-xmbean.xml
branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/NullPersistenceManager.java
branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/jmx/NullPersistenceManagerService.java
branches/Branch_JBossMessaging_1_4_0_SP3_CP/tests/src/org/jboss/test/messaging/jms/PagingTest.java
Modified:
branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/ServerPeer.java
branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/destination/QueueService.java
branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/destination/TopicService.java
branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManager.java
branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java
branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/JDBCSupport.java
branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/MessagingQueue.java
branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/jmx/JDBCServiceSupport.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-1250
Copied: branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/etc/server/default/deploy/null-persistence-service.xml (from rev 3876, branches/Branch_Stable/src/etc/server/default/deploy/null-persistence-service.xml)
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/etc/server/default/deploy/null-persistence-service.xml (rev 0)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/etc/server/default/deploy/null-persistence-service.xml 2008-03-14 14:39:19 UTC (rev 3877)
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Null persistence config.
+
+ Use this if you don't actually want to persist anything
+
+ $Id$
+ -->
+
+<server>
+
+ <!-- Persistence Manager MBean configuration
+ ======================================== -->
+
+ <mbean code="org.jboss.messaging.core.jmx.NullPersistenceManagerService"
+ name="jboss.messaging:service=PersistenceManager"
+ xmbean-dd="xmdesc/NullPersistenceManager-xmbean.xml"/>
+
+ <!-- Messaging Post Office MBean configuration
+ ========================================= -->
+
+ <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
+ name="jboss.messaging:service=PostOffice"
+ xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml">
+
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+
+ <!-- The name of the post office -->
+
+ <attribute name="PostOfficeName">JMS post office</attribute>
+
+ <!-- This post office is clustered. If you don't want a clustered post office then set to false -->
+
+ <attribute name="Clustered">false</attribute>
+
+ <!-- All the remaining properties only have to be specified if the post office is clustered.
+ You can safely comment them out if your post office is non clustered -->
+
+ <!-- The JGroups group name that the post office will use -->
+
+ <attribute name="GroupName">${jboss.messaging.groupname:MessagingPostOffice}</attribute>
+
+ <!-- Max time to wait for state to arrive when the post office joins the cluster -->
+
+ <attribute name="StateTimeout">300000</attribute>
+
+ <!-- Max time to wait for a synchronous call to node members using the MessageDispatcher -->
+
+ <attribute name="CastTimeout">300000</attribute>
+
+ <!-- JGroups stack configuration for the data channel - used for sending data across the cluster -->
+
+ <!-- By default we use the TCP stack for data -->
+ <attribute name="DataChannelConfig">
+ <config>
+ <TCP start_port="7900"
+ loopback="true"
+ recv_buf_size="20000000"
+ send_buf_size="640000"
+ discard_incompatible_packets="true"
+ max_bundle_size="64000"
+ max_bundle_timeout="30"
+ use_incoming_packet_handler="true"
+ enable_bundling="false"
+ use_send_queues="false"
+ sock_conn_timeout="300"
+ skip_suspected_members="true"
+ use_concurrent_stack="true"
+ thread_pool.enabled="true"
+ thread_pool.min_threads="1"
+ thread_pool.max_threads="25"
+ thread_pool.keep_alive_time="5000"
+ thread_pool.queue_enabled="false"
+ thread_pool.queue_max_size="100"
+ thread_pool.rejection_policy="run"
+ oob_thread_pool.enabled="true"
+ oob_thread_pool.min_threads="1"
+ oob_thread_pool.max_threads="8"
+ oob_thread_pool.keep_alive_time="5000"
+ oob_thread_pool.queue_enabled="false"
+ oob_thread_pool.queue_max_size="100"
+ oob_thread_pool.rejection_policy="run"/>
+ <MPING timeout="4000"
+ mcast_addr="${jboss.messaging.datachanneludpaddress:228.6.6.6}"
+ mcast_port="${jboss.messaging.datachanneludpport:45567}"
+ ip_ttl="${jboss.messaging.ipttl:8}"
+ num_initial_members="2"
+ num_ping_requests="1"/>
+ <MERGE2 max_interval="100000" min_interval="20000"/>
+ <FD_SOCK/>
+ <FD timeout="10000" max_tries="5" shun="true"/>
+ <VERIFY_SUSPECT timeout="1500"/>
+ <BARRIER/>
+ <pbcast.NAKACK
+ use_mcast_xmit="false" gc_lag="0"
+ retransmit_timeout="300,600,1200,2400,4800"
+ discard_delivered_msgs="true"/>
+ <UNICAST timeout="300,600,1200,2400,3600"/>
+ <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+ max_bytes="400000"/>
+ <VIEW_SYNC avg_send_interval="10000"/>
+
+ <pbcast.GMS print_local_addr="true" join_timeout="3000"
+ shun="false" view_bundling="true"/>
+ <FC max_credits="2000000" min_threshold="0.10"/>
+ <FRAG2 frag_size="60000"/>
+ <pbcast.STREAMING_STATE_TRANSFER/>
+ </config>
+ </attribute>
+
+ <!-- JGroups stack configuration to use for the control channel - used for control messages -->
+
+ <!-- We use udp stack for the control channel -->
+ <attribute name="ControlChannelConfig">
+ <config>
+ <UDP
+ mcast_addr="${jboss.messaging.controlchanneludpaddress:228.7.7.7}"
+ mcast_port="${jboss.messaging.controlchanneludpport:45568}"
+ tos="8"
+ ucast_recv_buf_size="20000000"
+ ucast_send_buf_size="640000"
+ mcast_recv_buf_size="25000000"
+ mcast_send_buf_size="640000"
+ loopback="false"
+ discard_incompatible_packets="true"
+ max_bundle_size="64000"
+ max_bundle_timeout="30"
+ use_incoming_packet_handler="true"
+ ip_ttl="${jboss.messaging.ipttl:8}"
+ enable_bundling="false"
+ enable_diagnostics="true"
+ thread_naming_pattern="cl"
+
+ use_concurrent_stack="true"
+
+ thread_pool.enabled="true"
+ thread_pool.min_threads="2"
+ thread_pool.max_threads="8"
+ thread_pool.keep_alive_time="5000"
+ thread_pool.queue_enabled="true"
+ thread_pool.queue_max_size="1000"
+ thread_pool.rejection_policy="Run"
+
+ oob_thread_pool.enabled="true"
+ oob_thread_pool.min_threads="1"
+ oob_thread_pool.max_threads="8"
+ oob_thread_pool.keep_alive_time="5000"
+ oob_thread_pool.queue_enabled="false"
+ oob_thread_pool.queue_max_size="100"
+ oob_thread_pool.rejection_policy="Run"/>
+ <PING timeout="2000"
+ num_initial_members="3"/>
+ <MERGE2 max_interval="100000"
+ min_interval="20000"/>
+ <FD_SOCK />
+ <FD timeout="10000" max_tries="5" shun="true"/>
+ <VERIFY_SUSPECT timeout="1500" />
+ <BARRIER />
+ <pbcast.NAKACK use_stats_for_retransmission="false"
+ exponential_backoff="150"
+ use_mcast_xmit="true" gc_lag="0"
+ retransmit_timeout="50,300,600,1200"
+ discard_delivered_msgs="true"/>
+ <UNICAST timeout="300,600,1200,2400,3600"/>
+ <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+ max_bytes="400000"/>
+ <VIEW_SYNC avg_send_interval="10000"/>
+ <pbcast.GMS print_local_addr="true" join_timeout="3000"
+ shun="false"
+ view_bundling="true"/>
+ <FC max_credits="500000"
+ min_threshold="0.20"/>
+ <FRAG2 frag_size="60000" />
+ <pbcast.STATE_TRANSFER />
+ </config>
+ </attribute>
+ </mbean>
+
+ <!-- Messaging JMS User Manager MBean config
+ ======================================= -->
+
+ <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
+ name="jboss.messaging:service=JMSUserManager"
+ xmbean-dd="xmdesc/JMSUserManager-xmbean.xml"/>
+
+</server>
Copied: branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/etc/xmdesc/NullPersistenceManager-xmbean.xml (from rev 3876, branches/Branch_Stable/src/etc/xmdesc/NullPersistenceManager-xmbean.xml)
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/etc/xmdesc/NullPersistenceManager-xmbean.xml (rev 0)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/etc/xmdesc/NullPersistenceManager-xmbean.xml 2008-03-14 14:39:19 UTC (rev 3877)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE mbean PUBLIC
+ "-//JBoss//DTD JBOSS XMBEAN 1.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss_xmbean_1_2.dtd">
+
+<mbean>
+ <description>A null persistence manager</description>
+ <class>org.jboss.messaging.core.jmx.NullPersistenceManagerService</class>
+
+ <!-- Managed attributes -->
+
+ <attribute access="read-only" getMethod="getInstance">
+ <description>The instance to plug into the server peer</description>
+ <name>Instance</name>
+ <type>org.jboss.messaging.core.contract.MessagingComponent</type>
+ </attribute>
+
+ <operation>
+ <description>JBoss Service lifecycle operation</description>
+ <name>create</name>
+ </operation>
+
+ <operation>
+ <description>JBoss Service lifecycle operation</description>
+ <name>start</name>
+ </operation>
+
+ <operation>
+ <description>JBoss Service lifecycle operation</description>
+ <name>stop</name>
+ </operation>
+
+ <operation>
+ <description>JBoss Service lifecycle operation</description>
+ <name>destroy</name>
+ </operation>
+
+</mbean>
Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/ServerPeer.java
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/ServerPeer.java 2008-03-14 14:28:14 UTC (rev 3876)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/ServerPeer.java 2008-03-14 14:39:19 UTC (rev 3877)
@@ -237,7 +237,11 @@
// of their automatically-creating management interface.
persistenceManager = (PersistenceManager)JMXAccessor.getJMXAttributeOverSecurity(mbeanServer, persistenceManagerObjectName, "Instance");
- ((JDBCPersistenceManager)persistenceManager).injectNodeID(serverPeerID);
+
+ if (persistenceManager instanceof JDBCPersistenceManager)
+ {
+ ((JDBCPersistenceManager)persistenceManager).injectNodeID(serverPeerID);
+ }
jmsUserManager = (JMSUserManager)JMXAccessor.getJMXAttributeOverSecurity(mbeanServer, jmsUserManagerObjectName, "Instance");
Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/destination/QueueService.java
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/destination/QueueService.java 2008-03-14 14:28:14 UTC (rev 3876)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/destination/QueueService.java 2008-03-14 14:39:19 UTC (rev 3877)
@@ -9,8 +9,6 @@
import java.util.ArrayList;
import java.util.List;
-import javax.jms.IllegalStateException;
-
import org.jboss.jms.server.JMSCondition;
import org.jboss.jms.server.messagecounter.MessageCounter;
import org.jboss.jms.server.messagecounter.MessageStatistics;
@@ -21,6 +19,8 @@
import org.jboss.messaging.util.ExceptionUtil;
import org.jboss.messaging.util.XMLUtil;
+import org.jboss.logging.Logger;
+
/**
* MBean wrapper around a ManagedQueue
*
@@ -36,6 +36,9 @@
// Constants ------------------------------------------------------------------------------------
private static final String QUEUE_MESSAGECOUNTER_PREFIX = "Queue.";
+
+ private static final Logger log = Logger.getLogger(QueueService.class);
+
// Static ---------------------------------------------------------------------------------------
@@ -85,7 +88,9 @@
//Sanity check - currently it is not possible to change the clustered attribute of a destination
//See http://jira.jboss.org/jira/browse/JBMESSAGING-1235
- if (destination.isClustered() != queue.isClustered())
+ boolean actuallyClustered = po.isClustered() && destination.isClustered();
+
+ if (actuallyClustered != queue.isClustered())
{
throw new IllegalArgumentException("Queue " + destination.getName() + " is already deployed as clustered = " +
queue.isClustered() + " so cannot redeploy as clustered=" + destination.isClustered() +
Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/destination/TopicService.java
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/destination/TopicService.java 2008-03-14 14:28:14 UTC (rev 3876)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/destination/TopicService.java 2008-03-14 14:39:19 UTC (rev 3877)
@@ -75,7 +75,9 @@
{
Queue queue = (Queue)iter.next();
- if (destination.isClustered() != queue.isClustered())
+ boolean actuallyClustered = po.isClustered() && destination.isClustered();
+
+ if (actuallyClustered != queue.isClustered())
{
throw new IllegalArgumentException("Topic " + destination.getName() + " is already deployed as clustered = " +
queue.isClustered() + " so cannot redeploy as clustered=" + destination.isClustered() +
Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManager.java
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManager.java 2008-03-14 14:28:14 UTC (rev 3876)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManager.java 2008-03-14 14:39:19 UTC (rev 3877)
@@ -109,6 +109,10 @@
public String getPreConfiguredClientID(String username) throws Exception
{
+ if (ds == null)
+ {
+ return null;
+ }
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
@@ -151,6 +155,10 @@
private void insertUserRoleData() throws Exception
{
+ if (ds == null)
+ {
+ return;
+ }
List populateTables = new ArrayList();
for (Iterator i = sqlProperties.entrySet().iterator(); i.hasNext();)
{
Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java 2008-03-14 14:28:14 UTC (rev 3876)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java 2008-03-14 14:39:19 UTC (rev 3877)
@@ -636,7 +636,7 @@
log.trace("Paging references in channel " + channelID + " refs "
+ references.size());
}
-
+
class PageReferencesRunner extends JDBCTxRunner2
{
public Object doTransaction() throws Exception
@@ -674,11 +674,9 @@
// message) itself
// Now store the reference
+
+ log.trace("Paged ref with page order " + ref.getPagingOrder());
- log
- .trace("Paged ref with page order "
- + ref.getPagingOrder());
-
addReference(channelID, ref, psInsertReference, page);
int rows = psInsertReference.executeUpdate();
@@ -687,7 +685,7 @@
{
log.trace("Inserted " + rows + " rows");
}
-
+
// Maybe we need to persist the message itself
Message m = ref.getMessage();
@@ -2532,7 +2530,7 @@
protected Map getDefaultDDLStatements()
{
Map<String, String> map = new LinkedHashMap<String, String>();
- map.put("CREATE_DUAL", "CREATE TABLE JBM_DUAL (DUMMY INTEGER)");
+ map.put("CREATE_DUAL", "CREATE TABLE JBM_DUAL (DUMMY INTEGER, PRIMARY KEY(DUMMY))");
// Message reference
map.put("CREATE_MESSAGE_REFERENCE",
"CREATE TABLE JBM_MSG_REF (MESSAGE_ID BIGINT, "
Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/JDBCSupport.java
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/JDBCSupport.java 2008-03-14 14:28:14 UTC (rev 3876)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/JDBCSupport.java 2008-03-14 14:39:19 UTC (rev 3877)
@@ -97,6 +97,10 @@
public void start() throws Exception
{
+ if (ds == null)
+ {
+ return;
+ }
defaultDMLStatements.putAll(getDefaultDMLStatements());
defaultDDLStatements.putAll(getDefaultDDLStatements());
Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/MessagingQueue.java
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/MessagingQueue.java 2008-03-14 14:28:14 UTC (rev 3876)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/MessagingQueue.java 2008-03-14 14:39:19 UTC (rev 3877)
@@ -67,7 +67,8 @@
public class MessagingQueue extends PagingChannelSupport implements Queue
{
// Constants -----------------------------------------------------
-
+
+
// Static --------------------------------------------------------
private static final Logger log = Logger.getLogger(MessagingQueue.class);
Copied: branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/NullPersistenceManager.java (from rev 3876, branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/NullPersistenceManager.java)
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/NullPersistenceManager.java (rev 0)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/NullPersistenceManager.java 2008-03-14 14:39:19 UTC (rev 3877)
@@ -0,0 +1,154 @@
+package org.jboss.messaging.core.impl;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.jboss.messaging.core.contract.MessageReference;
+import org.jboss.messaging.core.contract.PersistenceManager;
+import org.jboss.messaging.core.impl.tx.Transaction;
+
+/**
+ *
+ * A NullPersistenceManager
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public class NullPersistenceManager implements PersistenceManager
+{
+ private ConcurrentMap<String, AtomicLong> counters = new ConcurrentHashMap<String, AtomicLong>();
+
+ public void addReference(long channelID, MessageReference ref, Transaction tx)
+ throws Exception
+ {
+ //NOOP
+ }
+
+ public List getMessageChannelPairAcksForTx(long transactionId)
+ throws Exception
+ {
+ return Collections.EMPTY_LIST;
+ }
+
+ public List getMessageChannelPairRefsForTx(long transactionId)
+ throws Exception
+ {
+ return Collections.EMPTY_LIST;
+ }
+
+ public List getMessages(List messageIds) throws Exception
+ {
+ return Collections.EMPTY_LIST;
+ }
+
+ public List getPagedReferenceInfos(long channelID, long orderStart,
+ int number) throws Exception
+ {
+ return Collections.EMPTY_LIST;
+ }
+
+ public boolean idExists(String messageID) throws Exception
+ {
+ return false;
+ }
+
+ public InitialLoadInfo loadFromStart(long channelID, int fullSize)
+ throws Exception
+ {
+ return new InitialLoadInfo(null, null, Collections.EMPTY_LIST);
+ }
+
+ public InitialLoadInfo mergeAndLoad(long fromChannelID, long toChannelID,
+ int numberToLoad, long firstPagingOrder, long nextPagingOrder)
+ throws Exception
+ {
+ return new InitialLoadInfo(null, null, Collections.EMPTY_LIST);
+ }
+
+ public void mergeTransactions(int fromNodeID, int toNodeID) throws Exception
+ {
+ //NOOP
+ }
+
+ public void moveReference(long sourceChannelID, long destChannelID,
+ MessageReference ref) throws Exception
+ {
+ //NOOP
+ }
+
+ public void pageReferences(long channelID, List references, boolean paged)
+ throws Exception
+ {
+ //NOOP
+ }
+
+ public void removeDepagedReferences(long channelID, List refs)
+ throws Exception
+ {
+ //NOOP
+ }
+
+ public void removeReference(long channelID, MessageReference ref,
+ Transaction tx) throws Exception
+ {
+ //NOOP
+ }
+
+ public long reserveIDBlock(String counterName, int size) throws Exception
+ {
+ AtomicLong counter = counters.get(counterName);
+
+ if (counter == null)
+ {
+ counter = new AtomicLong(0);
+
+ AtomicLong oldCounter = counters.putIfAbsent(counterName, counter);
+
+ if (oldCounter != null)
+ {
+ counter = oldCounter;
+ }
+ }
+
+ long idStart = counter.addAndGet(size) - size;
+
+ return idStart;
+ }
+
+ public List retrievePreparedTransactions() throws Exception
+ {
+ return Collections.EMPTY_LIST;
+ }
+
+ public void updateDeliveryCount(long channelID, MessageReference ref)
+ throws Exception
+ {
+ //NOOP
+ }
+
+ public void updatePageOrder(long channelID, List references)
+ throws Exception
+ {
+ ///NOOP
+ }
+
+ public void updateReferencesNotPagedInRange(long channelID, long orderStart,
+ long orderEnd, long num) throws Exception
+ {
+ //NOOP
+ }
+
+ public void start() throws Exception
+ {
+ //NOOP
+ }
+
+ public void stop() throws Exception
+ {
+ //NOOP
+ }
+
+}
Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java 2008-03-14 14:28:14 UTC (rev 3876)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java 2008-03-14 14:39:19 UTC (rev 3877)
@@ -2454,6 +2454,10 @@
private Map getBindingsFromStorage() throws Exception
{
+ if (ds == null)
+ {
+ return new HashMap();
+ }
class LoadBindings extends JDBCTxRunner<Map>
{
public Map doTransaction() throws Exception
@@ -2564,6 +2568,10 @@
private void insertBindingInStorage(final Condition condition, final Queue queue, final boolean allNodes) throws Exception
{
+ if (ds == null)
+ {
+ return;
+ }
class InsertBindings extends JDBCTxRunner
{
public Object doTransaction() throws Exception
@@ -2621,6 +2629,10 @@
private boolean deleteBindingFromStorage(final Queue queue) throws Exception
{
+ if (ds == null)
+ {
+ return true;
+ }
class DeleteBindings extends JDBCTxRunner<Boolean>
{
public Boolean doTransaction() throws Exception
Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/jmx/JDBCServiceSupport.java
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/jmx/JDBCServiceSupport.java 2008-03-14 14:28:14 UTC (rev 3876)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/jmx/JDBCServiceSupport.java 2008-03-14 14:39:19 UTC (rev 3877)
@@ -71,11 +71,15 @@
try
{
ic = new InitialContext();
- ds = (DataSource)ic.lookup(dataSourceJNDIName);
- if (ds == null)
+
+ if (dataSourceJNDIName != null)
{
- throw new IllegalStateException("No DataSource found. This service dependencies must " +
- "have not been enforced correctly!");
+ ds = (DataSource)ic.lookup(dataSourceJNDIName);
+ if (ds == null)
+ {
+ throw new IllegalStateException("No DataSource found. This service dependencies must " +
+ "have not been enforced correctly!");
+ }
}
}
Copied: branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/jmx/NullPersistenceManagerService.java (from rev 3876, branches/Branch_Stable/src/main/org/jboss/messaging/core/jmx/NullPersistenceManagerService.java)
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/jmx/NullPersistenceManagerService.java (rev 0)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/jmx/NullPersistenceManagerService.java 2008-03-14 14:39:19 UTC (rev 3877)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.messaging.core.jmx;
+
+import org.jboss.messaging.core.contract.MessagingComponent;
+import org.jboss.messaging.core.contract.PersistenceManager;
+import org.jboss.messaging.core.impl.NullPersistenceManager;
+import org.jboss.system.ServiceMBeanSupport;
+
+/**
+ *
+ * A NullPersistenceManagerService
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public class NullPersistenceManagerService extends ServiceMBeanSupport
+{
+ private PersistenceManager persistenceManager;
+
+ public MessagingComponent getInstance()
+ {
+ return persistenceManager;
+ }
+
+ protected synchronized void startService() throws Exception
+ {
+ persistenceManager = new NullPersistenceManager();
+ }
+
+ protected void stopService() throws Exception
+ {
+ persistenceManager = null;
+ }
+
+
+}
Copied: branches/Branch_JBossMessaging_1_4_0_SP3_CP/tests/src/org/jboss/test/messaging/jms/PagingTest.java (from rev 3876, branches/Branch_Stable/tests/src/org/jboss/test/messaging/jms/PagingTest.java)
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/tests/src/org/jboss/test/messaging/jms/PagingTest.java (rev 0)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/tests/src/org/jboss/test/messaging/jms/PagingTest.java 2008-03-14 14:39:19 UTC (rev 3877)
@@ -0,0 +1,143 @@
+/*
+ * 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.jms;
+
+import javax.jms.Connection;
+import javax.jms.DeliveryMode;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+
+import org.jboss.test.messaging.tools.ServerManagement;
+
+
+/**
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ * $Id: AcknowledgementTest.java 3173 2007-10-05 12:48:16Z timfox $
+ */
+public class PagingTest extends JMSTestCase
+{
+ // Constants -----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public PagingTest(String name)
+ {
+ super(name);
+ }
+
+ // TestCase overrides -------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ public void testPaging() throws Exception
+ {
+ ServerManagement.deployQueue("pagequeue", null, 10000, 1000, 1000);
+
+ Queue queue = (Queue)ic.lookup("/queue/pagequeue");
+
+ Connection conn = null;
+
+ try
+ {
+ conn = cf.createConnection();
+
+ conn.start();
+
+ Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ MessageProducer sender = session.createProducer(queue);
+
+ sender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+
+ MessageConsumer cons = session.createConsumer(queue);
+
+ final int numMessages = 100000;
+
+ long start = System.currentTimeMillis();
+
+ for (int i = 0; i < 100000; i++)
+ {
+ Message m = session.createMessage();
+
+ sender.send(m);
+
+ if (i % 1000 == 0)
+ {
+ log.info("Sent message " + i);
+ }
+ }
+
+ long end = System.currentTimeMillis();
+
+ double rate = 1000 * (double)numMessages / ( end - start);
+
+ log.info("Rate " + rate);
+
+ start = System.currentTimeMillis();
+
+ for (int i = 0; i < 100000; i++)
+ {
+ Message m = cons.receive(2000);
+
+ if (i % 1000 == 0)
+ {
+ log.info("Got message " + i);
+ }
+ }
+
+ end = System.currentTimeMillis();
+
+ rate = 1000 * (double)numMessages / ( end - start);
+
+ log.info("Rate " + rate);
+
+
+ }
+ finally
+ {
+ if (conn != null)
+ {
+ conn.close();
+ }
+
+ try
+ {
+ ServerManagement.undeployQueue("pagequeue");
+ }
+ catch(Exception ignore)
+ {
+
+ }
+ }
+ }
+
+}
+
+
More information about the jboss-cvs-commits
mailing list