[Jboss-cvs] JBossAS SVN: r56204 - branches/JBoss_4_0_3_SP1_JBAS_3511/server/src/main/org/jboss/jms/asf
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Aug 23 18:47:32 EDT 2006
Author: weston.price at jboss.com
Date: 2006-08-23 18:47:31 -0400 (Wed, 23 Aug 2006)
New Revision: 56204
Modified:
branches/JBoss_4_0_3_SP1_JBAS_3511/server/src/main/org/jboss/jms/asf/StdServerSession.java
Log:
[JBAS-3511] Improvements for ASF integration, pool management, idle session collection
as and dynamic allocation.
Modified: branches/JBoss_4_0_3_SP1_JBAS_3511/server/src/main/org/jboss/jms/asf/StdServerSession.java
===================================================================
--- branches/JBoss_4_0_3_SP1_JBAS_3511/server/src/main/org/jboss/jms/asf/StdServerSession.java 2006-08-23 22:47:20 UTC (rev 56203)
+++ branches/JBoss_4_0_3_SP1_JBAS_3511/server/src/main/org/jboss/jms/asf/StdServerSession.java 2006-08-23 22:47:31 UTC (rev 56204)
@@ -31,6 +31,7 @@
* @author <a href="mailto:peter.antman at tim.se">Peter Antman</a> .
* @author <a href="mailto:jason at planet57.com">Jason Dillon</a>
* @author <a href="mailto:hiram.chirino at jboss.org">Hiram Chirino</a> .
+ * @author <a href="mailto:weston.price at jboss.com>Weston Price</a>
* @version $Revision$
*/
public class StdServerSession
@@ -77,6 +78,9 @@
private long lastUse;
+ private boolean hasPermit;
+
+
/**
* Create a <tt>StdServerSession</tt> .
*
@@ -96,8 +100,7 @@
final XidFactoryMBean xidFactory)
throws JMSException
{
- // assert pool != null
- // assert session != null
+
this.serverSessionPool = pool;
this.session = session;
@@ -119,15 +122,21 @@
session.setMessageListener(this);
InitialContext ctx = null;
+
+
try
{
- ctx = new InitialContext();
- tm = (TransactionManager) ctx.lookup(TransactionManagerService.JNDI_NAME);
+
+ ctx = new InitialContext();
+ tm = (TransactionManager) ctx.lookup(TransactionManagerService.JNDI_NAME);
+ lastUse = System.currentTimeMillis();
+
}
catch (Exception e)
{
throw new JMSException("Transation manager was not found");
}
+
finally
{
if (ctx != null)
@@ -432,5 +441,19 @@
return this.lastUse < timeout;
}
+ void setLastUsed(long lastUsed)
+ {
+ this.lastUse = lastUsed;
+ }
+
+ public void setHasPermit(boolean permit)
+ {
+ this.hasPermit = permit;
+ }
+
+ public boolean getHasPermit()
+ {
+ return this.hasPermit;
+ }
}
More information about the jboss-cvs-commits
mailing list