asmuts 02/02/20 22:59:28
Modified: src/java/org/apache/stratum/jcs/access TestCacheAccess.java
src/java/org/apache/stratum/jcs/engine
ElementAttributes.java
Log:
you can now set the element attributes in the cache.ccf file for each region, or
establish defaults. This will save a lot of code.
Need to revisit the copy method.
Revision Changes Path
1.16 +1 -0
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.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- TestCacheAccess.java 21 Feb 2002 06:42:53 -0000 1.15
+++ TestCacheAccess.java 21 Feb 2002 06:59:28 -0000 1.16
@@ -680,6 +680,7 @@
p( "type 'putag num group' to put automatically from a group" );
p( "type 'put key val' to put" );
p( "type 'stats' to get stats" );
+ p( "type 'deattr' to get teh default element attributes" );
p( "type 'cloneattr num' to clone attr" );
// p( "type 'removeLateralDirect key' to remove lateral" );
p( "type 'switch number' to switch to testCache[number], 1 == testCache1" );
1.4 +20 -2
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.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ElementAttributes.java 18 Feb 2002 18:17:20 -0000 1.3
+++ ElementAttributes.java 21 Feb 2002 06:59:28 -0000 1.4
@@ -179,9 +179,23 @@
{
try
{
- ElementAttributes attr = ( ElementAttributes ) this.clone();
- attr.createTime = System.currentTimeMillis();
+// ElementAttributes attr = ( ElementAttributes ) this.clone();
+// attr.createTime = System.currentTimeMillis();
+// attr.setLastAccessTimeNow();
+// return attr;
+
+ // need to make this more efficient. Just want to insure
+ // a proper copy
+ ElementAttributes attr = new ElementAttributes( );
+ attr.setIdleTime(this.getIdleTime());
+ attr.setIsEternal(this.getIsEternal());
+ attr.setIsDistribute(this.getIsDistribute());
+ attr.setIsLateral(this.getIsLateral());
+ attr.setIsRemote(this.getIsRemote());
+ attr.setIsSpool(this.getIsSpool());
+ attr.setMaxLifeSeconds(this.getMaxLifeSeconds());
return attr;
+
}
catch ( Exception e )
{
@@ -450,6 +464,10 @@
.append( ", IS_SPOOL = " ).append( IS_SPOOL )
.append( ", IS_REMOTE = " ).append( IS_REMOTE )
.append( ", IS_ETERNAL = " ).append( IS_ETERNAL )
+ .append( ", MaxLifeSeconds = " ).append( this.getMaxLifeSeconds() )
+ .append( ", IdleTime = " ).append( this.getIdleTime() )
+ .append( ", CreateTime = " ).append( this.getCreateTime() )
+ .append( ", LastAccessTime = " ).append( this.getLastAccessTime() )
.append( ", getTimeToLiveSeconds() = " ).append( String.valueOf(
getTimeToLiveSeconds() ) )
.append( ", createTime = " ).append( String.valueOf( createTime ) )
.append( " ]" );
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>