[jboss-cvs] JBossAS SVN: r77676 - in projects/cluster: ha-server-cache-jbc/trunk/.settings and 9 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sat Aug 30 02:04:46 EDT 2008
Author: bstansberry at jboss.com
Date: 2008-08-30 02:04:46 -0400 (Sat, 30 Aug 2008)
New Revision: 77676
Added:
projects/cluster/ha-server-cache-jbc/trunk/src/main/java/org/jboss/ha/framework/server/HAPartitionCacheHandlerImpl.java
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/ha/framework/
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/ha/framework/server/
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/ha/framework/server/spi/
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/ha/framework/server/spi/HAPartitionCacheHandler.java
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/ha/framework/server/spi/ManagedDistributedState.java
Modified:
projects/cluster/ha-server-cache-jbc/trunk/.classpath
projects/cluster/ha-server-cache-jbc/trunk/.settings/org.eclipse.jdt.core.prefs
projects/cluster/ha-server-cache-jbc/trunk/pom.xml
projects/cluster/ha-server-cache-jbc/trunk/src/main/java/org/jboss/ha/framework/server/DistributedStateImpl.java
projects/cluster/ha-server-cache-jbc/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/impl/jbc/CacheListener.java
projects/cluster/ha-server-cache-jbc/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/impl/jbc/JBossCacheService.java
projects/cluster/ha-server-cache-spi/trunk/.classpath
projects/cluster/ha-server-cache-spi/trunk/.settings/org.eclipse.jdt.core.prefs
projects/cluster/ha-server-cache-spi/trunk/pom.xml
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/BatchingManager.java
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributableSession.java
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributableSessionMetadata.java
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributableSessionTimestamp.java
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributedCacheManager.java
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributedCacheManagerFactory.java
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributedCacheManagerFactoryFactory.java
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/FieldBasedDistributedCacheManager.java
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/LocalDistributableSessionManager.java
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/TomcatClusterConfig.java
Log:
[JBCLUSTER-211] Add missing abstractions; various code/doc cleanups
Modified: projects/cluster/ha-server-cache-jbc/trunk/.classpath
===================================================================
--- projects/cluster/ha-server-cache-jbc/trunk/.classpath 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-jbc/trunk/.classpath 2008-08-30 06:04:46 UTC (rev 77676)
@@ -4,12 +4,12 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="M2_REPO/org/apache/ant/ant/1.7.0/ant-1.7.0.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/ant/ant-launcher/1.7.0/ant-launcher-1.7.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.8.0.GA/javassist-3.8.0.GA.jar" sourcepath="M2_REPO/javassist/javassist/3.8.0.GA/javassist-3.8.0.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/aop/jboss-aop/2.0.0.CR16/jboss-aop-2.0.0.CR16.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-common-core/2.2.7.GA/jboss-common-core-2.2.7.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-common-core/2.2.7.GA/jboss-common-core-2.2.7.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.7.1.GA/javassist-3.7.1.GA.jar" sourcepath="M2_REPO/javassist/javassist/3.7.1.GA/javassist-3.7.1.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/aop/jboss-aop/2.0.0.CR11/jboss-aop-2.0.0.CR11.jar" sourcepath="M2_REPO/org/jboss/aop/jboss-aop/2.0.0.CR11/jboss-aop-2.0.0.CR11-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-common-core/2.2.8.GA/jboss-common-core-2.2.8.GA.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/cluster/jboss-ha-client/1.1.0.CR4/jboss-ha-client-1.1.0.CR4.jar" sourcepath="M2_REPO/org/jboss/cluster/jboss-ha-client/1.1.0.CR4/jboss-ha-client-1.1.0.CR4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/cluster/jboss-ha-server-api/1.1.0.CR4/jboss-ha-server-api-1.1.0.CR4.jar" sourcepath="M2_REPO/org/jboss/cluster/jboss-ha-server-api/1.1.0.CR4/jboss-ha-server-api-1.1.0.CR4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/cluster/jboss-ha-server-cache-spi/1.0.0-SNAPSHOT/jboss-ha-server-cache-spi-1.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/cluster/jboss-ha-server-cache-spi/1.0.0-SNAPSHOT/jboss-ha-server-cache-spi-1.0.0-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/cluster/jboss-ha-server-api/1.1.0-SNAPSHOT/jboss-ha-server-api-1.1.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/cluster/jboss-ha-server-api/1.1.0-SNAPSHOT/jboss-ha-server-api-1.1.0-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/cluster/jboss-ha-server-cache-spi/1.1.0-SNAPSHOT/jboss-ha-server-cache-spi-1.1.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/cluster/jboss-ha-server-cache-spi/1.1.0-SNAPSHOT/jboss-ha-server-cache-spi-1.1.0-SNAPSHOT-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/jboss-mdr/2.0.0.Beta15/jboss-mdr-2.0.0.Beta15.jar" sourcepath="M2_REPO/org/jboss/jboss-mdr/2.0.0.Beta15/jboss-mdr-2.0.0.Beta15-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/jboss-reflect/2.0.0.Beta12/jboss-reflect-2.0.0.Beta12.jar" sourcepath="M2_REPO/org/jboss/jboss-reflect/2.0.0.Beta12/jboss-reflect-2.0.0.Beta12-sources.jar"/>
@@ -21,5 +21,6 @@
<classpathentry kind="var" path="M2_REPO/jgroups/jgroups/2.6.3.GA/jgroups-2.6.3.GA.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/naming/jnp-client/5.0.0.CR2/jnp-client-5.0.0.CR2.jar" sourcepath="M2_REPO/org/jboss/naming/jnp-client/5.0.0.CR2/jnp-client-5.0.0.CR2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/transaction/jta/1.1/jta-1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar" sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/qdox/qdox/1.6/qdox-1.6.jar" sourcepath="M2_REPO/qdox/qdox/1.6/qdox-1.6-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/trove/trove/2.1.1/trove-2.1.1.jar"/>
</classpath>
\ No newline at end of file
Modified: projects/cluster/ha-server-cache-jbc/trunk/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/cluster/ha-server-cache-jbc/trunk/.settings/org.eclipse.jdt.core.prefs 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-jbc/trunk/.settings/org.eclipse.jdt.core.prefs 2008-08-30 06:04:46 UTC (rev 77676)
@@ -1,4 +1,4 @@
-#Fri Aug 29 20:33:26 CDT 2008
+#Fri Aug 29 23:38:49 CDT 2008
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.5
Modified: projects/cluster/ha-server-cache-jbc/trunk/pom.xml
===================================================================
--- projects/cluster/ha-server-cache-jbc/trunk/pom.xml 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-jbc/trunk/pom.xml 2008-08-30 06:04:46 UTC (rev 77676)
@@ -8,7 +8,7 @@
<groupId>org.jboss.cluster</groupId>
<artifactId>jboss-ha-server-cache-jbc</artifactId>
<packaging>jar</packaging>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<name>JBoss AS - JBoss Cache Integration Implementation</name>
<url>http://www.jboss.org</url>
<description>A JBoss Cache-based implementation of the SPIs defined in ha-server-cache-spi</description>
@@ -28,7 +28,7 @@
</scm>
<properties>
- <version.jboss.ha.server.cache.spi>1.0.0-SNAPSHOT</version.jboss.ha.server.cache.spi>
+ <version.jboss.ha.server.cache.spi>1.1.0-SNAPSHOT</version.jboss.ha.server.cache.spi>
<version.jboss.ha.server.api>1.1.0-SNAPSHOT</version.jboss.ha.server.api>
<version.jboss.common.core>2.2.8.GA</version.jboss.common.core>
<version.jboss.logging.spi>2.0.5.GA</version.jboss.logging.spi>
Modified: projects/cluster/ha-server-cache-jbc/trunk/src/main/java/org/jboss/ha/framework/server/DistributedStateImpl.java
===================================================================
--- projects/cluster/ha-server-cache-jbc/trunk/src/main/java/org/jboss/ha/framework/server/DistributedStateImpl.java 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-jbc/trunk/src/main/java/org/jboss/ha/framework/server/DistributedStateImpl.java 2008-08-30 06:04:46 UTC (rev 77676)
@@ -41,6 +41,7 @@
import org.jboss.cache.notifications.annotation.NodeModified;
import org.jboss.cache.notifications.event.NodeModifiedEvent;
import org.jboss.cache.notifications.event.NodeModifiedEvent.ModificationType;
+import org.jboss.ha.framework.server.spi.ManagedDistributedState;
import org.jboss.logging.Logger;
/**
@@ -49,10 +50,11 @@
* @author <a href="mailto:sacha.labourey at cogito-info.ch">Sacha Labourey</a>.
* @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>.
* @author Scott.Stark at jboss.org
- * @version $Revision$
+ * @version $Revision:77673 $
*/
@CacheListener
-public class DistributedStateImpl implements DistributedStateImplMBean
+public class DistributedStateImpl
+ implements ManagedDistributedState, DistributedStateImplMBean
{
// Constants -----------------------------------------------------
@@ -69,26 +71,40 @@
protected String name = null;
protected Cache cache;
protected boolean replAsync;
+ protected HAPartitionCacheHandlerImpl cacheHandler;
+ protected boolean cacheFromHandler = false;
// Public --------------------------------------------------------
- protected void createService()
+ public void createService() throws Exception
{
}
- public void startService()
+ public void startService() throws Exception
{
if (this.cache == null)
{
- throw new IllegalStateException("No clustered cache available");
+ if (cacheHandler == null)
+ {
+ throw new IllegalStateException("No clustered cache available");
+ }
+ cacheHandler.acquireCache();
+ cacheHandler.startCache();
+ setClusteredCache(cacheHandler.getCache());
+ cacheFromHandler = true;
}
this.cache.addCacheListener(this);
}
- public void stopService()
- {
+ public void stopService() throws Exception
+ {
this.cache.removeCacheListener(this);
+
+ if (cacheFromHandler)
+ {
+ cacheHandler.releaseCache();
+ }
}
public void destroyService() throws Exception
@@ -175,7 +191,7 @@
{
this.cache = cache;
if (this.cache != null)
- {
+ {
CacheMode cm = cache.getConfiguration().getCacheMode();
if (CacheMode.REPL_ASYNC == cm)
{
@@ -189,11 +205,25 @@
{
throw new IllegalStateException("Cache must be configured for replication, not " + cm);
}
+
+ cacheFromHandler = false;
}
}
+ public HAPartitionCacheHandlerImpl getCacheHandler()
+ {
+ return cacheHandler;
+ }
+
+ public void setCacheHandler(HAPartitionCacheHandlerImpl cacheHandler)
+ {
+ this.cacheHandler = cacheHandler;
+ }
+
+
+
+
// DistributedState implementation ----------------------------------------------
-
/*
* (non-Javadoc)
*
Added: projects/cluster/ha-server-cache-jbc/trunk/src/main/java/org/jboss/ha/framework/server/HAPartitionCacheHandlerImpl.java
===================================================================
--- projects/cluster/ha-server-cache-jbc/trunk/src/main/java/org/jboss/ha/framework/server/HAPartitionCacheHandlerImpl.java (rev 0)
+++ projects/cluster/ha-server-cache-jbc/trunk/src/main/java/org/jboss/ha/framework/server/HAPartitionCacheHandlerImpl.java 2008-08-30 06:04:46 UTC (rev 77676)
@@ -0,0 +1,132 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.ha.framework.server;
+
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheManager;
+import org.jboss.cache.CacheStatus;
+import org.jboss.ha.framework.server.spi.HAPartitionCacheHandler;
+import org.jgroups.ChannelFactory;
+
+/**
+ * Standard implementation of HAPartitionCacheHandler
+ *
+ * @author Brian Stansberry
+ */
+public class HAPartitionCacheHandlerImpl implements HAPartitionCacheHandler
+{
+ private CacheManager cacheManager;
+ private String cacheConfigName;
+ private Cache cache;
+
+ // CacheHandler ------------------------------------------------------------
+
+ public void acquireCache() throws Exception
+ {
+ if (cache == null)
+ {
+ validateState();
+
+ cache = cacheManager.getCache(cacheConfigName, true);
+ }
+ }
+
+ public void startCache() throws Exception
+ {
+ if (cache == null)
+ {
+ throw new IllegalStateException("Must acquire cache before starting it");
+ }
+
+ if (cache.getCacheStatus() != CacheStatus.STARTED)
+ cache.start();
+ }
+
+ public void releaseCache() throws Exception
+ {
+ validateState();
+
+ cacheManager.releaseCache(cacheConfigName);
+ cache = null;
+ }
+
+ public String getCacheConfigName()
+ {
+ return cacheConfigName;
+ }
+
+ public String getChannelStackName()
+ {
+ if (cache == null)
+ {
+ throw new IllegalStateException("Must acquire cache before getting channel stack name");
+ }
+ return cache.getConfiguration().getMultiplexerStack();
+ }
+
+ public ChannelFactory getCacheChannelFactory()
+ {
+ if (cache == null)
+ {
+ throw new IllegalStateException("Must acquire cache before getting cache channel factory");
+ }
+ return cache.getConfiguration().getRuntimeConfig().getMuxChannelFactory();
+ }
+
+ // Properties -------------------------------------------------------------
+
+ public void setCacheConfigName(String cacheConfigName)
+ {
+ this.cacheConfigName = cacheConfigName;
+ }
+
+ public CacheManager getCacheManager()
+ {
+ return cacheManager;
+ }
+
+ public void setCacheManager(CacheManager cacheManager)
+ {
+ this.cacheManager = cacheManager;
+ }
+
+ public Cache getCache()
+ {
+ return cache;
+ }
+
+ // Private -----------------------------------------------------------------
+
+ private void validateState()
+ {
+ if (cacheManager == null)
+ {
+ throw new IllegalStateException("Must set cacheManager");
+ }
+
+ if (cacheConfigName == null)
+ {
+ throw new IllegalStateException("Must set cacheConfigName");
+ }
+ }
+}
Modified: projects/cluster/ha-server-cache-jbc/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/impl/jbc/CacheListener.java
===================================================================
--- projects/cluster/ha-server-cache-jbc/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/impl/jbc/CacheListener.java 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-jbc/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/impl/jbc/CacheListener.java 2008-08-30 06:04:46 UTC (rev 77676)
@@ -31,6 +31,7 @@
import org.jboss.logging.Logger;
import org.jboss.web.tomcat.service.session.distributedcache.spi.DistributableSessionMetadata;
import org.jboss.web.tomcat.service.session.distributedcache.spi.DistributableSessionTimestamp;
+import org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManager;
import org.jboss.web.tomcat.service.session.distributedcache.spi.LocalDistributableSessionManager;
/**
@@ -114,7 +115,7 @@
// Query if we have version value in the distributed cache.
// If we have a version value, compare the version and invalidate if necessary.
Map data = event.getData();
- Integer version = (Integer) data.get(JBossCacheService.VERSION_KEY);
+ Integer version = (Integer) data.get(DistributedCacheManager.VERSION_KEY);
if(version != null)
{
String realId = getIdFromFqn(fqn, isBuddy);
@@ -122,8 +123,8 @@
// Notify the manager that a session has been updated
boolean updated = manager_.sessionChangedInDistributedCache(realId, owner,
version.intValue(),
- (DistributableSessionTimestamp) data.get(JBossCacheService.TIMESTAMP_KEY),
- (DistributableSessionMetadata) data.get(JBossCacheService.METADATA_KEY));
+ (DistributableSessionTimestamp) data.get(DistributedCacheManager.TIMESTAMP_KEY),
+ (DistributableSessionMetadata) data.get(DistributedCacheManager.METADATA_KEY));
if (!updated && !isBuddy)
{
log_.warn("Possible concurrency problem: Replicated version id " +
Modified: projects/cluster/ha-server-cache-jbc/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/impl/jbc/JBossCacheService.java
===================================================================
--- projects/cluster/ha-server-cache-jbc/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/impl/jbc/JBossCacheService.java 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-jbc/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/impl/jbc/JBossCacheService.java 2008-08-30 06:04:46 UTC (rev 77676)
@@ -75,10 +75,6 @@
public static final Fqn BUDDY_BACKUP_FQN = BuddyManager.BUDDY_BACKUP_SUBTREE_FQN;
public static final String SESSION = "JSESSION";
public static final String ATTRIBUTE = "ATTRIBUTE";
- public static final String VERSION_KEY = "V";
- public static final String TIMESTAMP_KEY = "T";
- public static final String METADATA_KEY = "M";
- public static final String ATTRIBUTE_KEY = "A";
public static final String FQN_DELIMITER = "/";
Modified: projects/cluster/ha-server-cache-spi/trunk/.classpath
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/.classpath 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-spi/trunk/.classpath 2008-08-30 06:04:46 UTC (rev 77676)
@@ -15,6 +15,7 @@
<classpathentry kind="var" path="M2_REPO/org/jboss/remoting/jboss-remoting/2.4.0.CR2/jboss-remoting-2.4.0.CR2.jar" sourcepath="M2_REPO/org/jboss/remoting/jboss-remoting/2.4.0.CR2/jboss-remoting-2.4.0.CR2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/aspects/jboss-remoting-aspects/1.0.1.CR2/jboss-remoting-aspects-1.0.1.CR2.jar"/>
<classpathentry kind="var" path="M2_REPO/jboss/jboss-serialization/1.0.3.GA/jboss-serialization-1.0.3.GA.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jgroups/jgroups/2.6.3.GA/jgroups-2.6.3.GA.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/naming/jnp-client/5.0.0.CR2/jnp-client-5.0.0.CR2.jar" sourcepath="M2_REPO/org/jboss/naming/jnp-client/5.0.0.CR2/jnp-client-5.0.0.CR2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/qdox/qdox/1.6/qdox-1.6.jar" sourcepath="M2_REPO/qdox/qdox/1.6/qdox-1.6-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/trove/trove/2.1.1/trove-2.1.1.jar"/>
Modified: projects/cluster/ha-server-cache-spi/trunk/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/.settings/org.eclipse.jdt.core.prefs 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-spi/trunk/.settings/org.eclipse.jdt.core.prefs 2008-08-30 06:04:46 UTC (rev 77676)
@@ -1,4 +1,4 @@
-#Fri Aug 29 21:43:49 CDT 2008
+#Fri Aug 29 23:36:08 CDT 2008
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.5
Modified: projects/cluster/ha-server-cache-spi/trunk/pom.xml
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/pom.xml 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-spi/trunk/pom.xml 2008-08-30 06:04:46 UTC (rev 77676)
@@ -8,7 +8,7 @@
<groupId>org.jboss.cluster</groupId>
<artifactId>jboss-ha-server-cache-spi</artifactId>
<packaging>jar</packaging>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<name>JBoss AS - JBoss Cache Integration SPI</name>
<url>http://www.jboss.org</url>
<description>SPI for JBoss AS Clustered Caching Services</description>
@@ -29,6 +29,8 @@
<properties>
<version.jboss.ha.server.api>1.1.0-SNAPSHOT</version.jboss.ha.server.api>
+ <!-- This should be [2.6.2,3.0.0) but maven complains about it -->
+ <version.jgroups>2.6.3.GA</version.jgroups>
<version.jboss.logging.spi>2.0.5.GA</version.jboss.logging.spi>
<version.org.jboss.naming>5.0.0.CR2</version.org.jboss.naming>
<version.jboss.serialization>1.0.3.GA</version.jboss.serialization>
@@ -58,6 +60,18 @@
</dependency>
<dependency>
+ <groupId>jgroups</groupId>
+ <artifactId>jgroups</artifactId>
+ <version>${version.jgroups}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-spi</artifactId>
<version>${version.jboss.logging.spi}</version>
Added: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/ha/framework/server/spi/HAPartitionCacheHandler.java
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/ha/framework/server/spi/HAPartitionCacheHandler.java (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/ha/framework/server/spi/HAPartitionCacheHandler.java 2008-08-30 06:04:46 UTC (rev 77676)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.ha.framework.server.spi;
+
+import org.jgroups.ChannelFactory;
+
+/**
+ * Handles basic lifecycle operations on HAPartition's cache without
+ * exposing the cache.
+ *
+ * @author Brian Stansberry
+ */
+public interface HAPartitionCacheHandler
+{
+ void acquireCache() throws Exception;
+
+ void startCache() throws Exception;
+
+ void releaseCache() throws Exception;
+
+ String getCacheConfigName();
+
+ String getChannelStackName();
+
+ ChannelFactory getCacheChannelFactory();
+}
Added: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/ha/framework/server/spi/ManagedDistributedState.java
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/ha/framework/server/spi/ManagedDistributedState.java (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/ha/framework/server/spi/ManagedDistributedState.java 2008-08-30 06:04:46 UTC (rev 77676)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.ha.framework.server.spi;
+
+import org.jboss.ha.framework.interfaces.DistributedState;
+
+/**
+ * DistributedState subinterface that exposes lifecycle methods to
+ * allow its owning HAPartition to control it.
+ *
+ * @author Brian Stansberry
+ *
+ */
+public interface ManagedDistributedState extends DistributedState
+{
+ /** Create the service */
+ void createService() throws Exception;
+ /** Start the service */
+ void startService() throws Exception;
+ /** Stop the service */
+ void stopService() throws Exception;
+ /** Destroy the service */
+ void destroyService() throws Exception;
+}
Modified: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/BatchingManager.java
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/BatchingManager.java 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/BatchingManager.java 2008-08-30 06:04:46 UTC (rev 77676)
@@ -23,8 +23,9 @@
package org.jboss.web.tomcat.service.session.distributedcache.spi;
/**
+ * Abstraction of the batching calls used to control the distributed cache.
+ *
* @author Brian Stansberry
- *
*/
public interface BatchingManager
{
Modified: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributableSession.java
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributableSession.java 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributableSession.java 2008-08-30 06:04:46 UTC (rev 77676)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.web.tomcat.service.session.distributedcache.spi;
import java.util.Map;
Modified: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributableSessionMetadata.java
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributableSessionMetadata.java 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributableSessionMetadata.java 2008-08-30 06:04:46 UTC (rev 77676)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.web.tomcat.service.session.distributedcache.spi;
import java.io.Serializable;
Modified: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributableSessionTimestamp.java
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributableSessionTimestamp.java 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributableSessionTimestamp.java 2008-08-30 06:04:46 UTC (rev 77676)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.web.tomcat.service.session.distributedcache.spi;
import java.io.Serializable;
Modified: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributedCacheManager.java
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributedCacheManager.java 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributedCacheManager.java 2008-08-30 06:04:46 UTC (rev 77676)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.web.tomcat.service.session.distributedcache.spi;
import java.util.Map;
@@ -3,8 +25,27 @@
import java.util.Set;
-
+/**
+ * SPI implemented by the distributed caching layer.
+ *
+ * @author Brian Stansberry
+ * @version $Revision: $
+ */
public interface DistributedCacheManager
{
+ /** Key in the map returned by {@link #getSessionData(String, String)} */
+ public static final String VERSION_KEY = "V";
+ /** Key in the map returned by {@link #getSessionData(String, String)} */
+ public static final String TIMESTAMP_KEY = "T";
+ /** Key in the map returned by {@link #getSessionData(String, String)} */
+ public static final String METADATA_KEY = "M";
+ /** Key in the map returned by {@link #getSessionData(String, String)} */
+ public static final String ATTRIBUTE_KEY = "A";
+ /**
+ * Configures and starts the distributed caching layer.
+ *
+ * @param tcl
+ * @param manager
+ */
void start(ClassLoader tcl, LocalDistributableSessionManager manager);
Modified: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributedCacheManagerFactory.java
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributedCacheManagerFactory.java 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributedCacheManagerFactory.java 2008-08-30 06:04:46 UTC (rev 77676)
@@ -23,6 +23,8 @@
package org.jboss.web.tomcat.service.session.distributedcache.spi;
/**
+ * Factory for obtaining a DistributedCacheManager.
+ *
* @author Brian Stansberry
*
*/
Modified: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributedCacheManagerFactoryFactory.java
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributedCacheManagerFactoryFactory.java 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributedCacheManagerFactoryFactory.java 2008-08-30 06:04:46 UTC (rev 77676)
@@ -27,6 +27,11 @@
import java.util.HashMap;
import java.util.Map;
+/**
+ * Factory for obtaining a DistributedCacheManagerFactory.
+ *
+ * @author Brian Stansberry
+ */
public class DistributedCacheManagerFactoryFactory
{
/**
Modified: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/FieldBasedDistributedCacheManager.java
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/FieldBasedDistributedCacheManager.java 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/FieldBasedDistributedCacheManager.java 2008-08-30 06:04:46 UTC (rev 77676)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.web.tomcat.service.session.distributedcache.spi;
import java.util.Set;
@@ -2,8 +23,12 @@
-
+/**
+ * DistributedCacheManager subinterface for FIELD granularity webapps.
+ *
+ * @author Brian Stansberry
+ */
public interface FieldBasedDistributedCacheManager extends DistributedCacheManager
{
/**
- * store the pojo instance in the cache. Note that this is for the aop cache.
+ * Store the pojo instance in the cache. Note that this is for the aop cache.
* THe pojo needs to be "aspectized".
Modified: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/LocalDistributableSessionManager.java
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/LocalDistributableSessionManager.java 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/LocalDistributableSessionManager.java 2008-08-30 06:04:46 UTC (rev 77676)
@@ -1,11 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.web.tomcat.service.session.distributedcache.spi;
+/**
+ * Callback interface to allow the distributed caching layer to invoke
+ * upon the local session manager.
+ *
+ * @author Brian Stansberry
+ * @version $Revision: $
+ */
public interface LocalDistributableSessionManager
{
+ /**
+ * Gets whether the webapp is configured for passivation.
+ *
+ * @return <code>true</code> if passivation is enabled
+ */
boolean isPassivationEnabled();
+ /**
+ * Gets the name of the Tomcat Context.
+ *
+ * @return the context name
+ */
String getContextName();
+ /**
+ * Gets the name of the Tomcat Host.
+ *
+ * @return the name of the host
+ */
String getHostName();
/**
@@ -25,6 +68,9 @@
*/
void notifyLocalAttributeModification(String realId);
+ /**
+ * Notification that a previously passivated session has been activated.
+ */
void sessionActivated();
/**
Modified: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/TomcatClusterConfig.java
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/TomcatClusterConfig.java 2008-08-30 06:02:59 UTC (rev 77675)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/TomcatClusterConfig.java 2008-08-30 06:04:46 UTC (rev 77676)
@@ -28,8 +28,9 @@
import javax.management.MBeanServer;
/**
+ * Metadata about the environment of a TomcatClusterDistributedCacheManagerFactory.
+ *
* @author Brian Stansberry
- *
*/
public interface TomcatClusterConfig
{
More information about the jboss-cvs-commits
mailing list