[jboss-cvs] JBossAS SVN: r77672 - in projects/cluster/ha-server-cache-spi/trunk: .settings and 14 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Aug 29 22:46:27 EDT 2008
Author: bstansberry at jboss.com
Date: 2008-08-29 22:46:26 -0400 (Fri, 29 Aug 2008)
New Revision: 77672
Added:
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/ha/
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/ha/jndi/
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/ha/jndi/spi/
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/ha/jndi/spi/DistributedTreeManager.java
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/
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/ClusteringNotSupportedException.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/JBossSerializationObjectStreamSource.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/SessionSerializationFactory.java
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/TomcatClusterDistributedCacheManagerFactory.java
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/sso/
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/sso/spi/
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/sso/spi/FullyQualifiedSessionId.java
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/sso/spi/SSOClusterManager.java
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/sso/spi/SSOCredentials.java
projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/sso/spi/SSOLocalManager.java
Modified:
projects/cluster/ha-server-cache-spi/trunk/
projects/cluster/ha-server-cache-spi/trunk/.classpath
projects/cluster/ha-server-cache-spi/trunk/.project
projects/cluster/ha-server-cache-spi/trunk/.settings/org.eclipse.jdt.core.prefs
projects/cluster/ha-server-cache-spi/trunk/pom.xml
Log:
[JBCLUSTER-211] Remove the JBC integration SPIs and impls from the AS code base
Property changes on: projects/cluster/ha-server-cache-spi/trunk
___________________________________________________________________
Name: svn:ignore
+ target
Modified: projects/cluster/ha-server-cache-spi/trunk/.classpath
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/.classpath 2008-08-30 00:41:44 UTC (rev 77671)
+++ projects/cluster/ha-server-cache-spi/trunk/.classpath 2008-08-30 02:46:26 UTC (rev 77672)
@@ -6,17 +6,16 @@
<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.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.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/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-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/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"/>
<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/org/jboss/cache/jbosscache-core/2.2.0.GA/jbosscache-core-2.2.0.GA.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/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"/>
</classpath>
\ No newline at end of file
Modified: projects/cluster/ha-server-cache-spi/trunk/.project
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/.project 2008-08-30 00:41:44 UTC (rev 77671)
+++ projects/cluster/ha-server-cache-spi/trunk/.project 2008-08-30 02:46:26 UTC (rev 77672)
@@ -1,17 +1,13 @@
-<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>jboss-ha-server-cache-spi</name>
- <comment>SPI for JBoss AS Clustered Caching Services</comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+ <name>jboss-ha-server-cache-spi</name>
+ <comment>SPI for JBoss AS Clustered Caching Services</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
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 00:41:44 UTC (rev 77671)
+++ projects/cluster/ha-server-cache-spi/trunk/.settings/org.eclipse.jdt.core.prefs 2008-08-30 02:46:26 UTC (rev 77672)
@@ -1,4 +1,4 @@
-#Fri Aug 29 17:07:43 CDT 2008
+#Fri Aug 29 21:43: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-spi/trunk/pom.xml
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/pom.xml 2008-08-30 00:41:44 UTC (rev 77671)
+++ projects/cluster/ha-server-cache-spi/trunk/pom.xml 2008-08-30 02:46:26 UTC (rev 77672)
@@ -28,10 +28,10 @@
</scm>
<properties>
- <version.jboss.ha.server.api>1.1.0.CR4</version.jboss.ha.server.api>
- <version.jboss.common.core>2.2.7.GA</version.jboss.common.core>
+ <version.jboss.ha.server.api>1.1.0-SNAPSHOT</version.jboss.ha.server.api>
<version.jboss.logging.spi>2.0.5.GA</version.jboss.logging.spi>
- <version.jboss.cache>2.2.0.GA</version.jboss.cache>
+ <version.org.jboss.naming>5.0.0.CR2</version.org.jboss.naming>
+ <version.jboss.serialization>1.0.3.GA</version.jboss.serialization>
<version.junit>3.8.1</version.junit>
</properties>
@@ -56,49 +56,41 @@
<artifactId>jboss-ha-server-api</artifactId>
<version>${version.jboss.ha.server.api}</version>
</dependency>
+
<dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- <version>${version.jboss.common.core}</version>
- </dependency>
- <dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-spi</artifactId>
<version>${version.jboss.logging.spi}</version>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.naming</groupId>
+ <artifactId>jnp-client</artifactId>
+ <version>${version.org.jboss.naming}</version>
+ </dependency>
<dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- <version>${version.jboss.cache}</version>
- <optional>true</optional>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-serialization</artifactId>
+ <version>${version.jboss.serialization}</version>
<exclusions>
<exclusion>
- <groupId>jgroups</groupId>
- <artifactId>jgroups</artifactId>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
</exclusion>
- <exclusion>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
</exclusions>
</dependency>
<!-- Test dependencies -->
+ <!--
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${version.junit}</version>
<scope>test</scope>
</dependency>
+ -->
+
</dependencies>
</project>
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/ha/jndi/spi/DistributedTreeManager.java (from rev 77666, trunk/cluster/src/main/org/jboss/ha/jndi/spi/DistributedTreeManager.java)
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/ha/jndi/spi/DistributedTreeManager.java (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/ha/jndi/spi/DistributedTreeManager.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +1,80 @@
+/*
+ * 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.jndi.spi;
+
+import java.util.Collection;
+
+import javax.naming.Binding;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NameClassPair;
+import javax.naming.NamingException;
+
+import org.jnp.interfaces.Naming;
+
+/**
+ * Manages distributed tree operations for HAJNDI.
+ *
+ * @author Brian Stansberry
+ */
+public interface DistributedTreeManager
+{
+ /** Initializes the DistributedTreeManager */
+ void init();
+
+ /** Shuts down the DistributedTreeManager */
+ void shutdown();
+
+ /** Bind an object in the distribute tree */
+ void bind(Name name, Object obj, String className) throws NamingException;
+
+ /** Re-bind an object in the distribute tree */
+ void rebind(Name name, Object obj, String className) throws NamingException;
+
+ /** Unbind an object from the distributed tree */
+ void unbind(Name name) throws NamingException;
+
+ /**
+ * Lookup an object in the distributed tree. Does not throw
+ * NameNotFoundException if nothing is bound under <code>name</code>;
+ * instead it returns <code>null</code>.
+ *
+ * @param name the name
+ * @return the object bound or <code>null</code>
+ */
+ Object lookup(Name name) throws NamingException;
+
+ /** List the binding in the distributed tree */
+ Collection<NameClassPair> list(Name name) throws NamingException;
+
+ /** List the bindings in the distributed tree */
+ Collection<Binding> listBindings(Name name) throws NamingException;
+
+ /** Create a subcontext in the distributed tree */
+ Context createSubcontext(Name name) throws NamingException;
+
+ /** Get the Naming object relative to which context's are created */
+ Naming getHAStub();
+
+ /** Set the Naming object relative to which context's are created */
+ void setHAStub(Naming stub);
+}
\ No newline at end of file
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/BatchingManager.java (from rev 77655, trunk/tomcat/src/main/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 (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/BatchingManager.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +1,35 @@
+/*
+ * 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;
+
+/**
+ * @author Brian Stansberry
+ *
+ */
+public interface BatchingManager
+{
+ boolean isBatchInProgress() throws Exception;
+ void startBatch() throws Exception;
+ void setBatchRollbackOnly() throws Exception;
+ void endBatch();
+}
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/ClusteringNotSupportedException.java (from rev 77655, trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/distributedcache/spi/ClusteringNotSupportedException.java)
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/ClusteringNotSupportedException.java (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/ClusteringNotSupportedException.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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;
+
+
+/**
+ * This exception is thrown when the clustered HTTPSession-service
+ * is not found
+ *
+ * @author Thomas Peuss <jboss at peuss.de>
+ * @version $Revision: 56007 $
+ */
+public class ClusteringNotSupportedException extends Exception
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -2365801349845482947L;
+
+ public ClusteringNotSupportedException(String message)
+ {
+ super(message);
+ }
+
+ public ClusteringNotSupportedException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+}
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributableSession.java (from rev 77655, trunk/tomcat/src/main/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 (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributableSession.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +1,40 @@
+package org.jboss.web.tomcat.service.session.distributedcache.spi;
+
+import java.util.Map;
+
+/**
+ * Interface implemented by a <code>Session</code> implementation that
+ * can be handled by a DistributedCacheManager.
+ *
+ * @author Brian Stansberry
+ * @version $Revision: $
+ */
+public interface DistributableSession
+{
+ String getIdInternal();
+
+ int getVersion();
+
+ boolean getMustReplicateTimestamp();
+
+ DistributableSessionTimestamp getSessionTimestamp();
+
+ DistributableSessionMetadata getSessionMetadata();
+
+ Map<String, Object> getSessionAttributeMap();
+
+ void update(Integer version, DistributableSessionTimestamp timestamp, DistributableSessionMetadata metadata, Map attributes);
+
+ boolean isSessionMetadataDirty();
+
+ boolean isSessionAttributeMapDirty();
+
+ boolean getCreateRegionForSession();
+
+ boolean needRegionForSession();
+
+ boolean hasRegionForSession();
+
+ void createdRegionForSession();
+
+}
\ No newline at end of file
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributableSessionMetadata.java (from rev 77655, trunk/tomcat/src/main/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 (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributableSessionMetadata.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +1,64 @@
+package org.jboss.web.tomcat.service.session.distributedcache.spi;
+
+import java.io.Serializable;
+
+/**
+ * Encapsulates the replicated metadata for a session. The wrapped data
+ * can be mutated, allowing the same object to always be stored in
+ * JBoss Cache. Always storing the same object avoids an earlier, no
+ * longer accurate, object being reverted into the cache during a
+ * transaction rollback.
+ */
+public class DistributableSessionMetadata implements Serializable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -6845914023373746866L;
+
+ private String id;
+ private long creationTime;
+ private int maxInactiveInterval;
+ private boolean isNew;
+ private boolean isValid;
+
+ public String getId()
+ {
+ return id;
+ }
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+ public long getCreationTime()
+ {
+ return creationTime;
+ }
+ public void setCreationTime(long creationTime)
+ {
+ this.creationTime = creationTime;
+ }
+ public int getMaxInactiveInterval()
+ {
+ return maxInactiveInterval;
+ }
+ public void setMaxInactiveInterval(int maxInactiveInterval)
+ {
+ this.maxInactiveInterval = maxInactiveInterval;
+ }
+ public boolean isNew()
+ {
+ return isNew;
+ }
+ public void setNew(boolean isNew)
+ {
+ this.isNew = isNew;
+ }
+ public boolean isValid()
+ {
+ return isValid;
+ }
+ public void setValid(boolean isValid)
+ {
+ this.isValid = isValid;
+ }
+
+}
\ No newline at end of file
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributableSessionTimestamp.java (from rev 77655, trunk/tomcat/src/main/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 (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributableSessionTimestamp.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +1,28 @@
+package org.jboss.web.tomcat.service.session.distributedcache.spi;
+
+import java.io.Serializable;
+
+/**
+ * Encapsulates the "thisAccessedTime" timestamp. The wrapped timestamp long
+ * can be mutated, allowing the same object to always be stored in
+ * JBoss Cache. Always storing the same object avoids an earlier, no
+ * longer accurate, object being reverted into the cache during a
+ * transaction rollback.
+ */
+public class DistributableSessionTimestamp implements Serializable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 2317131983552715467L;
+
+ private long timestamp = 0L;
+
+ public long getTimestamp()
+ {
+ return timestamp;
+ }
+
+ public void setTimestamp(long timestamp)
+ {
+ this.timestamp = timestamp;
+ }
+}
\ No newline at end of file
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributedCacheManager.java (from rev 77655, trunk/tomcat/src/main/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 (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributedCacheManager.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +1,81 @@
+package org.jboss.web.tomcat.service.session.distributedcache.spi;
+
+import java.util.Map;
+import java.util.Set;
+
+
+public interface DistributedCacheManager
+{
+
+ void start(ClassLoader tcl, LocalDistributableSessionManager manager);
+
+ void stop();
+
+ /**
+ * Gets the BatchingManager.
+ */
+ BatchingManager getBatchingManager();
+
+ /**
+ * Loads any serialized data in the cache into the given session
+ * using its <code>readExternal</code> method.
+ *
+ * @return the session passed as <code>toLoad</code>, or
+ * <code>null</code> if the cache had no data stored
+ * under the given session id.
+ */
+ <T extends DistributableSession> T loadSession(String realId, T toLoad);
+
+ void putSession(String realId, DistributableSession session);
+
+ void removeSession(String realId, boolean removeRegion);
+
+ void removeSessionLocal(String realId, boolean removeRegion);
+
+ void removeSessionLocal(String realId, String dataOwner);
+
+ void evictSession(String realId);
+
+ void evictSession(String realId, String dataOwner);
+
+ Map getSessionData(String realId, String dataOwner);
+
+ Object getAttribute(String realId, String key);
+
+ void putAttribute(String realId, String key, Object value);
+
+ void putAttribute(String realId, Map map);
+
+ void removeAttributes(String realId);
+
+ Object removeAttribute(String realId, String key);
+
+ void removeAttributesLocal(String realId);
+
+ /**
+ * Obtain the keys associated with this fqn. Note that it is not the fqn children.
+ *
+ */
+ Set getAttributeKeys(String realId);
+
+ /**
+ * Return all attributes associated with this session id.
+ *
+ * @param realId the session id with any jvmRoute removed
+ * @return the attributes, or any empty Map if none are found.
+ */
+ Map getAttributes(String realId);
+
+ /**
+ * Gets the ids of all sessions in the underlying cache.
+ *
+ * @return Map<String, String> containing all of the session ids of sessions in the cache
+ * (with any jvmRoute removed) as keys, and the identifier of the data owner for
+ * the session as value (or a <code>null</code> value if buddy
+ * replication is not enabled.) Will not return <code>null</code>.
+ */
+ Map<String, String> getSessionIds();
+
+ boolean isPassivationEnabled();
+
+}
\ No newline at end of file
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributedCacheManagerFactory.java (from rev 77655, trunk/tomcat/src/main/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 (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributedCacheManagerFactory.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +1,34 @@
+/*
+ * 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;
+
+/**
+ * @author Brian Stansberry
+ *
+ */
+public interface DistributedCacheManagerFactory
+{
+ DistributedCacheManager getDistributedCacheManager(String cacheConfigName) throws ClusteringNotSupportedException;
+
+ FieldBasedDistributedCacheManager getFieldBasedDistributedCacheManager(String cacheConfigName) throws ClusteringNotSupportedException;
+}
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributedCacheManagerFactoryFactory.java (from rev 77655, trunk/tomcat/src/main/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 (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/DistributedCacheManagerFactoryFactory.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +1,162 @@
+/*
+ * 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.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.HashMap;
+import java.util.Map;
+
+public class DistributedCacheManagerFactoryFactory
+{
+ /**
+ * Default name of the class that {@link #getDistributedCacheManagerFactory()}
+ * will try to instantiate if no factory is injected.
+ */
+ public static final String DEFAULT_CLASS_NAME = "org.jboss.web.tomcat.service.session.distributedcache.impl.DistributedCacheManagerFactoryImpl";
+
+ /** Singleton */
+ private static final DistributedCacheManagerFactoryFactory instance = new DistributedCacheManagerFactoryFactory();
+
+ /** Gets the singleton instance. */
+ public static final DistributedCacheManagerFactoryFactory getInstance()
+ {
+ return instance;
+ }
+
+ private DistributedCacheManagerFactory distributedCacheManagerFactory;
+ private String factoryClassName = DEFAULT_CLASS_NAME;
+ private Map<TomcatClusterConfig, TomcatClusterDistributedCacheManagerFactory> tomcatClusterFactories =
+ new HashMap<TomcatClusterConfig, TomcatClusterDistributedCacheManagerFactory>();
+
+ /**
+ * Returns the factory, creating one if necessary by loading
+ * {@link #getFactoryClassName() the factory class} and invoking
+ * {@link Class#newInstance()}.
+ *
+ * @return the factory. Will not return <code>null</code>.
+ * @throws ClusteringNotSupportedException if there is a problem instantiating a factory
+ */
+ public synchronized DistributedCacheManagerFactory getDistributedCacheManagerFactory()
+ throws ClusteringNotSupportedException
+ {
+ if (distributedCacheManagerFactory == null)
+ {
+ distributedCacheManagerFactory = instantiateFactory();
+ factoryClassName = distributedCacheManagerFactory.getClass().getName();
+ }
+ return distributedCacheManagerFactory;
+ }
+
+ /**
+ * Allows injection of the DistributedCacheManagerFactory.
+ *
+ * @param distributedCacheManagerFactory the factory.
+ */
+ public synchronized void setDistributedCacheManagerFactory(DistributedCacheManagerFactory distributedCacheManagerFactory)
+ {
+ this.distributedCacheManagerFactory = distributedCacheManagerFactory;
+ }
+
+ public synchronized TomcatClusterDistributedCacheManagerFactory getTomcatClusterDistributedCacheManagerFactory(TomcatClusterConfig config)
+ throws ClusteringNotSupportedException
+ {
+ TomcatClusterDistributedCacheManagerFactory factory = tomcatClusterFactories.get(config);
+ if (factory == null)
+ {
+ factory = (TomcatClusterDistributedCacheManagerFactory) instantiateFactory();
+ tomcatClusterFactories.put(config, factory);
+ }
+ factory.setTomcatClusterConfig(config);
+ return factory;
+ }
+
+ public synchronized void setTomcatClusterDistributedCacheManagerFactory(TomcatClusterConfig config,
+ TomcatClusterDistributedCacheManagerFactory factory)
+ {
+ tomcatClusterFactories.put(config, factory);
+ }
+
+ /**
+ * Gets the class name of the factory; either the name of any existing
+ * factory, a class name injected via this property's setter, or
+ * {@link #DEFAULT_CLASS_NAME}.
+ *
+ * @return the factory class name; will not return <code>null</code>
+ */
+ public synchronized String getFactoryClassName()
+ {
+ return factoryClassName;
+ }
+
+ /**
+ * Allows injection of the factory class name.
+ *
+ * @param factoryClassName Fully qualified name of a class that implements
+ * {@link DistributedCacheManagerFactory} and exposes
+ * a public no-arg constructor.
+ */
+ public synchronized void setFactoryClassName(String factoryClassName)
+ {
+ this.factoryClassName = factoryClassName == null ? DEFAULT_CLASS_NAME : factoryClassName;
+ }
+
+ /**
+ * Loads the factory class and instantiates it.
+ *
+ * @throws ClusteringNotSupportedException
+ */
+ private DistributedCacheManagerFactory instantiateFactory() throws ClusteringNotSupportedException
+ {
+ String className = factoryClassName == null ? DEFAULT_CLASS_NAME : factoryClassName;
+ ClassLoader cl = getTCCL();
+ try
+ {
+ return (DistributedCacheManagerFactory) cl.loadClass(className).newInstance();
+ }
+ catch (Exception e)
+ {
+ throw new ClusteringNotSupportedException("Cannot create " + DistributedCacheManagerFactory.class.getSimpleName(), e);
+ }
+ }
+
+ private ClassLoader getTCCL()
+ {
+ if (System.getSecurityManager() == null)
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ else
+ {
+ return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
+
+ public Object run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+ }
+
+ private DistributedCacheManagerFactoryFactory() {}
+}
\ No newline at end of file
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/FieldBasedDistributedCacheManager.java (from rev 77655, trunk/tomcat/src/main/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 (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/FieldBasedDistributedCacheManager.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +1,54 @@
+package org.jboss.web.tomcat.service.session.distributedcache.spi;
+
+import java.util.Set;
+
+
+public interface FieldBasedDistributedCacheManager extends DistributedCacheManager
+{
+
+ /**
+ * store the pojo instance in the cache. Note that this is for the aop cache.
+ * THe pojo needs to be "aspectized".
+ *
+ * @param realId the session id with any jvmRoute removed
+ * @param key the attribute key
+ * @param pojo
+ * @param createRegion TODO
+ */
+ public abstract Object setPojo(String realId, String key, Object pojo, DistributableSession session);
+
+ /**
+ * Remove pojo from the underlying cache store.
+ * @param realId the session id with any jvmRoute removed
+ * @param key the attribute key
+ * @return pojo that just removed. Null if there none.
+ */
+ public abstract Object removePojo(String realId, String key);
+
+ /**
+ * Remove all the pojos from the underlying cache store locally
+ * without replication.
+ *
+ * @param realId the session id with any jvmRoute removed
+ */
+ public abstract void removePojosLocal(String realId);
+
+ /**
+ * Remove all the pojos from the underlying cache store locally
+ * without replication.
+ *
+ * @param realId the session id with any jvmRoute removed
+ */
+ public abstract void removePojoLocal(String realId, String key);
+
+ public abstract Set getPojoKeys(String realId);
+
+ /**
+ *
+ * @param realId the session id with any jvmRoute removed
+ * @param key the attribute key
+ * @return Pojo that is associated with the attribute
+ */
+ public abstract Object getPojo(String realId, String key);
+
+}
\ No newline at end of file
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/JBossSerializationObjectStreamSource.java (from rev 77655, trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/distributedcache/spi/JBossSerializationObjectStreamSource.java)
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/JBossSerializationObjectStreamSource.java (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/JBossSerializationObjectStreamSource.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +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;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.OutputStream;
+
+import org.jboss.ha.framework.interfaces.ObjectStreamSource;
+import org.jboss.serial.io.JBossObjectInputStreamSharedTree;
+import org.jboss.serial.io.JBossObjectOutputStreamSharedTree;
+
+/**
+ * {@link ObjectStreamSource} implementation that provides
+ * {@link JBossObjectInputStreamSharedTree} and {@link JBossObjectOutputStreamSharedTree}.
+ *
+ * @author Brian Stansberry
+ */
+public class JBossSerializationObjectStreamSource implements ObjectStreamSource
+{
+
+ public ObjectInput getObjectInput(InputStream input) throws IOException
+ {
+ return new JBossObjectInputStreamSharedTree(input);
+ }
+
+ public ObjectOutput getObjectOutput(OutputStream output) throws IOException
+ {
+ return new JBossObjectOutputStreamSharedTree(output);
+ }
+
+}
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/LocalDistributableSessionManager.java (from rev 77655, trunk/tomcat/src/main/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 (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/LocalDistributableSessionManager.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +1,44 @@
+package org.jboss.web.tomcat.service.session.distributedcache.spi;
+
+public interface LocalDistributableSessionManager
+{
+ boolean isPassivationEnabled();
+
+ String getContextName();
+
+ String getHostName();
+
+ /**
+ * Notifies the manager that a session in the distributed cache has
+ * been invalidated
+ *
+ * @param realId the session id excluding any jvmRoute
+ */
+ void notifyRemoteInvalidation(String realId);
+
+ /**
+ * Callback from the distributed cache notifying of a local modification
+ * to a session's attributes. Meant for use with FIELD granularity,
+ * where the session may not be aware of modifications.
+ *
+ * @param realId the session id excluding any jvmRoute
+ */
+ void notifyLocalAttributeModification(String realId);
+
+ void sessionActivated();
+
+ /**
+ * Callback from the distributed cache to notify us that a session
+ * has been modified remotely.
+ *
+ * @param realId the session id, without any trailing jvmRoute
+ * @param dataOwner the owner of the session. Can be <code>null</code> if
+ * the owner is unknown.
+ * @param distributedVersion the session's version per the distributed cache
+ * @param timestamp the session's timestamp per the distributed cache
+ * @param metadata the session's metadata per the distributed cache
+ */
+ boolean sessionChangedInDistributedCache(String realId, String dataOwner, int distributedVersion,
+ DistributableSessionTimestamp timestamp, DistributableSessionMetadata metadata);
+
+}
\ No newline at end of file
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/SessionSerializationFactory.java (from rev 77655, trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/distributedcache/spi/SessionSerializationFactory.java)
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/SessionSerializationFactory.java (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/SessionSerializationFactory.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +1,87 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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;
+
+import org.jboss.ha.framework.interfaces.ObjectStreamSource;
+import org.jboss.ha.framework.server.MarshalledValueObjectStreamSource;
+import org.jboss.ha.framework.server.SimpleCachableMarshalledValue;
+import org.jboss.logging.Logger;
+
+/**
+ * Factory class for creating object output and input streams,
+ * switching between JDK Serialization and JBoss Serialization classes.
+ * Using MarshalledValue to replace Serializable used inside different
+ * web app class loader context. Assuming that the caller classes are already
+ * handling the switch between web app class loader context.
+ *
+ *
+ * @author <a href="hmesha at novell.com">Hany Mesha</a>
+ * @author Brian Stansberry
+ */
+public class SessionSerializationFactory
+{
+ /**
+ * System property that, if set to <code>true</code>, indicates that
+ * JBoss Serialization should be used for session serialization.
+ */
+ public static final String JBOSS_SERIALIZATION_SYS_PROP = "session.serialization.jboss";
+ private static Logger log_ = Logger.getLogger(SessionSerializationFactory.class);
+ private static boolean useJBossSerialization = false;
+ private static ObjectStreamSource objectStreamSource;
+
+ static
+ {
+ String useJBossSerializationStr = System.getProperty(JBOSS_SERIALIZATION_SYS_PROP, "false");
+ useJBossSerialization = Boolean.valueOf(useJBossSerializationStr).booleanValue();
+ objectStreamSource = useJBossSerialization ? new JBossSerializationObjectStreamSource()
+ : new MarshalledValueObjectStreamSource();
+ try
+ {
+ if (useJBossSerialization)
+ {
+ log_.debug("Using JBossSerialization for web session replication");
+ }
+ }
+ catch (Throwable ignored)
+ {
+ // we don't fail a static initializer due to a debug log stmt
+ }
+ }
+
+ public static SimpleCachableMarshalledValue createMarshalledValue(Serializable o)
+ {
+ return new SimpleCachableMarshalledValue(o, objectStreamSource);
+ }
+
+ public static ObjectStreamSource getObjectStreamSource()
+ {
+ return objectStreamSource;
+ }
+
+ public static boolean useJBossSerialization()
+ {
+ return useJBossSerialization;
+ }
+
+}
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/TomcatClusterConfig.java (from rev 77655, trunk/tomcat/src/main/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 (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/TomcatClusterConfig.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +1,40 @@
+/*
+ * 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.File;
+import java.io.FileNotFoundException;
+
+import javax.management.MBeanServer;
+
+/**
+ * @author Brian Stansberry
+ *
+ */
+public interface TomcatClusterConfig
+{
+ MBeanServer getMBeanServer();
+ String getCacheObjectName();
+ File getCacheConfigFile() throws FileNotFoundException;
+ String getClusterName();
+}
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/TomcatClusterDistributedCacheManagerFactory.java (from rev 77655, trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/distributedcache/spi/TomcatClusterDistributedCacheManagerFactory.java)
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/TomcatClusterDistributedCacheManagerFactory.java (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/spi/TomcatClusterDistributedCacheManagerFactory.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +1,38 @@
+/*
+ * 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;
+
+/**
+ * @author Brian Stansberry
+ *
+ */
+public interface TomcatClusterDistributedCacheManagerFactory extends DistributedCacheManagerFactory
+{
+ TomcatClusterConfig getTomcatClusterConfig();
+
+ void setTomcatClusterConfig(TomcatClusterConfig clusterConfig);
+
+ void start() throws Exception;
+
+ void stop() throws Exception;
+}
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/sso/spi/FullyQualifiedSessionId.java (from rev 77655, trunk/tomcat/src/main/org/jboss/web/tomcat/service/sso/spi/FullyQualifiedSessionId.java)
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/sso/spi/FullyQualifiedSessionId.java (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/sso/spi/FullyQualifiedSessionId.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +1,111 @@
+/*
+ * 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.sso.spi;
+
+import java.io.Serializable;
+
+/**
+ * Encapsulates a session id along with the name of the owning context and
+ * its hostname.
+ *
+ * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
+ * @version $Revision: 1 $
+ */
+public class FullyQualifiedSessionId implements Serializable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 6081884018218825708L;
+
+ private final String hostName;
+ private final String contextName;
+ private final String sessionId;
+
+ public FullyQualifiedSessionId(String sessionId, String contextName, String hostName)
+ {
+ this.sessionId = sessionId;
+ this.contextName = contextName;
+ this.hostName = hostName;
+ }
+
+ /**
+ * Get the contextPath.
+ *
+ * @return the contextPath.
+ */
+ public String getContextName()
+ {
+ return contextName;
+ }
+ /**
+ * Get the hostName.
+ *
+ * @return the hostName.
+ */
+ public String getHostName()
+ {
+ return hostName;
+ }
+ /**
+ * Get the sessionId.
+ *
+ * @return the sessionId.
+ */
+ public String getSessionId()
+ {
+ return sessionId;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+
+ if (obj instanceof FullyQualifiedSessionId)
+ {
+ FullyQualifiedSessionId other = (FullyQualifiedSessionId) obj;
+ return (hostName.equals(other.hostName)
+ && contextName.equals(other.contextName)
+ && sessionId.equals(other.sessionId));
+ }
+
+ return false;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int result = 17;
+ result += 29 * hostName.hashCode();
+ result += 29 * contextName.hashCode();
+ result += 29 * sessionId.hashCode();
+ return result;
+ }
+
+ @Override
+ public String toString()
+ {
+ return hostName + "/" + contextName + "/" + sessionId;
+ }
+
+}
\ No newline at end of file
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/sso/spi/SSOClusterManager.java (from rev 77655, trunk/tomcat/src/main/org/jboss/web/tomcat/service/sso/spi/SSOClusterManager.java)
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/sso/spi/SSOClusterManager.java (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/sso/spi/SSOClusterManager.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +1,137 @@
+/*
+ * 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.sso.spi;
+
+/**
+ * Provides communications support between a SingleSignOn valve and other
+ * such valves configured for the same hostname within a server cluster.
+ * <p/>
+ * Implementations of this interface must declare a public no-arguments
+ * constructor.
+ *
+ * @author Brian E. Stansberry
+ * @version $Revision: 45726 $ $Date: 2006-06-21 21:50:00 +0200 (mer., 21 juin 2006) $
+ * @see SSOLocalManager
+ */
+public interface SSOClusterManager
+{
+ /**
+ * Notify the cluster of the addition of a Session to an SSO session.
+ *
+ * @param ssoId the id of the SSO session
+ * @param sessionId id of the Session that has been added
+ */
+ void addSession(String ssoId, FullyQualifiedSessionId sessionId);
+
+ /**
+ * Gets the SSOLocalManager valve for which this object is handling
+ * cluster communications.
+ *
+ * @return the <code>SSOLocalManager</code> valve.
+ */
+ SSOLocalManager getSSOLocalManager();
+
+ /**
+ * Sets the SSOLocalManager valve for which this object is handling
+ * cluster communications.
+ * <p><b>NOTE:</b> This method must be called before calls can be
+ * made to the other methods of this interface.
+ *
+ * @param localManager a <code>SSOLocalManager</code> valve.
+ */
+ void setSSOLocalManager(SSOLocalManager localManager);
+
+ /**
+ * Notifies the cluster that a single sign on session has been terminated
+ * due to a user logout.
+ *
+ * @param ssoId the id of the SSO session
+ */
+ void logout(String ssoId);
+
+ /**
+ * Queries the cluster for the existence of a SSO session with the given
+ * id, returning a <code>SSOCredentials</code> if one is found.
+ *
+ * @param ssoId the id of the SSO session
+ * @return a <code>SSOCredentials</code> created using information
+ * found on another cluster node, or <code>null</code> if no
+ * entry could be found.
+ */
+ SSOCredentials lookup(String ssoId);
+
+ /**
+ * Notifies the cluster of the creation of a new SSO entry.
+ *
+ * @param ssoId the id of the SSO session
+ * @param authType the type of authenticator (BASIC, CLIENT-CERT, DIGEST
+ * or FORM) used to authenticate the SSO.
+ * @param username the username (if any) used for the authentication
+ * @param password the password (if any) used for the authentication
+ */
+ void register(String ssoId, String authType, String username,
+ String password);
+
+ /**
+ * Notify the cluster of the removal of a Session from an SSO session.
+ *
+ * @param ssoId the id of the SSO session
+ * @param sessionId id of the Session that has been removed
+ */
+ void removeSession(String ssoId, FullyQualifiedSessionId sessionId);
+
+ /**
+ * Notifies the cluster of an update of the security credentials
+ * associated with an SSO session.
+ *
+ * @param ssoId the id of the SSO session
+ * @param authType the type of authenticator (BASIC, CLIENT-CERT, DIGEST
+ * or FORM) used to authenticate the SSO.
+ * @param username the username (if any) used for the authentication
+ * @param password the password (if any) used for the authentication
+ */
+ void updateCredentials(String ssoId, String authType, String username,
+ String password);
+
+
+ /**
+ * Prepare for the beginning of active use of the public methods of this
+ * component. This method should be called before any of the public
+ * methods of this component are utilized.
+ *
+ * @exception Exception if this component detects a fatal error
+ * that prevents this component from being used
+ */
+ public void start() throws Exception;
+
+
+ /**
+ * Gracefully terminate the active use of the public methods of this
+ * component. This method should be the last one called on a given
+ * instance of this component.
+ *
+ * @exception Exception if this component detects a fatal error
+ * that needs to be reported
+ */
+ public void stop() throws Exception;
+}
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/sso/spi/SSOCredentials.java (from rev 77655, trunk/tomcat/src/main/org/jboss/web/tomcat/service/sso/spi/SSOCredentials.java)
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/sso/spi/SSOCredentials.java (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/sso/spi/SSOCredentials.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +1,89 @@
+/*
+ * 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.sso.spi;
+
+import java.io.Serializable;
+
+/**
+ * Authentication credentials for an SSO.
+ *
+ * @author Brian E. Stansberry
+ * @version $Revision: $
+ */
+public class SSOCredentials
+ implements Serializable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 5704877226920571663L;
+
+ private final String authType;
+ private final String password;
+ private final String username;
+
+ /**
+ * Creates a new SSOCredentials.
+ *
+ * @param authType The authorization method used to authorize the
+ * SSO (BASIC, CLIENT-CERT, DIGEST, FORM or NONE).
+ * @param username The username of the user associated with the SSO
+ * @param password The password of the user associated with the SSO
+ */
+ public SSOCredentials(String authType, String username, String password)
+ {
+ this.authType = authType;
+ this.username = username;
+ this.password = password;
+ }
+
+ /**
+ * Gets the username of the user associated with the SSO.
+ *
+ * @return the username
+ */
+ public String getUsername()
+ {
+ return username;
+ }
+
+ /**
+ * Gets the authorization method used to authorize the SSO.
+ *
+ * @return "BASIC", "CLIENT-CERT", "DIGEST" or "FORM"
+ */
+ public String getAuthType()
+ {
+ return authType;
+ }
+
+ /**
+ * Gets the password of the user associated with the SSO.
+ *
+ * @return the password, or <code>null</code> if the authorization
+ * type was DIGEST or CLIENT-CERT.
+ */
+ public String getPassword()
+ {
+ return password;
+ }
+
+}
\ No newline at end of file
Copied: projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/sso/spi/SSOLocalManager.java (from rev 77655, trunk/tomcat/src/main/org/jboss/web/tomcat/service/sso/spi/SSOLocalManager.java)
===================================================================
--- projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/sso/spi/SSOLocalManager.java (rev 0)
+++ projects/cluster/ha-server-cache-spi/trunk/src/main/java/org/jboss/web/tomcat/service/sso/spi/SSOLocalManager.java 2008-08-30 02:46:26 UTC (rev 77672)
@@ -0,0 +1,83 @@
+/*
+ * 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.sso.spi;
+
+import javax.management.MBeanServer;
+
+/**
+ * Interface implemented by the ClusteredSingleSignOn valve to allow
+ * callbacks by the {@link SSOClusterManager}.
+ *
+ * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
+ * @version $Revision: 1 $
+ */
+public interface SSOLocalManager
+{
+ /**
+ * Callback from the SSOClusterManager notifying the local manager that
+ * an SSO has been deregistered on another node.
+ *
+ * @param ssoId Single sign on identifier to deregister
+ */
+ void deregister(String ssoId);
+
+ /**
+ * Callback from the SSOClusterManager notifying the local manager that
+ * the credentials associated with an SSO have been modified on another node.
+ *
+ * @param ssoId the id of the SSO
+ * @param credentials the updated credentials
+ */
+ void remoteUpdate(String ssoId, SSOCredentials credentials);
+
+ /**
+ * Callback from the SSOClusterManager when it detects an SSO without
+ * any active sessions across the cluster
+ */
+ void notifySSOEmpty(String ssoId);
+
+ /**
+ * Callback from the SSOClusterManager when it detects an SSO that
+ * has active sessions across the cluster
+ */
+ void notifySSONotEmpty(String ssoId);
+
+ /**
+ * Gets the MBeanServer the local manager is registered with
+ * (or <code>null</code>)
+ */
+ MBeanServer getMBeanServer();
+
+ /**
+ * Gets the name of the cache config used by SSOClusterManager.
+ *
+ * @return
+ */
+ String getCacheConfig();
+
+ /**
+ * Object name of the thread pool used by SSOClusterManager.
+ */
+ String getThreadPoolName();
+
+}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list