Author: jmesnil
Date: 2009-12-03 03:29:30 -0500 (Thu, 03 Dec 2009)
New Revision: 8516
Modified:
trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
Log:
factorized ServerSessionImpl.getCreditManagerHolder() methods
Modified: trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2009-12-03 07:25:42
UTC (rev 8515)
+++ trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2009-12-03 08:29:30
UTC (rev 8516)
@@ -23,8 +23,6 @@
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
-import java.util.concurrent.Executors;
-import java.util.concurrent.LinkedBlockingQueue;
import javax.transaction.xa.XAException;
import javax.transaction.xa.XAResource;
@@ -1901,29 +1899,13 @@
*/
private void releaseOutStanding(final ServerMessage message, final int credits) throws
Exception
{
- CreditManagerHolder holder = getCreditManagerHolder(message);
+ CreditManagerHolder holder = getCreditManagerHolder(message.getDestination());
holder.outstandingCredits -= credits;
holder.store.returnProducerCredits(credits);
}
- private CreditManagerHolder getCreditManagerHolder(final ServerMessage message) throws
Exception
- {
- SimpleString address = message.getDestination();
-
- CreditManagerHolder holder = creditManagerHolders.get(address);
-
- if (holder == null)
- {
- holder = new CreditManagerHolder(message.getPagingStore());
-
- creditManagerHolders.put(address, holder);
- }
-
- return holder;
- }
-
private CreditManagerHolder getCreditManagerHolder(final SimpleString address) throws
Exception
{
CreditManagerHolder holder = creditManagerHolders.get(address);
Show replies by date