You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2011/09/18 11:20:01 UTC
svn commit: r1172233 -
/tomcat/trunk/java/org/apache/catalina/session/StandardSession.java
Author: rjung
Date: Sun Sep 18 09:20:00 2011
New Revision: 1172233
URL: http://svn.apache.org/viewvc?rev=1172233&view=rev
Log:
Allow to overwrite check for distributability
of session attributes by session implementations.
Modified:
tomcat/trunk/java/org/apache/catalina/session/StandardSession.java
Modified: tomcat/trunk/java/org/apache/catalina/session/StandardSession.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/StandardSession.java?rev=1172233&r1=1172232&r2=1172233&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/StandardSession.java (original)
+++ tomcat/trunk/java/org/apache/catalina/session/StandardSession.java Sun Sep 18 09:20:00 2011
@@ -1449,7 +1449,7 @@ public class StandardSession implements
throw new IllegalStateException(sm.getString(
"standardSession.setAttribute.ise", getIdInternal()));
if ((manager != null) && manager.getDistributable() &&
- !(value instanceof Serializable))
+ !isAttributeDistributable(name, value))
throw new IllegalArgumentException
(sm.getString("standardSession.setAttribute.iae", name));
// Construct an event with the new value
@@ -1558,6 +1558,19 @@ public class StandardSession implements
return (this.isValid || this.expiring);
}
+ /**
+ * Check whether the Object can be distributed. This implementation
+ * simply checks for serializability. Derived classes might use other
+ * distribution technology not based on serialization and can extend
+ * this check.
+ * @param name The name of the attribute to check
+ * @param value The value of the attribute to check
+ * @return true if the attribute is distributable, false otherwise
+ */
+ protected boolean isAttributeDistributable(String name, Object value) {
+ return value instanceof Serializable;
+ }
+
/**
* Read a serialized version of this session object from the specified
@@ -1694,7 +1707,7 @@ public class StandardSession implements
/**
- * Exclude attribute that cannot be serialized.
+ * Exclude standard attributes that cannot be serialized.
* @param name the attribute's name
*/
protected boolean exclude(String name){
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org