[hornetq-commits] JBoss hornetq SVN: r8066 - in trunk: src/main/org/hornetq/core/postoffice and 4 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Oct 8 05:15:12 EDT 2009
Author: timfox
Date: 2009-10-08 05:15:11 -0400 (Thu, 08 Oct 2009)
New Revision: 8066
Modified:
trunk/src/main/org/hornetq/core/management/impl/ManagementServiceImpl.java
trunk/src/main/org/hornetq/core/postoffice/PostOffice.java
trunk/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java
trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
trunk/tests/src/org/hornetq/tests/integration/jms/connection/CloseConnectionOnGCTest.java
trunk/tests/src/org/hornetq/tests/unit/core/server/impl/fakes/FakePostOffice.java
Log:
a little more refactoring on routing
Modified: trunk/src/main/org/hornetq/core/management/impl/ManagementServiceImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/ManagementServiceImpl.java 2009-10-08 09:00:29 UTC (rev 8065)
+++ trunk/src/main/org/hornetq/core/management/impl/ManagementServiceImpl.java 2009-10-08 09:15:11 UTC (rev 8066)
@@ -729,7 +729,7 @@
notificationMessage.putTypedProperties(notifProps);
- postOffice.route(notificationMessage, new RoutingContextImpl(null));
+ postOffice.route(notificationMessage);
}
}
}
Modified: trunk/src/main/org/hornetq/core/postoffice/PostOffice.java
===================================================================
--- trunk/src/main/org/hornetq/core/postoffice/PostOffice.java 2009-10-08 09:00:29 UTC (rev 8065)
+++ trunk/src/main/org/hornetq/core/postoffice/PostOffice.java 2009-10-08 09:15:11 UTC (rev 8066)
@@ -52,6 +52,8 @@
Bindings getMatchingBindings(SimpleString address);
+ void route(ServerMessage message) throws Exception;
+
void route(ServerMessage message, RoutingContext context) throws Exception;
MessageReference reroute(ServerMessage message, Queue queue, Transaction tx) throws Exception;
Modified: trunk/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java 2009-10-08 09:00:29 UTC (rev 8065)
+++ trunk/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java 2009-10-08 09:15:11 UTC (rev 8066)
@@ -518,6 +518,11 @@
{
return addressManager.getMatchingBindings(address);
}
+
+ public void route(final ServerMessage message) throws Exception
+ {
+ route(message, new RoutingContextImpl(null));
+ }
public void route(final ServerMessage message, final RoutingContext context) throws Exception
{
@@ -700,11 +705,6 @@
return reference;
}
- public void route(final ServerMessage message) throws Exception
- {
- route(message, new RoutingContextImpl(null));
- }
-
public boolean redistribute(final ServerMessage message, final Queue originatingQueue, final RoutingContext context) throws Exception
{
Bindings bindings = addressManager.getBindingsForRoutingAddress(message.getDestination());
@@ -1167,7 +1167,7 @@
// This could happen when the PageStore left the pageState
// TODO is this correct - don't we lose transactionality here???
- route(message, new RoutingContextImpl(null));
+ route(message);
}
first = false;
}
Modified: trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java 2009-10-08 09:00:29 UTC (rev 8065)
+++ trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java 2009-10-08 09:15:11 UTC (rev 8066)
@@ -568,7 +568,7 @@
getRefsOperation(tx).addAck(ref);
}
- final RefsOperation getRefsOperation(final Transaction tx)
+ private final RefsOperation getRefsOperation(final Transaction tx)
{
synchronized (tx)
{
Modified: trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2009-10-08 09:00:29 UTC (rev 8065)
+++ trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2009-10-08 09:15:11 UTC (rev 8066)
@@ -1803,17 +1803,13 @@
throw e;
}
- RoutingContext context;
-
if (tx == null || autoCommitSends)
{
- context = new RoutingContextImpl(null);
+ postOffice.route(msg);
}
else
{
- context = new RoutingContextImpl(tx);
- }
-
- postOffice.route(msg, context);
+ postOffice.route(msg, new RoutingContextImpl(tx));
+ }
}
}
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/connection/CloseConnectionOnGCTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/connection/CloseConnectionOnGCTest.java 2009-10-08 09:00:29 UTC (rev 8065)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/connection/CloseConnectionOnGCTest.java 2009-10-08 09:15:11 UTC (rev 8066)
@@ -117,36 +117,4 @@
assertEquals(0, server.getRemotingService().getConnections().size());
}
-
- public static void checkWeakReferences(WeakReference<?>... references)
- {
-
- int i = 0;
- boolean hasValue = false;
-
- do
- {
- hasValue = false;
-
- if (i > 0)
- {
- forceGC();
- }
-
- for (WeakReference<?> ref : references)
- {
- if (ref.get() != null)
- {
- hasValue = true;
- }
- }
- }
- while (i++ <= 30 && hasValue);
-
- for (WeakReference<?> ref : references)
- {
- assertNull(ref.get());
- }
- }
-
}
Modified: trunk/tests/src/org/hornetq/tests/unit/core/server/impl/fakes/FakePostOffice.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/unit/core/server/impl/fakes/FakePostOffice.java 2009-10-08 09:00:29 UTC (rev 8065)
+++ trunk/tests/src/org/hornetq/tests/unit/core/server/impl/fakes/FakePostOffice.java 2009-10-08 09:15:11 UTC (rev 8066)
@@ -164,6 +164,15 @@
}
+ /* (non-Javadoc)
+ * @see org.hornetq.core.postoffice.PostOffice#route(org.hornetq.core.server.ServerMessage)
+ */
+ public void route(ServerMessage message) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
}
\ No newline at end of file
More information about the hornetq-commits
mailing list