[jboss-cvs] JBossAS SVN: r105105 - trunk/tomcat/src/main/java/org/jboss/web/tomcat/service/session.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri May 21 12:58:16 EDT 2010
Author: bstansberry at jboss.com
Date: 2010-05-21 12:58:15 -0400 (Fri, 21 May 2010)
New Revision: 105105
Removed:
trunk/tomcat/src/main/java/org/jboss/web/tomcat/service/session/FieldBasedClusteredSession.java
Modified:
trunk/tomcat/src/main/java/org/jboss/web/tomcat/service/session/JBossCacheManager.java
Log:
[JBAS-7508] Remove FieldBasedClusteredSession; missed this before
Deleted: trunk/tomcat/src/main/java/org/jboss/web/tomcat/service/session/FieldBasedClusteredSession.java
===================================================================
--- trunk/tomcat/src/main/java/org/jboss/web/tomcat/service/session/FieldBasedClusteredSession.java 2010-05-21 16:50:12 UTC (rev 105104)
+++ trunk/tomcat/src/main/java/org/jboss/web/tomcat/service/session/FieldBasedClusteredSession.java 2010-05-21 16:58:15 UTC (rev 105105)
@@ -1,162 +0,0 @@
-/*
- * 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;
-
-import java.util.Collection;
-import java.util.Map;
-
-import org.jboss.aop.Advised;
-import org.jboss.web.tomcat.service.session.distributedcache.spi.DistributableSessionMetadata;
-import org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingDistributableSessionData;
-/**
- * <p>
- * Implementation of a clustered session for JBossCacheManager. The replication granularity
- * level is field based; that is, we replicate only the dirty field in a POJO that is part of
- * a session attribute. E.g., once a user do setAttribute("pojo", pojo), pojo will be monitored
- * automatically for field changes and accessing. It offers couple of advantages:
- * <ul>
- * <li>pojo.setName(), for example, will only replicate the name field in the pojo. And thus is more efficient.</li>
- * <li>If pojo has a complex object graph, we will handle that automtically providing that the
- * children object is also aspectized.</li>
- * </ul>
- * Note that in current version, all the attributes and its associated childre graph objects are
- * required to be aspectized. That is, you can't simply declare them as Serializable. This is restricted
- * because of the marshalling/unmarshalling issue.</p>
- *
- * <p>We use PojoCache for our internal, replicated data store.
- * <p/>
- *
- * @author Ben Wang
- * @author Brian Stansberry
- *
- * @version $Revision$
- */
-class FieldBasedClusteredSession
- extends ClusteredSession<OutgoingDistributableSessionData>
-{
- /** The serialVersionUID */
- private static final long serialVersionUID = 8347544395334247623L;
-
- /**
- * Descriptive information describing this Session implementation.
- */
- protected static final String info = "FieldBasedClusteredSession/1.0";
-
-
- // ------------------------------------------------------------ Constructors
-
-
- public FieldBasedClusteredSession(ClusteredManager<OutgoingDistributableSessionData> manager)
- {
- super(manager);
- }
-
-
- // ----------------------------------------------- Overridden Public Methods
-
- @Override
- public String getInfo()
- {
- return (info);
- }
-
-
- // --------------------------------------------- Overridden Protected Methods
-
- @Override
- protected OutgoingDistributableSessionData getOutgoingSessionData()
- {
- DistributableSessionMetadata metadata = isSessionMetadataDirty() ? getSessionMetadata() : null;
- Long timestamp = metadata != null || isSessionAttributeMapDirty() || getMustReplicateTimestamp() ? Long.valueOf(getSessionTimestamp()) : null;
- return new OutgoingDistributableSessionDataImpl(getRealId(), getVersion(), timestamp, metadata);
- }
-
- /**
- * Overrides the superclass to treat classes implementing Subject
- * as "immutable", since as an Observer we will detect any changes
- * to those types.
- */
- @Override
- protected boolean isMutable(Object attribute)
- {
- boolean pojo = (attribute instanceof Advised);
- boolean mutable = (!pojo && super.isMutable(attribute));
- return mutable;
- }
-
- @Override
- protected Object removeAttributeInternal(String name, boolean localCall, boolean localOnly)
- {
- // Remove it from the underlying store
- if (localCall && !replicationExcludes.contains(name))
- {
- if (localOnly)
- getDistributedCacheManager().removeAttributeLocal(getRealId(), name);
- else
- getDistributedCacheManager().removeAttribute(getRealId(), name);
-
- sessionAttributesDirty();
- }
- return getAttributesInternal().remove(name);
- }
-
- /**
- * Overrides the superclass to allow instrumented classes and
- * non-serializable Collections and Maps.
- */
- @Override
- protected boolean canAttributeBeReplicated(Object attribute)
- {
- return (attribute == null || Util.checkPojoType(attribute));
- }
-
- /**
- * This is the hook for setAttribute. Note that in this FieldBasedClusteredSession using aop,
- * user should not call setAttribute call too often since this will re-connect the attribute with the internal
- * cache (and this is expensive).
- * @param key
- * @param value
- * @return Object
- */
- @Override
- protected Object setAttributeInternal(String key, Object value)
- {
- if (!replicationExcludes.contains(key))
- {
- String myRealId = getRealId();
- getDistributedCacheManager().putAttribute(myRealId, key, value);
-
- // Special case for Collection classes.
- if( value instanceof Map || value instanceof Collection)
- {
- // We need to obtain the proxy first.
- value = getDistributedCacheManager().getAttribute(myRealId, key);
- }
-
- // Only mark session dirty if we can replicate the attribute
- sessionAttributesDirty();
- }
-
- // Still need to put it in the map to track locally.
- return getAttributesInternal().put(key, value);
- }
-}
Modified: trunk/tomcat/src/main/java/org/jboss/web/tomcat/service/session/JBossCacheManager.java
===================================================================
--- trunk/tomcat/src/main/java/org/jboss/web/tomcat/service/session/JBossCacheManager.java 2010-05-21 16:50:12 UTC (rev 105104)
+++ trunk/tomcat/src/main/java/org/jboss/web/tomcat/service/session/JBossCacheManager.java 2010-05-21 16:58:15 UTC (rev 105105)
@@ -1941,10 +1941,6 @@
ClusteredManager<OutgoingAttributeGranularitySessionData> amgr = uncheckedCastManager(this);
session = new AttributeBasedClusteredSession(amgr);
break;
- case FIELD :
- ClusteredManager<OutgoingDistributableSessionData> fmgr = uncheckedCastManager(this);
- session = new FieldBasedClusteredSession(fmgr);
- break;
default :
ClusteredManager<OutgoingSessionGranularitySessionData> smgr = uncheckedCastManager(this);
session = new SessionBasedClusteredSession(smgr);
More information about the jboss-cvs-commits
mailing list