[jboss-cvs] JBoss Messaging SVN: r5553 - in trunk/src/main/org/jboss/messaging/core: server/impl and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sat Dec 20 13:31:30 EST 2008
Author: timfox
Date: 2008-12-20 13:31:30 -0500 (Sat, 20 Dec 2008)
New Revision: 5553
Modified:
trunk/src/main/org/jboss/messaging/core/postoffice/impl/PostOfficeImpl.java
trunk/src/main/org/jboss/messaging/core/server/impl/ServerSessionImpl.java
Log:
More tweaks to paging
Modified: trunk/src/main/org/jboss/messaging/core/postoffice/impl/PostOfficeImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/postoffice/impl/PostOfficeImpl.java 2008-12-20 17:40:43 UTC (rev 5552)
+++ trunk/src/main/org/jboss/messaging/core/postoffice/impl/PostOfficeImpl.java 2008-12-20 18:31:30 UTC (rev 5553)
@@ -106,7 +106,7 @@
private final int idCacheSize;
private final boolean persistIDCache;
-
+
public PostOfficeImpl(final StorageManager storageManager,
final PagingManager pagingManager,
final QueueFactory queueFactory,
@@ -383,7 +383,22 @@
if (scheduledDeliveryTime != null)
{
- scheduleReferences(scheduledDeliveryTime, references, tx);
+ for (MessageReference ref : references)
+ {
+ ref.setScheduledDeliveryTime(scheduledDeliveryTime);
+
+ if (ref.getMessage().isDurable() && ref.getQueue().isDurable())
+ {
+ if (tx != null)
+ {
+ storageManager.updateScheduledDeliveryTimeTransactional(tx.getID(), ref);
+ }
+ else
+ {
+ storageManager.updateScheduledDeliveryTime(ref);
+ }
+ }
+ }
}
if (deliver)
@@ -403,7 +418,10 @@
{
if (tx == null)
{
- route(message, null, true);
+ if (!pagingManager.page(message))
+ {
+ route(message, null, true);
+ }
}
else
{
@@ -478,28 +496,7 @@
}
// Private -----------------------------------------------------------------
-
- private void scheduleReferences(final long scheduledDeliveryTime, final List<MessageReference> references, final Transaction tx) throws Exception
- {
- for (MessageReference ref : references)
- {
- ref.setScheduledDeliveryTime(scheduledDeliveryTime);
-
- if (ref.getMessage().isDurable() && ref.getQueue().isDurable())
- {
- if (tx != null)
- {
- storageManager.updateScheduledDeliveryTimeTransactional(tx.getID(), ref);
- }
- else
- {
- storageManager.updateScheduledDeliveryTime(ref);
- }
- }
- }
- }
-
-
+
/**
* Add sizes on Paging
* @param address
@@ -509,7 +506,7 @@
*/
private void computePaging(SimpleString address, final ServerMessage message, List<MessageReference> references) throws Exception
{
- if (references.size() > 0)
+ if (!references.isEmpty())
{
PagingStore store = pagingManager.getPageStore(address);
Modified: trunk/src/main/org/jboss/messaging/core/server/impl/ServerSessionImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/impl/ServerSessionImpl.java 2008-12-20 17:40:43 UTC (rev 5552)
+++ trunk/src/main/org/jboss/messaging/core/server/impl/ServerSessionImpl.java 2008-12-20 18:31:30 UTC (rev 5553)
@@ -182,8 +182,6 @@
private final PostOffice postOffice;
- private final PagingManager pager;
-
private final SecurityStore securityStore;
private final Channel channel;
@@ -247,8 +245,6 @@
this.postOffice = postOffice;
- pager = postOffice.getPagingManager();
-
this.queueSettingsRepository = queueSettingsRepository;
this.resourceManager = resourceManager;
@@ -2636,10 +2632,7 @@
if (theTx == null)
{
- if (!pager.page(msg))
- {
- postOffice.route(msg, null);
- }
+ postOffice.route(msg, null);
}
else
{
More information about the jboss-cvs-commits
mailing list