You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by as...@apache.org on 2002/02/18 18:14:25 UTC
cvs commit: jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control CompositeCacheManager.java CompositeCacheConfigurator.java Cache.java
asmuts 02/02/18 09:14:25
Modified: src/java/org/apache/stratum/jcs/access TestCacheAccess.java
GroupCacheAccess.java CacheAccess.java
src/java/org/apache/stratum/jcs/auxiliary/remote
RemoteCacheNoWaitFacade.java RemoteCacheNoWait.java
RemoteCache.java
src/java/org/apache/stratum/jcs/auxiliary/disk/hsql
PurgatoryElement.java HSQLCacheNoWaitBuffer.java
HSQLCache.java
src/java/org/apache/stratum/jcs/auxiliary/disk/indexed
PurgatoryElement.java
IndexedDiskCacheNoWaitBuffer.java
IndexedDiskCache.java
src/java/org/apache/stratum/jcs/auxiliary/disk/jisp
PurgatoryElement.java JISPCacheNoWaitBuffer.java
JISPCache.java
src/java/org/apache/stratum/jcs/engine/memory/mru
MRUMemoryCache.java
src/java/org/apache/stratum/jcs/engine/memory/lru
LRUMemoryCache.java
src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/udp
LateralGroupCacheUDPListener.java
src/java/org/apache/stratum/jcs/auxiliary/lateral
LateralCacheNoWaitFacade.java
LateralCacheNoWait.java LateralCache.java
src/java/org/apache/stratum/jcs JCS.java
src/java/org/apache/stratum/jcs/access/behavior
IGroupCacheAccess.java ICacheAccess.java
src/java/org/apache/stratum/jcs/engine/behavior
IElementAttributes.java ICacheElement.java
ICache.java
src/java/org/apache/stratum/jcs/engine/control/group
GroupCacheManager.java GroupCache.java
src/java/org/apache/stratum/jcs/engine
ElementAttributes.java CacheGroup.java
CacheEventQueue.java CacheElement.java
src/java/org/apache/stratum/jcs/utils/servlet/session
DistSession.java
src/java/org/apache/stratum/jcs/engine/control
CompositeCacheManager.java
CompositeCacheConfigurator.java Cache.java
Log:
should use ElementAttributes instead of the old attributes class. it is much cleaned
had to convert to work on a memory shrinker thread
Revision Changes Path
1.13 +15 -14 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/TestCacheAccess.java
Index: TestCacheAccess.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/TestCacheAccess.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- TestCacheAccess.java 18 Feb 2002 02:43:09 -0000 1.12
+++ TestCacheAccess.java 18 Feb 2002 17:14:22 -0000 1.13
@@ -63,7 +63,8 @@
import org.apache.stratum.jcs.access.exception.CacheException;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
+import org.apache.stratum.jcs.engine.ElementAttributes;
import org.apache.stratum.jcs.engine.control.group.GroupCacheManager;
import org.apache.stratum.jcs.engine.control.group.GroupCacheManager;
@@ -454,9 +455,9 @@
}
else
{
- Attributes attrp = new Attributes();
- attrp.IS_LATERAL = true;
- attrp.IS_REMOTE = true;
+ IElementAttributes attrp = new ElementAttributes();
+ attrp.setIsLateral(true);
+ attrp.setIsRemote(true);
long n_start = System.currentTimeMillis();
cache_control.putInGroup( key,
group,
@@ -495,9 +496,9 @@
}
else
{
- Attributes attrp = new Attributes();
- attrp.IS_LATERAL = true;
- attrp.IS_REMOTE = true;
+ IElementAttributes attrp = new ElementAttributes();
+ attrp.setIsLateral(true);
+ attrp.setIsRemote(true);
long n_start = System.currentTimeMillis();
for ( int a = 0; a < num; a++ )
{
@@ -520,9 +521,9 @@
}
else
{
- Attributes attrp = new Attributes();
- attrp.IS_LATERAL = true;
- attrp.IS_REMOTE = true;
+ IElementAttributes attrp = new ElementAttributes();
+ attrp.setIsLateral(true);
+ attrp.setIsRemote(true);
long n_start = System.currentTimeMillis();
for ( int n = 0; n < num; n++ )
{
@@ -562,9 +563,9 @@
}
else
{
- Attributes attrp = new Attributes();
- attrp.IS_LATERAL = true;
- attrp.IS_REMOTE = true;
+ IElementAttributes attrp = new ElementAttributes();
+ attrp.setIsLateral(true);
+ attrp.setIsRemote(true);
long n_start = System.currentTimeMillis();
cache_control.put( key, val, attrp.copy() );
long n_end = System.currentTimeMillis();
@@ -589,7 +590,7 @@
}
else
{
- Attributes attrp = new Attributes();
+ IElementAttributes attrp = new ElementAttributes();
long n_start = System.currentTimeMillis();
for ( int n = 0; n < num; n++ )
{
1.14 +6 -6 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/GroupCacheAccess.java
Index: GroupCacheAccess.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/GroupCacheAccess.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- GroupCacheAccess.java 18 Feb 2002 02:43:09 -0000 1.13
+++ GroupCacheAccess.java 18 Feb 2002 17:14:22 -0000 1.14
@@ -66,7 +66,7 @@
import org.apache.stratum.jcs.access.exception.CacheException;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.behavior.ICompositeCacheAttributes;
@@ -220,7 +220,7 @@
* @param value The object to cache
* @param attr The objects attributes.
*/
- public void putInGroup( Object key, String group, Object value, Attributes attr )
+ public void putInGroup( Object key, String group, Object value, IElementAttributes attr )
throws CacheException
{
setAttribute( ( String ) key, group, value, attr );
@@ -269,7 +269,7 @@
* @param name Name of the group
* @param attr Default attributes for the group.
*/
- public void defineGroup( String name, Attributes attr )
+ public void defineGroup( String name, IElementAttributes attr )
throws CacheException
{
// update the attribute name set.
@@ -307,10 +307,10 @@
*
* @return The Element Attributes for the group
*/
- public Attributes getGroupAttributes( Object name )
+ public IElementAttributes getGroupAttributes( Object name )
throws CacheException
{
- Attributes attr = null;
+ IElementAttributes attr = null;
try
{
attr = cacheControl.getElementAttributes( ( Serializable ) name );
@@ -390,7 +390,7 @@
* @param value The new attribute value
* @param attr The new attribute value
*/
- public void setAttribute( String name, String group, Object value, Attributes attr )
+ public void setAttribute( String name, String group, Object value, IElementAttributes attr )
{
// unbind object first if any.
removeAttribute( name, group, SET_ATTR_INVOCATION );
1.10 +11 -11 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/CacheAccess.java
Index: CacheAccess.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/CacheAccess.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- CacheAccess.java 16 Feb 2002 02:37:16 -0000 1.9
+++ CacheAccess.java 18 Feb 2002 17:14:22 -0000 1.10
@@ -61,7 +61,7 @@
import org.apache.stratum.jcs.access.exception.CacheException;
import org.apache.stratum.jcs.access.exception.InvalidHandleException;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.CompositeCacheAttributes;
import org.apache.stratum.jcs.engine.behavior.ICache;
@@ -81,7 +81,7 @@
*
* @author <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
* @created February 13, 2002
- * @version $Id: CacheAccess.java,v 1.9 2002/02/16 02:37:16 jtaylor Exp $
+ * @version $Id: CacheAccess.java,v 1.10 2002/02/18 17:14:22 asmuts Exp $
*/
public class CacheAccess implements ICacheAccess
{
@@ -161,7 +161,7 @@
*/
public static CacheAccess defineRegion( String name,
CompositeCacheAttributes cattr,
- Attributes attr )
+ IElementAttributes attr )
throws CacheException
{
ensureCacheManager();
@@ -291,7 +291,7 @@
* @param attr Attributes to store object with
* @exception CacheException
*/
- public void put( Object name, Object obj, Attributes attr )
+ public void put( Object name, Object obj, IElementAttributes attr )
throws CacheException
{
try
@@ -388,7 +388,7 @@
* @exception CacheException
* @exception InvalidHandleException
*/
- public void resetElementAttributes( Attributes attr )
+ public void resetElementAttributes( IElementAttributes attr )
throws CacheException, InvalidHandleException
{
// Not implemented
@@ -403,27 +403,27 @@
* @exception CacheException
* @exception InvalidHandleException
*/
- public void resetElementAttributes( Object name, Attributes attr )
+ public void resetElementAttributes( Object name, IElementAttributes attr )
throws CacheException, InvalidHandleException
{
// Not implemented
}
/**
- * GetAttributes will return an attribute object describing the current
+ * GetElementAttributes will return an attribute object describing the current
* attributes associated with the object name.
*
* @return Attributes for this region
* @exception CacheException
*/
- public Attributes getElementAttributes()
+ public IElementAttributes getElementAttributes()
throws CacheException
{
return cacheControl.attr;
}
/**
- * GetAttributes will return an attribute object describing the current
+ * GetElementAttributes will return an attribute object describing the current
* attributes associated with the object name. The name object must override
* the Object.equals and Object.hashCode methods.
*
@@ -431,10 +431,10 @@
* @return Attributes for the object, null if object not in cache
* @exception CacheException
*/
- public Attributes getElementAttributes( Object name )
+ public IElementAttributes getElementAttributes( Object name )
throws CacheException
{
- Attributes attr = null;
+ IElementAttributes attr = null;
try
{
1.6 +3 -3 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheNoWaitFacade.java
Index: RemoteCacheNoWaitFacade.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheNoWaitFacade.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- RemoteCacheNoWaitFacade.java 16 Feb 2002 02:37:20 -0000 1.5
+++ RemoteCacheNoWaitFacade.java 18 Feb 2002 17:14:23 -0000 1.6
@@ -3,7 +3,7 @@
import java.io.IOException;
import java.io.Serializable;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.CacheElement;
import org.apache.stratum.jcs.engine.behavior.ICache;
@@ -101,13 +101,13 @@
/** Description of the Method */
- public void put( Serializable key, Serializable value, Attributes attr )
+ public void put( Serializable key, Serializable value, IElementAttributes attr )
throws IOException
{
try
{
CacheElement ce = new CacheElement( cacheName, key, value );
- ce.setAttributes( attr );
+ ce.setElementAttributes( attr );
update( ce );
}
catch ( Exception ex )
1.6 +3 -3 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheNoWait.java
Index: RemoteCacheNoWait.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheNoWait.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- RemoteCacheNoWait.java 16 Feb 2002 02:37:20 -0000 1.5
+++ RemoteCacheNoWait.java 18 Feb 2002 17:14:23 -0000 1.6
@@ -7,7 +7,7 @@
import org.apache.stratum.jcs.auxiliary.remote.behavior.IRemoteCacheService;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.CacheAdaptor;
import org.apache.stratum.jcs.engine.CacheElement;
import org.apache.stratum.jcs.engine.CacheEventQueue;
@@ -75,13 +75,13 @@
/** Description of the Method */
- public void put( Serializable key, Serializable value, Attributes attr )
+ public void put( Serializable key, Serializable value, IElementAttributes attr )
throws IOException
{
try
{
CacheElement ce = new CacheElement( cache.getCacheName(), key, value );
- ce.setAttributes( attr );
+ ce.setElementAttributes( attr );
update( ce );
}
catch ( IOException ex )
1.10 +7 -7 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCache.java
Index: RemoteCache.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCache.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- RemoteCache.java 16 Feb 2002 22:10:32 -0000 1.9
+++ RemoteCache.java 18 Feb 2002 17:14:23 -0000 1.10
@@ -10,7 +10,7 @@
import org.apache.stratum.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
import org.apache.stratum.jcs.auxiliary.remote.behavior.IRemoteCacheService;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.CacheElement;
import org.apache.stratum.jcs.engine.behavior.ICache;
@@ -38,7 +38,7 @@
private IRemoteCacheService remote;
private IRemoteCacheAttributes irca;
- Attributes attr = null;
+ IElementAttributes attr = null;
private HashMap keyHash;
// not synchronized to maximize concurrency.
@@ -102,7 +102,7 @@
*
* @param attr The new attributes value
*/
- public void setAttributes( Attributes attr )
+ public void setElementAttributes( IElementAttributes attr )
{
this.attr = attr;
}
@@ -113,7 +113,7 @@
*
* @return The attributes value
*/
- public Attributes getAttributes()
+ public IElementAttributes getElementAttributes()
{
return this.attr;
}
@@ -131,13 +131,13 @@
/** Description of the Method */
- public void put( Serializable key, Serializable value, Attributes attr )
+ public void put( Serializable key, Serializable value, IElementAttributes attr )
throws IOException
{
try
{
CacheElement ce = new CacheElement( cacheName, sanitized( key ), sanitized( value ) );
- ce.setAttributes( attr );
+ ce.setElementAttributes( attr );
update( ce );
}
catch ( Exception ex )
@@ -167,7 +167,7 @@
}
catch ( NullPointerException npe )
{
- log.error( "npe for ce = " + ce + "ce.attr = " + ce.getAttributes(), npe );
+ log.error( "npe for ce = " + ce + "ce.attr = " + ce.getElementAttributes(), npe );
return;
}
catch ( Exception ex )
1.6 +6 -6 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/hsql/PurgatoryElement.java
Index: PurgatoryElement.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/hsql/PurgatoryElement.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- PurgatoryElement.java 16 Feb 2002 02:37:18 -0000 1.5
+++ PurgatoryElement.java 18 Feb 2002 17:14:23 -0000 1.6
@@ -55,9 +55,9 @@
*/
import java.io.Serializable;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
-import org.apache.stratum.jcs.engine.behavior.IAttributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.behavior.ICacheElement;
/**
@@ -151,9 +151,9 @@
*
* @return The attributes value
*/
- public Attributes getAttributes()
+ public IElementAttributes getElementAttributes()
{
- return ice.getAttributes();
+ return ice.getElementAttributes();
}
@@ -162,9 +162,9 @@
*
* @param attr The new attributes value
*/
- public void setAttributes( IAttributes attr )
+ public void setElementAttributes( IElementAttributes attr )
{
- ice.setAttributes( attr );
+ ice.setElementAttributes( attr );
}
1.7 +5 -5 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/hsql/HSQLCacheNoWaitBuffer.java
Index: HSQLCacheNoWaitBuffer.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/hsql/HSQLCacheNoWaitBuffer.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- HSQLCacheNoWaitBuffer.java 16 Feb 2002 02:37:18 -0000 1.6
+++ HSQLCacheNoWaitBuffer.java 18 Feb 2002 17:14:23 -0000 1.7
@@ -61,7 +61,7 @@
import org.apache.stratum.jcs.auxiliary.disk.hsql.behavior.IHSQLCacheAttributes;
import org.apache.stratum.jcs.auxiliary.disk.hsql.behavior.IHSQLCacheService;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.CacheAdaptor;
import org.apache.stratum.jcs.engine.CacheElement;
import org.apache.stratum.jcs.engine.CacheEventQueue;
@@ -151,13 +151,13 @@
/** Description of the Method */
- public void put( Serializable key, Serializable value, Attributes attr )
+ public void put( Serializable key, Serializable value, IElementAttributes attr )
throws IOException
{
try
{
CacheElement ce = new CacheElement( cache.getCacheName(), key, value );
- ce.setAttributes( attr );
+ ce.setElementAttributes( attr );
update( ce );
}
catch ( IOException ex )
@@ -185,10 +185,10 @@
/*
* / may be too slow
* IDiskElement ide = new DiskElement( ce );
- * ide.setAttributes( ce.getAttributes() );
+ * ide.setElementAttributes( ce.getElementAttributes() );
* purgatory.put( ide.getKey(), ide );
* /CacheElement ice = new CacheElement(ce.getCacheName(), ce.getKey(), ce.getVal() );
- * /ice.setAttributes( ce.getAttributes() );
+ * /ice.setElementAttributes( ce.getElementAttributes() );
* ide.setIsSpoolable( true );
* q.addPutEvent( ide );
*/
1.8 +3 -3 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/hsql/HSQLCache.java
Index: HSQLCache.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/hsql/HSQLCache.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- HSQLCache.java 16 Feb 2002 02:37:17 -0000 1.7
+++ HSQLCache.java 18 Feb 2002 17:14:23 -0000 1.8
@@ -74,7 +74,7 @@
import org.apache.stratum.jcs.auxiliary.disk.hsql.behavior.IHSQLCacheAttributes;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.CacheElement;
import org.apache.stratum.jcs.engine.behavior.ICache;
@@ -318,12 +318,12 @@
/** Description of the Method */
- public void put( Serializable key, Serializable value, Attributes attr )
+ public void put( Serializable key, Serializable value, IElementAttributes attr )
throws IOException
{
CacheElement ce = null;
ce = new CacheElement( cacheName, key, value );
- ce.setAttributes( attr );
+ ce.setElementAttributes( attr );
update( ce );
}
1.2 +6 -6 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/indexed/PurgatoryElement.java
Index: PurgatoryElement.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/indexed/PurgatoryElement.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PurgatoryElement.java 17 Feb 2002 06:59:19 -0000 1.1
+++ PurgatoryElement.java 18 Feb 2002 17:14:23 -0000 1.2
@@ -55,9 +55,9 @@
*/
import java.io.Serializable;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
-import org.apache.stratum.jcs.engine.behavior.IAttributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.behavior.ICacheElement;
/**
@@ -156,9 +156,9 @@
*
* @return The attributes value
*/
- public Attributes getAttributes()
+ public IElementAttributes getElementAttributes()
{
- return ice.getAttributes();
+ return ice.getElementAttributes();
}
@@ -167,9 +167,9 @@
*
* @param attr The new attributes value
*/
- public void setAttributes( IAttributes attr )
+ public void setElementAttributes( IElementAttributes attr )
{
- ice.setAttributes( attr );
+ ice.setElementAttributes( attr );
}
1.2 +5 -5 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/indexed/IndexedDiskCacheNoWaitBuffer.java
Index: IndexedDiskCacheNoWaitBuffer.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/indexed/IndexedDiskCacheNoWaitBuffer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- IndexedDiskCacheNoWaitBuffer.java 17 Feb 2002 06:59:19 -0000 1.1
+++ IndexedDiskCacheNoWaitBuffer.java 18 Feb 2002 17:14:23 -0000 1.2
@@ -61,7 +61,7 @@
import org.apache.stratum.jcs.auxiliary.disk.indexed.behavior.IIndexedDiskCacheAttributes;
import org.apache.stratum.jcs.auxiliary.disk.behavior.IDiskCacheService;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.CacheAdaptor;
import org.apache.stratum.jcs.engine.CacheElement;
import org.apache.stratum.jcs.engine.CacheEventQueue;
@@ -166,13 +166,13 @@
* @param attr
* @exception IOException
*/
- public void put( Serializable key, Serializable value, Attributes attr )
+ public void put( Serializable key, Serializable value, IElementAttributes attr )
throws IOException
{
try
{
CacheElement ce = new CacheElement( cache.getCacheName(), key, value );
- ce.setAttributes( attr );
+ ce.setElementAttributes( attr );
update( ce );
}
catch ( IOException ex )
@@ -205,10 +205,10 @@
/*
* may be too slow
* IDiskElement ide = new DiskElement( ce );
- * ide.setAttributes( ce.getAttributes() );
+ * ide.setElementAttributes( ce.getElementAttributes() );
* purgatory.put( ide.getKey(), ide );
* CacheElement ice = new CacheElement(ce.getCacheName(), ce.getKey(), ce.getVal() );
- * ice.setAttributes( ce.getAttributes() );
+ * ice.setElementAttributes( ce.getElementAttributes() );
* ide.setIsSpoolable( true );
* q.addPutEvent( ide );
*/
1.2 +3 -3 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/indexed/IndexedDiskCache.java
Index: IndexedDiskCache.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/indexed/IndexedDiskCache.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- IndexedDiskCache.java 17 Feb 2002 06:59:19 -0000 1.1
+++ IndexedDiskCache.java 18 Feb 2002 17:14:23 -0000 1.2
@@ -70,7 +70,7 @@
import org.apache.stratum.jcs.auxiliary.disk.indexed.IndexedDiskCacheNoWaitBuffer;
import org.apache.stratum.jcs.auxiliary.disk.indexed.PurgatoryElement;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.CacheElement;
import org.apache.stratum.jcs.engine.behavior.ICache;
@@ -355,12 +355,12 @@
* @param attr
* @exception IOException
*/
- public void put( Serializable key, Serializable value, Attributes attr )
+ public void put( Serializable key, Serializable value, IElementAttributes attr )
throws IOException
{
CacheElement ce = null;
ce = new CacheElement( cacheName, key, value );
- ce.setAttributes( attr );
+ ce.setElementAttributes( attr );
update( ce );
}
1.5 +6 -6 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/PurgatoryElement.java
Index: PurgatoryElement.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/PurgatoryElement.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PurgatoryElement.java 16 Feb 2002 02:37:18 -0000 1.4
+++ PurgatoryElement.java 18 Feb 2002 17:14:23 -0000 1.5
@@ -9,9 +9,9 @@
import java.io.Serializable;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
-import org.apache.stratum.jcs.engine.behavior.IAttributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.behavior.ICacheElement;
/**
@@ -103,9 +103,9 @@
*
* @return The attributes value
*/
- public Attributes getAttributes()
+ public IElementAttributes getElementAttributes()
{
- return ice.getAttributes();
+ return ice.getElementAttributes();
}
@@ -114,9 +114,9 @@
*
* @param attr The new attributes value
*/
- public void setAttributes( IAttributes attr )
+ public void setElementAttributes( IElementAttributes attr )
{
- ice.setAttributes( attr );
+ ice.setElementAttributes( attr );
}
1.6 +5 -5 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPCacheNoWaitBuffer.java
Index: JISPCacheNoWaitBuffer.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPCacheNoWaitBuffer.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- JISPCacheNoWaitBuffer.java 16 Feb 2002 02:37:18 -0000 1.5
+++ JISPCacheNoWaitBuffer.java 18 Feb 2002 17:14:23 -0000 1.6
@@ -15,7 +15,7 @@
import org.apache.stratum.jcs.auxiliary.disk.jisp.behavior.IJISPCacheAttributes;
import org.apache.stratum.jcs.auxiliary.disk.jisp.behavior.IJISPCacheService;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.CacheAdaptor;
import org.apache.stratum.jcs.engine.CacheElement;
import org.apache.stratum.jcs.engine.CacheEventQueue;
@@ -105,13 +105,13 @@
/** Description of the Method */
- public void put( Serializable key, Serializable value, Attributes attr )
+ public void put( Serializable key, Serializable value, IElementAttributes attr )
throws IOException
{
try
{
CacheElement ce = new CacheElement( cache.getCacheName(), key, value );
- ce.setAttributes( attr );
+ ce.setElementAttributes( attr );
update( ce );
}
catch ( IOException ex )
@@ -139,10 +139,10 @@
/*
* / may be too slow
* IDiskElement ide = new DiskElement( ce );
- * ide.setAttributes( ce.getAttributes() );
+ * ide.setElementAttributes( ce.getElementAttributes() );
* purgatory.put( ide.getKey(), ide );
* /CacheElement ice = new CacheElement(ce.getCacheName(), ce.getKey(), ce.getVal() );
- * /ice.setAttributes( ce.getAttributes() );
+ * /ice.setElementAttributes( ce.getElementAttributes() );
* ide.setIsSpoolable( true );
* q.addPutEvent( ide );
*/
1.14 +3 -3 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPCache.java
Index: JISPCache.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPCache.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- JISPCache.java 16 Feb 2002 02:37:18 -0000 1.13
+++ JISPCache.java 18 Feb 2002 17:14:23 -0000 1.14
@@ -66,7 +66,7 @@
import org.apache.stratum.jcs.auxiliary.disk.jisp.behavior.IJISPCacheAttributes;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.CacheElement;
import org.apache.stratum.jcs.engine.behavior.ICache;
@@ -279,12 +279,12 @@
/** Description of the Method */
- public void put( Serializable key, Serializable value, Attributes attr )
+ public void put( Serializable key, Serializable value, IElementAttributes attr )
throws IOException
{
CacheElement ce = null;
ce = new CacheElement( cacheName, key, value );
- ce.setAttributes( attr );
+ ce.setElementAttributes( attr );
update( ce );
}
1.4 +3 -3 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/memory/mru/MRUMemoryCache.java
Index: MRUMemoryCache.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/memory/mru/MRUMemoryCache.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MRUMemoryCache.java 16 Feb 2002 02:37:23 -0000 1.3
+++ MRUMemoryCache.java 18 Feb 2002 17:14:23 -0000 1.4
@@ -13,7 +13,7 @@
import java.util.Map.Entry;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.CacheElement;
import org.apache.stratum.jcs.engine.behavior.ICache;
@@ -56,7 +56,7 @@
// Region Elemental Attributes
/** Description of the Field */
- public Attributes attr;
+ public IElementAttributes attr;
// Cache Attributes
/** Description of the Field */
@@ -226,7 +226,7 @@
/** Description of the Method */
- public void put( Serializable key, Serializable val, Attributes attr )
+ public void put( Serializable key, Serializable val, IElementAttributes attr )
throws IOException
{
// not used
1.10 +3 -3 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/memory/lru/LRUMemoryCache.java
Index: LRUMemoryCache.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/memory/lru/LRUMemoryCache.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- LRUMemoryCache.java 16 Feb 2002 02:37:23 -0000 1.9
+++ LRUMemoryCache.java 18 Feb 2002 17:14:23 -0000 1.10
@@ -11,7 +11,7 @@
import java.util.Map.Entry;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.CacheElement;
import org.apache.stratum.jcs.engine.behavior.ICache;
@@ -57,7 +57,7 @@
// Region Elemental Attributes
/** Description of the Field */
- public Attributes attr;
+ public IElementAttributes attr;
// Cache Attributes
/** Description of the Field */
@@ -214,7 +214,7 @@
/** Description of the Method */
- public void put( Serializable key, Serializable val, Attributes attr )
+ public void put( Serializable key, Serializable val, IElementAttributes attr )
throws IOException
{
// not used
1.7 +1 -1 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/udp/LateralGroupCacheUDPListener.java
Index: LateralGroupCacheUDPListener.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/udp/LateralGroupCacheUDPListener.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- LateralGroupCacheUDPListener.java 18 Feb 2002 02:43:09 -0000 1.6
+++ LateralGroupCacheUDPListener.java 18 Feb 2002 17:14:23 -0000 1.7
@@ -102,7 +102,7 @@
* GroupCache cache = (GroupCache)cacheMgr.getCache(cb.getCacheName());
* GroupAttrName gan = (GroupAttrName)cb.getKey();
* GroupId groupId = new GroupId( gan.groupId );
- * cache.putGAN( gan, cb.getVal(), cb.getAttributes(), false);
+ * cache.putGAN( gan, cb.getVal(), cb.getElementAttributes(), false);
*/
ICompositeCache cache = ( ICompositeCache ) cacheMgr.getCache( cb.getCacheName() );
cache.update( cb, false );
1.8 +3 -3 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCacheNoWaitFacade.java
Index: LateralCacheNoWaitFacade.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCacheNoWaitFacade.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- LateralCacheNoWaitFacade.java 16 Feb 2002 02:37:18 -0000 1.7
+++ LateralCacheNoWaitFacade.java 18 Feb 2002 17:14:24 -0000 1.8
@@ -3,7 +3,7 @@
import java.io.IOException;
import java.io.Serializable;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.CacheElement;
import org.apache.stratum.jcs.engine.behavior.ICache;
@@ -71,13 +71,13 @@
/** Description of the Method */
- public void put( Serializable key, Serializable value, Attributes attr )
+ public void put( Serializable key, Serializable value, IElementAttributes attr )
throws IOException
{
try
{
CacheElement ce = new CacheElement( cacheName, key, value );
- ce.setAttributes( attr );
+ ce.setElementAttributes( attr );
update( ce );
}
catch ( Exception ex )
1.6 +3 -3 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCacheNoWait.java
Index: LateralCacheNoWait.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCacheNoWait.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- LateralCacheNoWait.java 16 Feb 2002 02:37:18 -0000 1.5
+++ LateralCacheNoWait.java 18 Feb 2002 17:14:24 -0000 1.6
@@ -7,7 +7,7 @@
import org.apache.stratum.jcs.auxiliary.lateral.behavior.ILateralCacheService;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.CacheAdaptor;
import org.apache.stratum.jcs.engine.CacheElement;
import org.apache.stratum.jcs.engine.CacheEventQueue;
@@ -67,13 +67,13 @@
/** Description of the Method */
- public void put( Serializable key, Serializable value, Attributes attr )
+ public void put( Serializable key, Serializable value, IElementAttributes attr )
throws IOException
{
try
{
CacheElement ce = new CacheElement( cache.getCacheName(), key, value );
- ce.setAttributes( attr );
+ ce.setElementAttributes( attr );
update( ce );
}
catch ( IOException ex )
1.10 +5 -5 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCache.java
Index: LateralCache.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCache.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- LateralCache.java 16 Feb 2002 22:10:32 -0000 1.9
+++ LateralCache.java 18 Feb 2002 17:14:24 -0000 1.10
@@ -8,7 +8,7 @@
import org.apache.stratum.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
import org.apache.stratum.jcs.auxiliary.lateral.behavior.ILateralCacheService;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.CacheElement;
import org.apache.stratum.jcs.engine.behavior.ICache;
@@ -33,7 +33,7 @@
private static int numCreated = 0;
- Attributes attr = null;
+ IElementAttributes attr = null;
private HashMap keyHash;
// not synchronized to maximize concurrency.
@@ -88,18 +88,18 @@
public void put( Serializable key, Serializable value )
throws IOException
{
- put( key, value, ( Attributes ) this.attr.copy() );
+ put( key, value, ( IElementAttributes ) this.attr.copy() );
}
/** Description of the Method */
- public void put( Serializable key, Serializable value, Attributes attr )
+ public void put( Serializable key, Serializable value, IElementAttributes attr )
throws IOException
{
try
{
CacheElement ce = new CacheElement( cattr.getCacheName(), key, value );
- ce.setAttributes( attr );
+ ce.setElementAttributes( attr );
update( ce );
}
catch ( Exception ex )
1.8 +2 -2 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/JCS.java
Index: JCS.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/JCS.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- JCS.java 18 Feb 2002 02:43:10 -0000 1.7
+++ JCS.java 18 Feb 2002 17:14:24 -0000 1.8
@@ -83,7 +83,7 @@
* @author <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
* @author <a href="mailto:jtaylor@apache.org">James Taylor</a>
* @created February 13, 2002
- * @version $Id: JCS.java,v 1.7 2002/02/18 02:43:10 asmuts Exp $
+ * @version $Id: JCS.java,v 1.8 2002/02/18 17:14:24 asmuts Exp $
*/
public class JCS extends GroupCacheAccess
{
@@ -120,7 +120,7 @@
* Get a JCS which accesses the provided region.
*
* @param region Region that return JCS will provide access to
- * @param icca Cache attributes for region
+ * @param icca CacheAttributes for region
* @return A JCS which provides access to a given region.
* @exception CacheException
*/
1.8 +6 -6 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/behavior/IGroupCacheAccess.java
Index: IGroupCacheAccess.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/behavior/IGroupCacheAccess.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- IGroupCacheAccess.java 16 Feb 2002 02:37:16 -0000 1.7
+++ IGroupCacheAccess.java 18 Feb 2002 17:14:24 -0000 1.8
@@ -57,7 +57,7 @@
import org.apache.stratum.jcs.access.exception.CacheException;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
/**
* Description of the Interface
@@ -82,12 +82,12 @@
/** Description of the Method */
- void putInGroup( Object key, String group, Object obj, Attributes attr )
+ void putInGroup( Object key, String group, Object obj, IElementAttributes attr )
throws CacheException;
/**
- * DefineGroup is used to create a new group object. Attributes may be set
+ * DefineGroup is used to create a new group object. IElementAttributes may be set
* on the group. If no attributes are specified, the attributes of the
* region or group the new group is associated with are used. If group is
* specified the new group will be associated with the group specified.
@@ -97,7 +97,7 @@
/** Description of the Method */
- void defineGroup( String name, Attributes attr )
+ void defineGroup( String name, IElementAttributes attr )
throws CacheException;
@@ -106,7 +106,7 @@
*
* @return The groupAttributes value
*/
- Attributes getGroupAttributes( Object name )
+ IElementAttributes getGroupAttributes( Object name )
throws CacheException;
@@ -136,7 +136,7 @@
* @param value The new attribute value
* @param attr The new attribute value
*/
- void setAttribute( String name, String group, Object value, Attributes attr );
+ void setAttribute( String name, String group, Object value, IElementAttributes attr );
/**
1.8 +7 -7 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/behavior/ICacheAccess.java
Index: ICacheAccess.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/behavior/ICacheAccess.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ICacheAccess.java 16 Feb 2002 02:37:16 -0000 1.7
+++ ICacheAccess.java 18 Feb 2002 17:14:24 -0000 1.8
@@ -58,7 +58,7 @@
import org.apache.stratum.jcs.access.exception.CacheException;
import org.apache.stratum.jcs.access.exception.ObjectExistsException;
import org.apache.stratum.jcs.engine.behavior.ICompositeCacheAttributes;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
/**
* Description of the Interface
@@ -94,7 +94,7 @@
/** Description of the Method */
- void put( Object name, Object obj, Attributes attr )
+ void put( Object name, Object obj, IElementAttributes attr )
throws CacheException;
@@ -146,24 +146,24 @@
* Only object loaded after the reset will use the new defaults. If no name
* argument is provided, the reset is applied to the region.
*/
- void resetElementAttributes( Attributes attr )
+ void resetElementAttributes( IElementAttributes attr )
throws CacheException;
/** Description of the Method */
- void resetElementAttributes( Object name, Attributes attr )
+ void resetElementAttributes( Object name, IElementAttributes attr )
throws CacheException;
/**
- * GetAttributes will return an attribute object describing the current
+ * GetElementAttributes will return an attribute object describing the current
* attributes associated with the object name. If no name parameter is
* available, the attributes for the region will be returned. The name
* object must override the Object.equals and Object.hashCode methods.
*
* @return The elementAttributes value
*/
- Attributes getElementAttributes()
+ IElementAttributes getElementAttributes()
throws CacheException;
@@ -172,7 +172,7 @@
*
* @return The elementAttributes value
*/
- Attributes getElementAttributes( Object name )
+ IElementAttributes getElementAttributes( Object name )
throws CacheException;
1.2 +47 -0 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/behavior/IElementAttributes.java
Index: IElementAttributes.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/behavior/IElementAttributes.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- IElementAttributes.java 18 Feb 2002 05:54:27 -0000 1.1
+++ IElementAttributes.java 18 Feb 2002 17:14:24 -0000 1.2
@@ -106,5 +106,52 @@
*/
public long getTimeToLiveSeconds();
+ /**
+ * Returns a copy of the object.
+ *
+ * @return IElementAttributes
+ */
+ public IElementAttributes copy();
+
+ /**
+ * Gets the {3} attribute of the IElementAttributes object
+ *
+ * @return The {3} value
+ */
+ public boolean getIsDistribute();
+ public void setIsDistribute( boolean val );
+ // lateral
+
+ /**
+ * can this item be flushed to disk
+ *
+ * @return The {3} value
+ */
+ public boolean getIsSpool();
+ public void setIsSpool(boolean val);
+
+ /**
+ * Is this item laterally distributable
+ *
+ * @return The {3} value
+ */
+ public boolean getIsLateral();
+ public void setIsLateral( boolean val);
+
+ /**
+ * Can this item be sent to the remote cache
+ *
+ * @return The {3} value
+ */
+ public boolean getIsRemote();
+ public void setIsRemote( boolean val);
+
+ /**
+ * can turn off expiration
+ *
+ * @return The {3} value
+ */
+ public boolean getIsEternal();
+ public void setIsEternal( boolean val);
}
1.5 +3 -3 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/behavior/ICacheElement.java
Index: ICacheElement.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/behavior/ICacheElement.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ICacheElement.java 16 Feb 2002 02:37:22 -0000 1.4
+++ ICacheElement.java 18 Feb 2002 17:14:24 -0000 1.5
@@ -3,7 +3,7 @@
import java.io.Serializable;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
/**
* Description of the Interface
@@ -44,7 +44,7 @@
*
* @return The attributes value
*/
- public Attributes getAttributes();
+ public IElementAttributes getElementAttributes();
/**
@@ -52,7 +52,7 @@
*
* @param attr The new attributes value
*/
- public void setAttributes( IAttributes attr );
+ public void setElementAttributes( IElementAttributes attr );
/**
1.6 +2 -2 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/behavior/ICache.java
Index: ICache.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/behavior/ICache.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ICache.java 16 Feb 2002 02:37:22 -0000 1.5
+++ ICache.java 18 Feb 2002 17:14:24 -0000 1.6
@@ -3,7 +3,7 @@
import java.io.IOException;
import java.io.Serializable;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
/**
* Inteface implemented by a specific cache.
@@ -73,7 +73,7 @@
/** Description of the Method */
- public void put( Serializable key, Serializable val, Attributes attr )
+ public void put( Serializable key, Serializable val, IElementAttributes attr )
throws IOException;
1.4 +3 -3 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/group/GroupCacheManager.java
Index: GroupCacheManager.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/group/GroupCacheManager.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- GroupCacheManager.java 18 Feb 2002 05:10:43 -0000 1.3
+++ GroupCacheManager.java 18 Feb 2002 17:14:24 -0000 1.4
@@ -2,7 +2,7 @@
import java.io.Serializable;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.behavior.ICache;
import org.apache.stratum.jcs.engine.behavior.ICompositeCache;
@@ -44,7 +44,7 @@
protected Cache createSystemCache( String cacheName,
ICache[] auxCaches,
ICompositeCacheAttributes cattr,
- Attributes attr )
+ IElementAttributes attr )
{
ICompositeCache systemGroupIdCache =
( ICompositeCache ) systemCaches.get( "groupIdCache" );
@@ -57,7 +57,7 @@
protected Cache createCache( String cacheName,
ICache[] auxCaches,
ICompositeCacheAttributes cattr,
- Attributes attr )
+ IElementAttributes attr )
{
ICompositeCache systemGroupIdCache =
( ICompositeCache ) systemCaches.get( "groupIdCache" );
1.4 +21 -21 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/group/GroupCache.java
Index: GroupCache.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/group/GroupCache.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- GroupCache.java 18 Feb 2002 05:10:43 -0000 1.3
+++ GroupCache.java 18 Feb 2002 17:14:24 -0000 1.4
@@ -61,7 +61,7 @@
import org.apache.stratum.jcs.access.exception.CacheException;
import org.apache.stratum.jcs.access.exception.ObjectNotFoundException;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.CacheElement;
import org.apache.stratum.jcs.engine.behavior.ICache;
@@ -121,7 +121,7 @@
* @param cattr The cache attribute
* @param attr The default element attributes
*/
- public GroupCache( String cacheName, ICache[] auxCaches, ICompositeCacheAttributes cattr, Attributes attr )
+ public GroupCache( String cacheName, ICache[] auxCaches, ICompositeCacheAttributes cattr, IElementAttributes attr )
{
super( cacheName, auxCaches, cattr, attr );
@@ -142,7 +142,7 @@
* @param attr The default element attributes
* @param systemGroupIdCache The systemGroupIdCache
*/
- public GroupCache( String cacheName, ICache[] auxCaches, ICompositeCacheAttributes cattr, Attributes attr, ICompositeCache systemGroupIdCache )
+ public GroupCache( String cacheName, ICache[] auxCaches, ICompositeCacheAttributes cattr, IElementAttributes attr, ICompositeCache systemGroupIdCache )
{
super( cacheName, auxCaches, cattr, attr );
if ( log.isDebugEnabled() )
@@ -378,7 +378,7 @@
* @param val The Object to cache
* @param attr The element attributes
*/
- public void put( Serializable key, Serializable val, Attributes attr )
+ public void put( Serializable key, Serializable val, IElementAttributes attr )
throws IOException
{
if ( key instanceof GroupAttrName )
@@ -398,7 +398,7 @@
}
if ( log.isDebugEnabled() )
{
- log.debug( "put(key,val,attr) > updating " + key + " via super method, attr.IS_REMOTE = " + attr.IS_REMOTE );
+ log.debug( "put(key,val,attr) > updating " + key + " via super method, attr.getIsRemote() = " + attr.getIsRemote() );
}
// NOT GROUP RELATED
@@ -406,7 +406,7 @@
{
//updateCaches( key, val, attr );
CacheElement ce = new CacheElement( this.getCacheName(), key, val );
- ce.setAttributes( attr );
+ ce.setElementAttributes( attr );
super.update( ce, ICache.INCLUDE_REMOTE_CACHE );
}
@@ -445,14 +445,14 @@
}
//super.put(key, val);
- Attributes attrE = ( Attributes ) this.attr.copy();
+ IElementAttributes attrE = ( IElementAttributes ) this.attr.copy();
try
{
// must make sure you call the sure here
// updateCaches( key, val, attrE, ICache.INCLUDE_REMOTE_CACHE );
// problem super calls back up and the last instruction gets confused
CacheElement ce = new CacheElement( this.getCacheName(), key, val );
- ce.setAttributes( attrE );
+ ce.setElementAttributes( attrE );
super.update( ce, ICache.INCLUDE_REMOTE_CACHE );
}
catch ( IOException ioe )
@@ -528,7 +528,7 @@
log.debug( "invocation is NOT Local" );
}
}
- Attributes attrE = ( Attributes ) this.attr.copy();
+ IElementAttributes attrE = ( IElementAttributes ) this.attr.copy();
putGAN( ( GroupAttrName ) key, ce.getVal(), attrE, invocation );
}
catch ( IOException ioe )
@@ -548,7 +548,7 @@
//}
- Attributes attrE = ( Attributes ) this.attr.copy();
+ IElementAttributes attrE = ( IElementAttributes ) this.attr.copy();
try
{
// update should go remote if locally invoked
@@ -587,7 +587,7 @@
throw ex;
}
- Attributes attrE = ( Attributes ) this.attr.copy();
+ IElementAttributes attrE = ( IElementAttributes ) this.attr.copy();
putGAN( key, val, attrE );
return;
}
@@ -599,7 +599,7 @@
*/
// TODO: DistCacheMulticaster,etc. currently only supports key of String type
// Needs to support GroupAttrName type, or do we ?
- private void putGAN( GroupAttrName key, Serializable val, Attributes attrE )
+ private void putGAN( GroupAttrName key, Serializable val, IElementAttributes attrE )
throws IOException
{
log.debug( "in putGAN( gan,val,attr) " );
@@ -613,8 +613,8 @@
*
* @param invocation Is the originating method call from a local source
*/
- //public void putGAN( GroupAttrName key, Serializable val, Attributes attrE, boolean updateRemote )
- public void putGAN( GroupAttrName key, Serializable val, Attributes attrE, boolean invocation )
+ //public void putGAN( GroupAttrName key, Serializable val, IElementAttributes attrE, boolean updateRemote )
+ public void putGAN( GroupAttrName key, Serializable val, IElementAttributes attrE, boolean invocation )
throws IOException
{
@@ -639,7 +639,7 @@
// update the attribute.
//updateCaches(key, val, attrE, INCLUDE_REMOTE_CACHE);
CacheElement ce = new CacheElement( this.getCacheName(), key, val );
- ce.setAttributes( attrE );
+ ce.setElementAttributes( attrE );
if ( log.isDebugEnabled() )
{
@@ -676,7 +676,7 @@
}
CacheElement ceID = new CacheElement( this.getCacheName(), groupId.key, attrNameSet );
- ceID.setAttributes( attrE );
+ ceID.setElementAttributes( attrE );
// DO NOT SEND THE UPDATE LIST REMOTELY
// THE ELEMENT WILL BE SENT AND THE LIST MAINTAINED REMOTELY
@@ -700,7 +700,7 @@
/** Description of the Method */
- protected void createGroup( String group, Attributes attrE )
+ protected void createGroup( String group, IElementAttributes attrE )
throws CacheException
{
// update the attribute name set.
@@ -727,7 +727,7 @@
try
{
CacheElement ceID = new CacheElement( this.getCacheName(), groupId.key, attrNameSet );
- ceID.setAttributes( attrE );
+ ceID.setElementAttributes( attrE );
//updateCaches(groupId.key, attrNameSet, attrE );
//super.update( ceID, EXCLUDE_REMOTE_CACHE );
systemGroupIdCache.update( ceID, EXCLUDE_REMOTE_CACHE );
@@ -924,7 +924,7 @@
{
CacheElement ceID = new CacheElement( this.getCacheName(), groupId.key, attrNameSet );
- ceID.setAttributes( ce.attr );
+ ceID.setElementAttributes( ce.attr );
if ( log.isDebugEnabled() )
{
log.debug( "updateGroupAttrNameSet((groupAttrname)key,invocation,remove) > calling systemGroupIdCache.update( ceID, EXCLUDE_REMOTE_CACHE )" );
@@ -1050,7 +1050,7 @@
* @param key Retrieval value for item.
* @return The elementAttributes value
*/
- public Attributes getElementAttributes( Serializable key )
+ public IElementAttributes getElementAttributes( Serializable key )
throws CacheException, IOException
{
CacheElement ce = ( CacheElement ) getCacheElement( key );
@@ -1058,7 +1058,7 @@
{
throw new ObjectNotFoundException( "key " + key + " is not found" );
}
- return ce.getAttributes();
+ return ce.getElementAttributes();
}
}
1.2 +81 -13 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/ElementAttributes.java
Index: ElementAttributes.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/ElementAttributes.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ElementAttributes.java 18 Feb 2002 05:54:54 -0000 1.1
+++ ElementAttributes.java 18 Feb 2002 17:14:24 -0000 1.2
@@ -132,7 +132,7 @@
public long lastAccessTime = 0;
/**
- * Constructor for the Attributes object
+ * Constructor for the IElementAttributes object
*/
public ElementAttributes()
{
@@ -141,7 +141,7 @@
/**
- * Constructor for the Attributes object
+ * Constructor for the IElementAttributes object
*
* @param attr
*/
@@ -174,7 +174,7 @@
*
* @return
*/
- public ElementAttributes copy()
+ public IElementAttributes copy()
{
try
{
@@ -227,7 +227,7 @@
}
/**
- * Sets the version attribute of the Attributes object
+ * Sets the version attribute of the IElementAttributes object
*
* @param version The new version value
*/
@@ -238,7 +238,7 @@
/**
- * Sets the maxLifeSeconds attribute of the Attributes object
+ * Sets the maxLifeSeconds attribute of the IElementAttributes object
*
* @param ttl The new timeToLive value
* @param mls The new {3} value
@@ -260,7 +260,7 @@
/**
- * Sets the idleTime attribute of the Attributes object
+ * Sets the idleTime attribute of the IElementAttributes object
*
* @param idle The new idleTime value
*/
@@ -284,7 +284,7 @@
/**
- * Gets the size attribute of the Attributes object
+ * Gets the size attribute of the IElementAttributes object
*
* @return The size value
*/
@@ -295,7 +295,7 @@
/**
- * Gets the createTime attribute of the Attributes object
+ * Gets the createTime attribute of the IElementAttributes object
*
* @return The createTime value
*/
@@ -306,7 +306,7 @@
/**
- * Sets the createTime attribute of the Attributes object
+ * Sets the createTime attribute of the IElementAttributes object
*/
public void setCreateTime()
{
@@ -315,7 +315,7 @@
/**
- * Gets the version attribute of the Attributes object
+ * Gets the version attribute of the IElementAttributes object
*
* @return The version value
*/
@@ -326,8 +326,9 @@
/**
- * Gets the idleTime attribute of the Attributes object. Keeping track of
- * this will require storing the last access time. This could get expensive.
+ * Gets the idleTime attribute of the IElementAttributes object. Keeping
+ * track of this will require storing the last access time. This could get
+ * expensive.
*
* @return The idleTime value
*/
@@ -369,7 +370,74 @@
/**
- * For logging and debugging the element attributes.
+ * Gets the {3} attribute of the IElementAttributes object
+ *
+ * @return The {3} value
+ */
+ public boolean getIsDistribute()
+ {
+ return this.IS_DISTRIBUTE;
+ }
+ public void setIsDistribute( boolean val) {
+ this.IS_DISTRIBUTE = val;
+ }
+
+ /**
+ * can this item be flushed to disk
+ *
+ * @return The {3} value
+ */
+ public boolean getIsSpool()
+ {
+ return this.IS_SPOOL;
+ }
+ public void setIsSpool( boolean val) {
+ this.IS_SPOOL = val;
+ }
+
+ /**
+ * Is this item laterally distributable
+ *
+ * @return The {3} value
+ */
+ public boolean getIsLateral()
+ {
+ return this.IS_LATERAL;
+ }
+ public void setIsLateral( boolean val) {
+ this.IS_LATERAL = val;
+ }
+
+ /**
+ * Can this item be sent to the remote cache
+ *
+ * @return The {3} value
+ */
+ public boolean getIsRemote()
+ {
+ return this.IS_REMOTE;
+ }
+ public void setIsRemote( boolean val) {
+ this.IS_REMOTE = val;
+ }
+
+ /**
+ * can turn off expiration
+ *
+ * @return The {3} value
+ */
+ public boolean getIsEternal()
+ {
+ return this.IS_ETERNAL;
+ }
+
+ public void setIsEternal( boolean val) {
+ this.IS_ETERNAL = val;
+ }
+
+
+ /**
+ * For logging and debugging the element IElementAttributes.
*
* @return
*/
1.5 +5 -3 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/CacheGroup.java
Index: CacheGroup.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/CacheGroup.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CacheGroup.java 16 Feb 2002 02:37:22 -0000 1.4
+++ CacheGroup.java 18 Feb 2002 17:14:24 -0000 1.5
@@ -1,5 +1,7 @@
package org.apache.stratum.jcs.engine;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
+
/**
* Description of the Class
*
@@ -11,7 +13,7 @@
//private Atrributes attr;
/** Description of the Field */
- public Attributes attr;
+ public IElementAttributes attr;
/** Constructor for the CacheGroup object */
@@ -23,7 +25,7 @@
*
* @param attr The new attributes value
*/
- public void setAttributes( Attributes attr )
+ public void setElementAttributes( IElementAttributes attr )
{
this.attr = attr;
}
@@ -34,7 +36,7 @@
*
* @return The attrributes value
*/
- public Attributes getAttrributes()
+ public IElementAttributes getElementAttrributes()
{
return attr;
}
1.8 +2 -7 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/CacheEventQueue.java
Index: CacheEventQueue.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/CacheEventQueue.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- CacheEventQueue.java 17 Feb 2002 07:08:26 -0000 1.7
+++ CacheEventQueue.java 18 Feb 2002 17:14:24 -0000 1.8
@@ -329,12 +329,7 @@
*/
private class PutEvent extends AbstractCacheEvent
{
- /*
- * private Serializable key;
- * private Serializable obj;
- * private Attributes attr;
- * private String groupName;
- */
+
private ICacheElement ice;
@@ -367,7 +362,7 @@
{
/*
* CacheElement ce = new CacheElement(cacheName, key, obj);
- * ce.setAttributes( attr );
+ * ce.setElementAttributes( attr );
* ce.setGroupName( groupName );
*/
listener.handlePut( ice );
1.6 +9 -9 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/CacheElement.java
Index: CacheElement.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/CacheElement.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- CacheElement.java 16 Feb 2002 02:37:22 -0000 1.5
+++ CacheElement.java 18 Feb 2002 17:14:24 -0000 1.6
@@ -2,9 +2,9 @@
import java.io.Serializable;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
-import org.apache.stratum.jcs.engine.behavior.IAttributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.behavior.ICacheElement;
/**
@@ -26,7 +26,7 @@
public final long createTime;
/** Description of the Field */
- public Attributes attr;
+ public ElementAttributes attr;
// make sure it is open for spooling?
@@ -97,20 +97,20 @@
/**
* Sets the attributes attribute of the CacheElement object
*
- * @param attr The new attributes value
+ * @param attr The new IElementAttributes value
*/
- public void setAttributes( IAttributes attr )
+ public void setElementAttributes( IElementAttributes attr )
{
- this.attr = ( Attributes ) attr;
+ this.attr = ( ElementAttributes ) attr;
}
/**
- * Gets the attributes attribute of the CacheElement object
+ * Gets the IElementAttributes attribute of the CacheElement object
*
- * @return The attributes value
+ * @return The IElementAttributes value
*/
- public Attributes getAttributes()
+ public IElementAttributes getElementAttributes()
{
return this.attr;
}
1.9 +1 -1 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/servlet/session/DistSession.java
Index: DistSession.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/servlet/session/DistSession.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- DistSession.java 16 Feb 2002 19:06:35 -0000 1.8
+++ DistSession.java 18 Feb 2002 17:14:25 -0000 1.9
@@ -87,7 +87,7 @@
this.session_id = session_id;
//sessInfo = (SessionInfo)sessInfoCache.get( session_id );
- // not necessary if you don't set default element attributes
+ // not necessary if you don't set default ElementAttributes
// try to get data in the session_id group under the session_id key
sessInfo = ( SessionInfo ) sessCache.getFromGroup( session_id, session_id );
1.8 +7 -6 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/CompositeCacheManager.java
Index: CompositeCacheManager.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/CompositeCacheManager.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- CompositeCacheManager.java 16 Feb 2002 21:59:33 -0000 1.7
+++ CompositeCacheManager.java 18 Feb 2002 17:14:25 -0000 1.8
@@ -19,7 +19,8 @@
import org.apache.stratum.jcs.auxiliary.remote.behavior.IRemoteCacheConstants;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.ElementAttributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.CompositeCacheAttributes;
import org.apache.stratum.jcs.engine.behavior.ICache;
@@ -50,7 +51,7 @@
new CompositeCacheAttributes();
/** Default elemeent attributes for this cache manager */
- protected Attributes defaultElementAttr = new Attributes();
+ protected IElementAttributes defaultElementAttr = new ElementAttributes();
/** Defaults the cache service name to the rmi server's class name */
private String remoteServiceName;
@@ -167,7 +168,7 @@
protected Cache createSystemCache( String cacheName,
ICache[] auxCaches,
ICompositeCacheAttributes cattr,
- Attributes attr )
+ IElementAttributes attr )
{
return new Cache( cacheName, auxCaches, cattr, attr );
}
@@ -180,7 +181,7 @@
protected Cache createCache( String cacheName,
ICache[] auxCaches,
ICompositeCacheAttributes cattr,
- Attributes attr )
+ IElementAttributes attr )
{
return new Cache( cacheName, auxCaches, cattr, attr );
}
@@ -221,7 +222,7 @@
/** Gets the cache attribute of the CompositeCacheManager object */
public ICache getCache( String cacheName,
ICompositeCacheAttributes cattr,
- Attributes attr )
+ IElementAttributes attr )
{
cattr.setCacheName( cacheName );
return getCache( cattr, this.defaultElementAttr );
@@ -241,7 +242,7 @@
* defaults if none are specified. We might want to create separate method
* for creating/getting. . .
*/
- public ICache getCache( ICompositeCacheAttributes cattr, Attributes attr )
+ public ICache getCache( ICompositeCacheAttributes cattr, IElementAttributes attr )
{
ICache cache = ( ICache ) caches.get( cattr.getCacheName() );
1.6 +4 -3 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/CompositeCacheConfigurator.java
Index: CompositeCacheConfigurator.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/CompositeCacheConfigurator.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- CompositeCacheConfigurator.java 16 Feb 2002 02:37:23 -0000 1.5
+++ CompositeCacheConfigurator.java 18 Feb 2002 17:14:25 -0000 1.6
@@ -16,7 +16,8 @@
import org.apache.stratum.jcs.config.OptionConverter;
import org.apache.stratum.jcs.config.PropertySetter;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.ElementAttributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.behavior.ICache;
import org.apache.stratum.jcs.engine.behavior.ICompositeCacheAttributes;
@@ -237,11 +238,11 @@
ICache cache = null;
if ( regionPrefix.equals( SYSTEM_REGION_PREFIX ) )
{
- cache = ccMgr.createSystemCache( regName, auxCaches, cca, new Attributes() );
+ cache = ccMgr.createSystemCache( regName, auxCaches, cca, new ElementAttributes() );
}
else
{
- cache = ccMgr.createCache( regName, auxCaches, cca, new Attributes() );
+ cache = ccMgr.createCache( regName, auxCaches, cca, new ElementAttributes() );
}
return cache;
}
1.17 +21 -21 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/Cache.java
Index: Cache.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/Cache.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- Cache.java 16 Feb 2002 02:37:23 -0000 1.16
+++ Cache.java 18 Feb 2002 17:14:25 -0000 1.17
@@ -64,7 +64,7 @@
import org.apache.stratum.jcs.access.exception.ObjectNotFoundException;
import org.apache.stratum.jcs.access.exception.ObjectExistsException;
-import org.apache.stratum.jcs.engine.Attributes;
+import org.apache.stratum.jcs.engine.behavior.IElementAttributes;
import org.apache.stratum.jcs.engine.CacheElement;
import org.apache.stratum.jcs.engine.behavior.ICache;
@@ -107,7 +107,7 @@
final String cacheName;
/** Region Elemental Attributes, default */
- public Attributes attr;
+ public IElementAttributes attr;
/** Cache Attributes, for hub and memory auxiliary */
public ICompositeCacheAttributes cacheAttr;
@@ -147,7 +147,7 @@
* @param cattr The cache attribute
* @param attr The default element attributes
*/
- public Cache( String cacheName, ICache[] auxCaches, ICompositeCacheAttributes cattr, Attributes attr )
+ public Cache( String cacheName, ICache[] auxCaches, ICompositeCacheAttributes cattr, IElementAttributes attr )
{
numInstances++;
@@ -210,7 +210,7 @@
}
else
{
- put( key, val, ( Attributes ) this.attr.copy() );
+ put( key, val, ( IElementAttributes ) this.attr.copy() );
}
return;
}
@@ -220,7 +220,7 @@
public void put( Serializable key, Serializable val )
throws IOException
{
- put( key, val, ( Attributes ) this.attr.copy() );
+ put( key, val, ( IElementAttributes ) this.attr.copy() );
return;
}
@@ -232,7 +232,7 @@
* @param val Value to cache
* @param attr Element attributes
*/
- public void put( Serializable key, Serializable val, Attributes attr )
+ public void put( Serializable key, Serializable val, IElementAttributes attr )
throws IOException
{
//p( "puting in cache" );
@@ -272,7 +272,7 @@
* @param val Value to cache
* @param attr Element attributes
*/
- protected synchronized void updateCaches( Serializable key, Serializable val, Attributes attr )
+ protected synchronized void updateCaches( Serializable key, Serializable val, IElementAttributes attr )
throws IOException
{
// FIXME: Replace with tracing aspects
@@ -288,7 +288,7 @@
/** Description of the Method */
- protected synchronized void updateCaches( Serializable key, Serializable val, Attributes attr, boolean updateRemoteCache )
+ protected synchronized void updateCaches( Serializable key, Serializable val, IElementAttributes attr, boolean updateRemoteCache )
throws IOException
{
// FIXME: Replace with tracing aspects
@@ -299,7 +299,7 @@
}
CacheElement ce = new CacheElement( cacheName, key, val );
- ce.setAttributes( attr );
+ ce.setElementAttributes( attr );
updateExclude( ce, updateRemoteCache );
}
@@ -345,7 +345,7 @@
if ( log.isDebugEnabled() )
{
- log.debug( "Cache.updateExclude(ce,updateRemoteCache) > updateRemoteCache = " + updateRemoteCache + " key=" + ce.getKey() + ", value type=" + ce.getVal().getClass().getName() + ", " + ce.getAttributes().toString() );
+ log.debug( "Cache.updateExclude(ce,updateRemoteCache) > updateRemoteCache = " + updateRemoteCache + " key=" + ce.getKey() + ", value type=" + ce.getVal().getClass().getName() + ", " + ce.getElementAttributes().toString() );
if ( updateRemoteCache == ICache.INCLUDE_REMOTE_CACHE )
{
@@ -384,10 +384,10 @@
{
if ( log.isDebugEnabled() )
{
- log.debug( "ce.getAttributes().IS_REMOTE = " + ce.getAttributes().IS_REMOTE );
+ log.debug( "ce.getElementAttributes().getIsRemote() = " + ce.getElementAttributes().getIsRemote() );
}
- //if ( first.ce.getAttributes().IS_REMOTE && updateRemoteCache) {
- if ( ce.getAttributes().IS_REMOTE && updateRemoteCache )
+ //if ( first.ce.getElementAttributes().getIsRemote() && updateRemoteCache) {
+ if ( ce.getElementAttributes().getIsRemote() && updateRemoteCache )
{
try
{
@@ -417,7 +417,7 @@
log.debug( "lateralcache in aux list: cattr " +
cacheAttr.getUseLateral() );
}
- if ( cacheAttr.getUseLateral() && ce.getAttributes().IS_LATERAL && updateRemoteCache )
+ if ( cacheAttr.getUseLateral() && ce.getElementAttributes().getIsLateral() && updateRemoteCache )
{
// later if we want a multicast, possibly delete abnormal broadcaster
@@ -634,7 +634,7 @@
// Cache item found in memory.
// The existing logic simply returns null if a cache item is found to be expired.
// Don't we also want to remove it from the cache ?
- if ( !ce.getAttributes().IS_ETERNAL && ( ( System.currentTimeMillis() - ce.getAttributes().createTime ) > ( ce.getAttributes().ttl * 1000 ) ) )
+ if ( !ce.getElementAttributes().getIsEternal() && ( ( System.currentTimeMillis() - ce.getElementAttributes().getCreateTime() ) > ( ce.getElementAttributes().getMaxLifeSeconds() * 1000 ) ) )
{
if ( log.isInfoEnabled() )
{
@@ -845,11 +845,11 @@
MemoryElementDescriptor me = ( MemoryElementDescriptor ) entry.getValue();
try
{
- if ( aux.getCacheType() == ICacheType.LATERAL_CACHE && !me.ce.getAttributes().IS_LATERAL )
+ if ( aux.getCacheType() == ICacheType.LATERAL_CACHE && !me.ce.getElementAttributes().getIsLateral() )
{
continue;
}
- aux.put( key, me.ce.getVal(), me.ce.getAttributes() );
+ aux.put( key, me.ce.getVal(), me.ce.getElementAttributes() );
}
catch ( Exception e )
{
@@ -912,7 +912,7 @@
MemoryElementDescriptor me = ( MemoryElementDescriptor ) entry.getValue();
//try {
// should call update
- aux.put( key, me.ce.getVal(), me.ce.getAttributes() );
+ aux.put( key, me.ce.getVal(), me.ce.getElementAttributes() );
// remove this exception from the interface
//} catch( Exception e ) {
// log.error( e );
@@ -1011,7 +1011,7 @@
*
* @return The attributes value
*/
- public Attributes getAttributes()
+ public IElementAttributes getElementAttributes()
{
return attr;
}
@@ -1044,7 +1044,7 @@
*
* @return The elementAttributes value
*/
- public Attributes getElementAttributes( Serializable key )
+ public IElementAttributes getElementAttributes( Serializable key )
throws CacheException, IOException
{
CacheElement ce = ( CacheElement ) getCacheElement( key );
@@ -1052,7 +1052,7 @@
{
throw new ObjectNotFoundException( "key " + key + " is not found" );
}
- return ce.getAttributes();
+ return ce.getElementAttributes();
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>