[jboss-cvs] JBossAS SVN: r74628 - trunk/tomcat/src/main/org/jboss/web/tomcat/service/session.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Jun 16 12:30:49 EDT 2008
Author: bstansberry at jboss.com
Date: 2008-06-16 12:30:49 -0400 (Mon, 16 Jun 2008)
New Revision: 74628
Modified:
trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/ClusteredSession.java
trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheClusteredSession.java
trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/SessionBasedClusteredSession.java
Log:
[JBAS-5632] Clean out dead code from ClusteredSession hierarchy
Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/ClusteredSession.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/ClusteredSession.java 2008-06-16 16:19:05 UTC (rev 74627)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/ClusteredSession.java 2008-06-16 16:30:49 UTC (rev 74628)
@@ -22,10 +22,6 @@
package org.jboss.web.tomcat.service.session;
import java.beans.PropertyChangeSupport;
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
import java.io.Serializable;
import java.security.Principal;
import java.util.Collections;
@@ -61,8 +57,7 @@
* @version $Revision: 58585 $
*/
public abstract class ClusteredSession
- extends StandardSession
- implements Externalizable
+ extends StandardSession
{
private static final long serialVersionUID = -758573655613558722L;
protected static Logger log = Logger.getLogger(ClusteredSession.class);
@@ -188,18 +183,6 @@
protected static StringManager sm =
StringManager.getManager(ClusteredSession.class.getPackage().getName());
- /**
- * Create a new ClusteredSession.
- *
- * @param manager the session's manager
- *
- * @deprecated use {@link ClusteredSession(AbstractJBossManager, boolean)}
- */
- protected ClusteredSession(AbstractJBossManager manager)
- {
- this(manager, false);
- }
-
protected ClusteredSession(AbstractJBossManager manager, boolean useJK)
{
super(manager);
@@ -1118,115 +1101,6 @@
return buf.toString();
}
- // --------------------------------------------------------- Externalizable
-
- /**
- * Reads all non-transient state from the ObjectOutput <i>except
- * the attribute map</i>. Subclasses that wish the attribute map
- * to be read should override this method and
- * {@link #writeExternal(ObjectOutput) writeExternal()}.
- *
- * <p>
- * This method is deliberately public so it can be used to reset
- * the internal state of a session object using serialized
- * contents replicated from another JVM via JBossCache.
- * </p>
- *
- * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
- */
- public void readExternal(ObjectInput in)
- throws IOException, ClassNotFoundException
- {
- synchronized (this)
- {
- // From StandardSession
- id = in.readUTF();
- creationTime = in.readLong();
- lastAccessedTime = in.readLong();
- maxInactiveInterval = in.readInt();
- isNew = in.readBoolean();
- isValid = in.readBoolean();
- thisAccessedTime = in.readLong();
-
- // From ClusteredSession
-
- invalidationPolicy = ReplicationTrigger.fromInt(in.readInt());
- version = in.readInt();
-
- // Get our id without any jvmRoute appended
- parseRealId(id);
-
- // We no longer know if we have an activationListener
- hasActivationListener = null;
-
- // If the session has been replicated, any subsequent
- // access cannot be the first.
- this.firstAccess = false;
-
- // TODO uncomment when work on JBAS-1900 is completed
-// // Session notes -- for FORM auth apps, allow replicated session
-// // to be used without requiring a new login
-// // We use the superclass set/removeNote calls here to bypass
-// // the custom logic we've added
-// String username = (String) in.readObject();
-// if (username != null)
-// {
-// super.setNote(Constants.SESS_USERNAME_NOTE, username);
-// }
-// else
-// {
-// super.removeNote(Constants.SESS_USERNAME_NOTE);
-// }
-// String password = (String) in.readObject();
-// if (password != null)
-// {
-// super.setNote(Constants.SESS_PASSWORD_NOTE, password);
-// }
-// else
-// {
-// super.removeNote(Constants.SESS_PASSWORD_NOTE);
-// }
- }
- }
-
-
- /**
- * Writes all non-transient state to the ObjectOutput <i>except
- * the attribute map</i>. Subclasses that wish the attribute map
- * to be written should override this method and append it.
- *
- * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
- */
- public void writeExternal(ObjectOutput out)
- throws IOException
- {
- synchronized (this)
- {
- // From StandardSession
- out.writeUTF(id);
- out.writeLong(creationTime);
- out.writeLong(lastAccessedTime);
- out.writeInt(maxInactiveInterval);
- out.writeBoolean(isNew);
- out.writeBoolean(isValid);
- out.writeLong(thisAccessedTime);
-
- // From ClusteredSession
- out.writeInt(invalidationPolicy.ordinal());
- out.writeInt(version);
-
- // TODO uncomment when work on JBAS-1900 is completed
-// // Session notes -- for FORM auth apps, allow replicated session
-// // to be used without requiring a new login
-// String username = (String) getNote(Constants. SESS_USERNAME_NOTE);
-// log.debug(Constants.SESS_USERNAME_NOTE + " = " + username);
-// out.writeObject(username);
-// String password = (String) getNote(Constants.SESS_PASSWORD_NOTE);
-// log.debug(Constants.SESS_PASSWORD_NOTE + " = " + password);
-// out.writeObject(password);
- }
- }
-
// ----------------------------------------------------- Protected Methods
/**
@@ -1364,7 +1238,7 @@
boolean notify)
{
// Remove this attribute from our collection
- Object value = removeAttributeInternal(name, localCall, localOnly);
+ Object value = removeJBossInternalAttribute(name, localCall, localOnly);
// Do we need to do valueUnbound() and attributeRemoved() notification?
if (!notify || (value == null))
@@ -1424,26 +1298,6 @@
}
- /**
- * Exists in this class solely to act as an API-compatible bridge to the
- * deprecated {@link #removeJBossInternalAttribute(String)}.
- * JBossCacheClusteredSession subclasses will override this to call their
- * own methods that make use of localCall and localOnly
- *
- * @param name
- * @param localCall
- * @param localOnly
- * @return
- *
- * @deprecated will be replaced by removeJBossInternalAttribute(String, boolean, boolean)
- */
- protected Object removeAttributeInternal(String name,
- boolean localCall,
- boolean localOnly)
- {
- return removeJBossInternalAttribute(name);
- }
-
protected Object getAttributeInternal(String name)
{
return getJBossInternalAttribute(name);
@@ -1466,8 +1320,7 @@
protected abstract Object getJBossInternalAttribute(String name);
- /** @deprecated will be replaced by removeJBossInternalAttribute(String, boolean, boolean) */
- protected abstract Object removeJBossInternalAttribute(String name);
+ protected abstract Object removeJBossInternalAttribute(String name, boolean localCall, boolean localOnly);
protected abstract Map getJBossInternalAttributes();
Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheClusteredSession.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheClusteredSession.java 2008-06-16 16:19:05 UTC (rev 74627)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheClusteredSession.java 2008-06-16 16:30:49 UTC (rev 74628)
@@ -161,15 +161,4 @@
return removeJBossInternalAttribute(name, localCall, localOnly);
}
- protected Object removeJBossInternalAttribute(String name)
- {
- throw new UnsupportedOperationException("removeJBossInternalAttribute(String) " +
- "is not supported by JBossCacheClusteredSession; use " +
- "removeJBossInternalAttribute(String, boolean, boolean");
- }
-
- protected abstract Object removeJBossInternalAttribute(String name,
- boolean localCall,
- boolean localOnly);
-
}
Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/SessionBasedClusteredSession.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/SessionBasedClusteredSession.java 2008-06-16 16:19:05 UTC (rev 74627)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/SessionBasedClusteredSession.java 2008-06-16 16:30:49 UTC (rev 74628)
@@ -21,9 +21,6 @@
*/
package org.jboss.web.tomcat.service.session;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
import java.util.HashMap;
import java.util.Map;
@@ -142,58 +139,6 @@
return attrs;
}
- /**
- * Overrides the superclass version by additionally reading the
- * attributes map.
- *
- * <p>
- * This method is deliberately public so it can be used to reset
- * the internal state of a session object using serialized
- * contents replicated from another JVM via JBossCache.
- * </p>
- *
- * @see org.jboss.web.tomcat.service.session.ClusteredSession#readExternal(java.io.ObjectInput)
- */
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- {
- synchronized (this)
- {
-
- // If the session has been replicated, any subsequent
- // access cannot be the first.
- this.firstAccess = false;
- // Let superclass read in everything but the attribute map
- super.readExternal(in);
-
- attributes = (Map) in.readObject();
- }
- }
-
- /**
- * Overrides the superclass version by appending the attributes map. Does
- * not write any attributes whose names are found in
- * {@link ClusteredSession#excludedAttributes}.
- *
- * @see org.jboss.web.tomcat.service.session.ClusteredSession#writeExternal(java.io.ObjectOutput)
- */
- public void writeExternal(ObjectOutput out) throws IOException
- {
- synchronized (this)
- {
- // Let superclass write out everything but the attribute map
- super.writeExternal(out);
-
- // Don't replicate any excluded attributes
- Map excluded = removeExcludedAttributes(attributes);
-
- out.writeObject(attributes);
-
- // Restore any excluded attributes
- if (excluded != null)
- attributes.putAll(excluded);
- }
- }
-
protected void update(Integer version, SessionTimestamp timestamp,
SessionMetadata metadata, Map updatedAttrs)
{
More information about the jboss-cvs-commits
mailing list