[jboss-cvs] JBossAS SVN: r106953 - in branches/Session_Ownership/tomcat/src/main/java/org/jboss/web/tomcat/service/session: persistent and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jul 20 16:58:43 EDT 2010
Author: pferraro
Date: 2010-07-20 16:58:43 -0400 (Tue, 20 Jul 2010)
New Revision: 106953
Modified:
branches/Session_Ownership/tomcat/src/main/java/org/jboss/web/tomcat/service/session/ClusteredSession.java
branches/Session_Ownership/tomcat/src/main/java/org/jboss/web/tomcat/service/session/persistent/PersistentStoreDistributedCacheManager.java
Log:
Use updated session ownership support API.
Modified: branches/Session_Ownership/tomcat/src/main/java/org/jboss/web/tomcat/service/session/ClusteredSession.java
===================================================================
--- branches/Session_Ownership/tomcat/src/main/java/org/jboss/web/tomcat/service/session/ClusteredSession.java 2010-07-20 20:56:48 UTC (rev 106952)
+++ branches/Session_Ownership/tomcat/src/main/java/org/jboss/web/tomcat/service/session/ClusteredSession.java 2010-07-20 20:58:43 UTC (rev 106953)
@@ -70,7 +70,7 @@
import org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManager;
import org.jboss.web.tomcat.service.session.distributedcache.spi.IncomingDistributableSessionData;
import org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingDistributableSessionData;
-import org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManager.LockResult;
+import org.jboss.web.tomcat.service.session.distributedcache.spi.SessionOwnershipSupport;
import org.jboss.web.tomcat.service.session.notification.ClusteredSessionManagementStatus;
import org.jboss.web.tomcat.service.session.notification.ClusteredSessionNotificationCause;
import org.jboss.web.tomcat.service.session.notification.ClusteredSessionNotificationPolicy;
@@ -565,8 +565,9 @@
public void access()
{
- boolean canOwn = this.distributedCacheManager.getSupportsSessionOwnership();
- if (canOwn)
+ SessionOwnershipSupport support = this.distributedCacheManager.getSessionOwnershipSupport();
+
+ if (support != null)
{
acquireSessionOwnership();
}
@@ -609,9 +610,11 @@
}
finally
{
- if (this.distributedCacheManager.getSupportsSessionOwnership())
+ SessionOwnershipSupport support = this.distributedCacheManager.getSessionOwnershipSupport();
+
+ if (support != null)
{
- this.distributedCacheManager.relinquishSessionOwnership(getRealId(), false);
+ support.relinquishSessionOwnership(getRealId(), false);
}
}
}
@@ -1379,8 +1382,8 @@
{
ownershipLock.lockInterruptibly();
locked = true;
- LockResult res = this.distributedCacheManager.acquireSessionOwnership(getRealId(), needNewLock());
- if (res == LockResult.ACQUIRED_FROM_CLUSTER)
+ SessionOwnershipSupport.LockResult res = this.distributedCacheManager.getSessionOwnershipSupport().acquireSessionOwnership(getRealId(), needNewLock());
+ if (res == SessionOwnershipSupport.LockResult.ACQUIRED_FROM_CLUSTER)
{
// We may be out of date re: the distributed cache
update(this.distributedCacheManager.getSessionData(getRealId(), false));
@@ -1570,7 +1573,7 @@
expiring = false;
if (acquiredLock)
{
- this.distributedCacheManager.relinquishSessionOwnership(getRealId(), true);
+ this.distributedCacheManager.getSessionOwnershipSupport().relinquishSessionOwnership(getRealId(), true);
}
}
}
Modified: branches/Session_Ownership/tomcat/src/main/java/org/jboss/web/tomcat/service/session/persistent/PersistentStoreDistributedCacheManager.java
===================================================================
--- branches/Session_Ownership/tomcat/src/main/java/org/jboss/web/tomcat/service/session/persistent/PersistentStoreDistributedCacheManager.java 2010-07-20 20:56:48 UTC (rev 106952)
+++ branches/Session_Ownership/tomcat/src/main/java/org/jboss/web/tomcat/service/session/persistent/PersistentStoreDistributedCacheManager.java 2010-07-20 20:58:43 UTC (rev 106953)
@@ -25,12 +25,12 @@
import java.util.Map;
import java.util.Set;
-import org.jboss.ha.framework.server.lock.TimeoutException;
import org.jboss.metadata.web.jboss.ReplicationGranularity;
import org.jboss.web.tomcat.service.session.distributedcache.spi.BatchingManager;
import org.jboss.web.tomcat.service.session.distributedcache.spi.DistributableSessionMetadata;
import org.jboss.web.tomcat.service.session.distributedcache.spi.IncomingDistributableSessionData;
import org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingSessionGranularitySessionData;
+import org.jboss.web.tomcat.service.session.distributedcache.spi.SessionOwnershipSupport;
/**
*
@@ -280,21 +280,8 @@
}
- public boolean getSupportsSessionOwnership()
+ public SessionOwnershipSupport getSessionOwnershipSupport()
{
- return false;
+ return null;
}
-
- public org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManager.LockResult acquireSessionOwnership(
- String realId, boolean newLock) throws TimeoutException, InterruptedException
- {
- // FIXME -- re-evaluate
- return LockResult.UNSUPPORTED;
- }
-
- public void relinquishSessionOwnership(String realId, boolean remove)
- {
- // no-op
- }
-
}
More information about the jboss-cvs-commits
mailing list