You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-dev@jakarta.apache.org by as...@apache.org on 2005/01/07 23:27:15 UTC
cvs commit: jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/disk/hsql HSQLCache.java HSQLCacheAttributes.java
asmuts 2005/01/07 14:27:15
Modified: src/java/org/apache/jcs/auxiliary
AuxiliaryCacheAttributes.java
src/java/org/apache/jcs/auxiliary/disk
AbstractDiskCache.java
auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/disk/bdbje
BDBJECache.java BDBJECacheAttributes.java
src/conf cache.ccf cache2.ccf
src/test-conf cache.ccf cache2.ccf
src/java/org/apache/jcs/engine CacheEventQueue.java
src/java/org/apache/jcs/auxiliary/disk/hsql HSQLCache.java
HSQLCacheAttributes.java
Added: src/java/org/apache/jcs/auxiliary
AbstractAuxiliaryCacheAttributes.java
src/java/org/apache/jcs/engine CacheEventQueueFactory.java
Log:
Added the ability to set auxiliaries to use a thread pools in the event queue. By default none are used and no
threadpool configuration is necessary. Everything is as is unless you configure it otherwise.
No version update. I need to make sure the indexed disk cache can function
with more than one thread pulling out of the queue.
Revision Changes Path
1.4 +51 -2 jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/AuxiliaryCacheAttributes.java
Index: AuxiliaryCacheAttributes.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/AuxiliaryCacheAttributes.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AuxiliaryCacheAttributes.java 15 Apr 2004 19:22:53 -0000 1.3
+++ AuxiliaryCacheAttributes.java 7 Jan 2005 22:27:14 -0000 1.4
@@ -27,8 +27,18 @@
*/
public interface AuxiliaryCacheAttributes extends Cloneable, Serializable
{
-
- /**
+
+ /**
+ * Does not use a thread pool.
+ */
+ public static final String SINGLE_QUEUE_TYPE = "SINGLE";
+
+ /**
+ * Uses a thread pool
+ */
+ public static final String POOLED_QUEUE_TYPE = "POOLED";
+
+ /**
* Sets the name of the cache, referenced by the appropriate manager.
*
* @param s The new cacheName value
@@ -59,7 +69,46 @@
*/
public String getName();
+ /**
+ * SINGLE is the default. If you choose POOLED, the value of EventQueuePoolName will be used
+ *
+ * @param s SINGLE or POOLED
+ * @return
+ */
+ public void setEventQueueType( String s );
+
+ /**
+ *
+ * @return SINGLE or POOLED
+ */
+ public String getEventQueueType();
+
+
+ /**
+ * Returns the value used by the factory.
+ *
+ * @return
+ */
+ public int getEventQueueTypeFactoryCode();
+
+ /**
+ * If you choose a POOLED event queue type, the value of EventQueuePoolName will be used.
+ * This is ignored if the pool type is SINGLE
+ *
+ * @param s SINGLE or POOLED
+ * @return
+ */
+ public void setEventQueuePoolName( String s );
+
+ /**
+ * Sets the pool name to use. If a pool is not found by this name, the
+ * thread pool manager will return a default configuration.
+ *
+ * @return name of thread pool to use for this auxiliary
+ */
+ public String getEventQueuePoolName();
+
/** Description of the Method */
public AuxiliaryCacheAttributes copy();
1.1 jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/AbstractAuxiliaryCacheAttributes.java
Index: AbstractAuxiliaryCacheAttributes.java
===================================================================
package org.apache.jcs.auxiliary;
import org.apache.jcs.engine.behavior.ICacheEventQueue;
/**
* @author aaronsm
*
*/
public abstract class AbstractAuxiliaryCacheAttributes implements
AuxiliaryCacheAttributes
{
protected String cacheName;
protected String name;
protected int eventQueueType;
protected String eventQueuePoolName;
/* (non-Javadoc)
* @see org.apache.jcs.auxiliary.AuxiliaryCacheAttributes#setCacheName(java.lang.String)
*/
public void setCacheName( String s )
{
cacheName = s;
}
/* (non-Javadoc)
* @see org.apache.jcs.auxiliary.AuxiliaryCacheAttributes#getCacheName()
*/
public String getCacheName()
{
return cacheName;
}
/* (non-Javadoc)
* @see org.apache.jcs.auxiliary.AuxiliaryCacheAttributes#setName(java.lang.String)
*/
public void setName( String s )
{
name = s;
}
/* (non-Javadoc)
* @see org.apache.jcs.auxiliary.AuxiliaryCacheAttributes#getName()
*/
public String getName()
{
return name;
}
/* (non-Javadoc)
* @see org.apache.jcs.auxiliary.AuxiliaryCacheAttributes#setEventQueueType(java.lang.String)
*/
public void setEventQueueType( String s )
{
if ( s != null )
{
if (s.equalsIgnoreCase( POOLED_QUEUE_TYPE ))
{
this.eventQueueType = ICacheEventQueue.POOLED_QUEUE_TYPE;
}
else
{
// single by default
this.eventQueueType = ICacheEventQueue.SINGLE_QUEUE_TYPE;
}
}
else
{
// null, single by default
this.eventQueueType = ICacheEventQueue.SINGLE_QUEUE_TYPE;
}
}
/* (non-Javadoc)
* @see org.apache.jcs.auxiliary.AuxiliaryCacheAttributes#getEventQueueType()
*/
public String getEventQueueType()
{
if ( this.eventQueueType == ICacheEventQueue.POOLED_QUEUE_TYPE )
{
return POOLED_QUEUE_TYPE;
}
else
{
return SINGLE_QUEUE_TYPE;
}
}
/*
* (non-Javadoc)
* @see org.apache.jcs.auxiliary.AuxiliaryCacheAttributes#getEventQueueTypeFactoryCode()
*/
public int getEventQueueTypeFactoryCode()
{
return this.eventQueueType;
}
/* (non-Javadoc)
* @see org.apache.jcs.auxiliary.AuxiliaryCacheAttributes#setEventQueuePoolName(java.lang.String)
*/
public void setEventQueuePoolName( String s )
{
eventQueuePoolName = s;
}
/* (non-Javadoc)
* @see org.apache.jcs.auxiliary.AuxiliaryCacheAttributes#getEventQueuePoolName()
*/
public String getEventQueuePoolName()
{
return eventQueuePoolName;
}
}
1.24 +11 -6 jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/disk/AbstractDiskCache.java
Index: AbstractDiskCache.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/disk/AbstractDiskCache.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- AbstractDiskCache.java 6 Jan 2005 01:17:55 -0000 1.23
+++ AbstractDiskCache.java 7 Jan 2005 22:27:14 -0000 1.24
@@ -29,9 +29,11 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jcs.auxiliary.AuxiliaryCache;
+import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
import org.apache.jcs.engine.CacheConstants;
-import org.apache.jcs.engine.CacheEventQueue;
+import org.apache.jcs.engine.CacheEventQueueFactory;
import org.apache.jcs.engine.CacheInfo;
+import org.apache.jcs.engine.behavior.ICache;
import org.apache.jcs.engine.behavior.ICacheElement;
import org.apache.jcs.engine.behavior.ICacheEventQueue;
import org.apache.jcs.engine.behavior.ICacheListener;
@@ -107,13 +109,16 @@
// ----------------------------------------------------------- constructors
- public AbstractDiskCache( String cacheName )
+ public AbstractDiskCache( AuxiliaryCacheAttributes attr )
{
- this.cacheName = cacheName;
+ this.cacheName = attr.getCacheName();
- this.cacheEventQueue = new CacheEventQueue( new MyCacheListener(),
+ CacheEventQueueFactory fact = new CacheEventQueueFactory();
+ this.cacheEventQueue = fact.createCacheEventQueue( new MyCacheListener(),
CacheInfo.listenerId,
- cacheName );
+ cacheName,
+ attr.getEventQueuePoolName(),
+ attr.getEventQueueTypeFactoryCode() );
}
// ------------------------------------------------------- interface ICache
1.2 +2 -1 jakarta-turbine-jcs/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/disk/bdbje/BDBJECache.java
Index: BDBJECache.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-jcs/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/disk/bdbje/BDBJECache.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- BDBJECache.java 16 Jul 2004 03:15:53 -0000 1.1
+++ BDBJECache.java 7 Jan 2005 22:27:14 -0000 1.2
@@ -22,6 +22,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
import org.apache.jcs.auxiliary.disk.AbstractDiskCache;
import org.apache.jcs.engine.behavior.ICacheElement;
@@ -40,7 +41,7 @@
public BDBJECache( BDBJECacheAttributes attr )
{
- super( attr.getCacheName() );
+ super( (AuxiliaryCacheAttributes)attr );
this.je = new BDBJE( attr );
if ( log.isDebugEnabled() )
{
1.2 +2 -37 jakarta-turbine-jcs/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/disk/bdbje/BDBJECacheAttributes.java
Index: BDBJECacheAttributes.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-jcs/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/disk/bdbje/BDBJECacheAttributes.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- BDBJECacheAttributes.java 16 Jul 2004 03:15:53 -0000 1.1
+++ BDBJECacheAttributes.java 7 Jan 2005 22:27:14 -0000 1.2
@@ -16,55 +16,20 @@
* limitations under the License.
*/
+import org.apache.jcs.auxiliary.AbstractAuxiliaryCacheAttributes;
import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
import org.apache.jcs.auxiliary.disk.bdbje.behavior.IBDBJECacheAttributes;
/**
* Attributes for Berkeley DB JE disk cache auxiliary.
*/
-public class BDBJECacheAttributes
+public class BDBJECacheAttributes extends AbstractAuxiliaryCacheAttributes
implements AuxiliaryCacheAttributes, IBDBJECacheAttributes
{
-
- private String cacheName;
- private String name;
-
private String diskPath;
private long cacheSize = -1;
private int cachePercent = -1;
-
- /* (non-Javadoc)
- * @see org.apache.jcs.auxiliary.AuxiliaryCacheAttributes#setCacheName(java.lang.String)
- */
- public void setCacheName( String s )
- {
- cacheName = s;
- }
-
- /* (non-Javadoc)
- * @see org.apache.jcs.auxiliary.AuxiliaryCacheAttributes#getCacheName()
- */
- public String getCacheName()
- {
- return cacheName;
- }
-
- /* (non-Javadoc)
- * @see org.apache.jcs.auxiliary.AuxiliaryCacheAttributes#setName(java.lang.String)
- */
- public void setName( String s )
- {
- name = s;
- }
-
- /* (non-Javadoc)
- * @see org.apache.jcs.auxiliary.AuxiliaryCacheAttributes#getName()
- */
- public String getName()
- {
- return name;
- }
/* (non-Javadoc)
* @see org.apache.jcs.auxiliary.AuxiliaryCacheAttributes#copy()
1.12 +40 -5 jakarta-turbine-jcs/src/conf/cache.ccf
Index: cache.ccf
===================================================================
RCS file: /home/cvs/jakarta-turbine-jcs/src/conf/cache.ccf,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- cache.ccf 6 Jan 2005 04:44:28 -0000 1.11
+++ cache.ccf 7 Jan 2005 22:27:14 -0000 1.12
@@ -90,6 +90,23 @@
jcs.auxiliary.DC.attributes.maxKeySize=100000
jcs.auxiliary.DC.attributes.optimizeAtRemoveCount=300
+
+# Disk Cache Using a Pooled Event Queue -- this allows you
+# to control the maximum number of threads it will use.
+# Each region uses 1 thread by default in the SINGLE model.
+# adding more threads does not help.
+# If you want to use a separate pool for each disk cache, either use
+# the single model or define a different auxiliary for each region and use the Pooled.
+# SINGLE is best unless you ahve a huge # of regions.
+jcs.auxiliary.DC2=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
+jcs.auxiliary.DC2.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
+jcs.auxiliary.DC2.attributes.DiskPath=target/test-sandbox/raf
+#new disk cache parameter.
+jcs.auxiliary.DC2.attributes.maxKeySize=100000
+jcs.auxiliary.DC2.attributes.optimizeAtRemoveCount=300
+jcs.auxiliary.DC2.attributes.EventQueueType=POOLED
+jcs.auxiliary.DC2.attributes.EventQueuePoolName=disk_cache_event_queue
+
# Berkeley DB JE
jcs.auxiliary.JE=org.apache.jcs.auxiliary.disk.bdbje.BDBJECacheFactory
jcs.auxiliary.JE.attributes=org.apache.jcs.auxiliary.disk.bdbje.BDBJECacheAttributes
@@ -180,18 +197,36 @@
##############################################################
################## THREAD POOL CONFIGURATION ###################
-# default thread pool config
-thread_pool.default.boundarySize=75
+# Default thread pool config
+thread_pool.default.boundarySize=2000
thread_pool.default.maximumPoolSize=150
thread_pool.default.minimumPoolSize=4
thread_pool.default.keepAliveTime=350000
-thread_pool.default.abortWhenBlocked=false
+#RUN ABORT WAIT BLOCK DISCARDOLDEST
+thread_pool.default.whenBlockedPolicy=RUN
thread_pool.default.startUpSize=4
-# remote cache client thread pool config
+# Default Cache Event Queue thread pool config, used by auxiliaries
+thread_pool.cache_event_queue.useBoundary=false
+#thread_pool.cache_event_queue.boundarySize=2000
+#thread_pool.cache_event_queue.maximumPoolSize=10
+thread_pool.cache_event_queue.minimumPoolSize=5
+thread_pool.cache_event_queue.keepAliveTime=3500
+#thread_pool.cache_event_queue.whenBlockedPolicy=RUN
+thread_pool.cache_event_queue.startUpSize=5
+
+# Disk Cache pool
+thread_pool.disk_cache_event_queue.useBoundary=false
+thread_pool.disk_cache_event_queue.minimumPoolSize=1
+thread_pool.disk_cache_event_queue.keepAliveTime=3500
+thread_pool.disk_cache_event_queue.startUpSize=1
+
+# Remote cache client thread pool config
thread_pool.remote_cache_client.boundarySize=75
thread_pool.remote_cache_client.maximumPoolSize=150
thread_pool.remote_cache_client.minimumPoolSize=4
thread_pool.remote_cache_client.keepAliveTime=350000
-thread_pool.remote_cache_client.abortWhenBlocked=false
+thread_pool.remote_cache_client.whenBlockedPolicy=RUN
thread_pool.remote_cache_client.startUpSize=4
+
+
1.4 +16 -5 jakarta-turbine-jcs/src/conf/cache2.ccf
Index: cache2.ccf
===================================================================
RCS file: /home/cvs/jakarta-turbine-jcs/src/conf/cache2.ccf,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- cache2.ccf 6 Jan 2005 01:17:55 -0000 1.3
+++ cache2.ccf 7 Jan 2005 22:27:14 -0000 1.4
@@ -104,18 +104,29 @@
##############################################################
################## THREAD POOL CONFIGURATION ###################
-# default thread pool config
-thread_pool.default.boundarySize=75
+# Default thread pool config
+thread_pool.default.boundarySize=2000
thread_pool.default.maximumPoolSize=150
thread_pool.default.minimumPoolSize=4
thread_pool.default.keepAliveTime=350000
-thread_pool.default.abortWhenBlocked=false
+#RUN ABORT WAIT BLOCK DISCARDOLDEST
+thread_pool.default.whenBlockedPolicy=RUN
thread_pool.default.startUpSize=4
-# remote cache client thread pool config
+# Default Cache Event Queue thread pool config, used by auxiliaries
+thread_pool.cache_event_queue.useBoundary=false
+#thread_pool.cache_event_queue.boundarySize=2000
+#thread_pool.cache_event_queue.maximumPoolSize=10
+thread_pool.cache_event_queue.minimumPoolSize=5
+thread_pool.cache_event_queue.keepAliveTime=3500
+#thread_pool.cache_event_queue.whenBlockedPolicy=RUN
+thread_pool.cache_event_queue.startUpSize=5
+
+# Remote cache client thread pool config
thread_pool.remote_cache_client.boundarySize=75
thread_pool.remote_cache_client.maximumPoolSize=150
thread_pool.remote_cache_client.minimumPoolSize=4
thread_pool.remote_cache_client.keepAliveTime=350000
-thread_pool.remote_cache_client.abortWhenBlocked=false
+thread_pool.remote_cache_client.whenBlockedPolicy=RUN
thread_pool.remote_cache_client.startUpSize=4
+
1.2 +28 -0 jakarta-turbine-jcs/src/test-conf/cache.ccf
Index: cache.ccf
===================================================================
RCS file: /home/cvs/jakarta-turbine-jcs/src/test-conf/cache.ccf,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cache.ccf 7 Apr 2002 16:55:32 -0000 1.1
+++ cache.ccf 7 Jan 2005 22:27:14 -0000 1.2
@@ -15,3 +15,31 @@
jcs.region.testCache1.cacheattributes.MaxObjects=1000
jcs.region.testCache1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
+
+##############################################################
+################## THREAD POOL CONFIGURATION ###################
+# Default thread pool config
+thread_pool.default.boundarySize=2000
+thread_pool.default.maximumPoolSize=150
+thread_pool.default.minimumPoolSize=4
+thread_pool.default.keepAliveTime=350000
+#RUN ABORT WAIT BLOCK DISCARDOLDEST
+thread_pool.default.whenBlockedPolicy=RUN
+thread_pool.default.startUpSize=4
+
+# Default Cache Event Queue thread pool config, used by auxiliaries
+thread_pool.cache_event_queue.useBoundary=false
+#thread_pool.cache_event_queue.boundarySize=2000
+#thread_pool.cache_event_queue.maximumPoolSize=10
+thread_pool.cache_event_queue.minimumPoolSize=5
+thread_pool.cache_event_queue.keepAliveTime=3500
+#thread_pool.cache_event_queue.whenBlockedPolicy=RUN
+thread_pool.cache_event_queue.startUpSize=5
+
+# Remote cache client thread pool config
+thread_pool.remote_cache_client.boundarySize=75
+thread_pool.remote_cache_client.maximumPoolSize=150
+thread_pool.remote_cache_client.minimumPoolSize=4
+thread_pool.remote_cache_client.keepAliveTime=350000
+thread_pool.remote_cache_client.whenBlockedPolicy=RUN
+thread_pool.remote_cache_client.startUpSize=4
1.3 +16 -5 jakarta-turbine-jcs/src/test-conf/cache2.ccf
Index: cache2.ccf
===================================================================
RCS file: /home/cvs/jakarta-turbine-jcs/src/test-conf/cache2.ccf,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- cache2.ccf 6 Jan 2005 01:17:55 -0000 1.2
+++ cache2.ccf 7 Jan 2005 22:27:14 -0000 1.3
@@ -191,18 +191,29 @@
##############################################################
################## THREAD POOL CONFIGURATION ###################
-# default thread pool config
-thread_pool.default.boundarySize=75
+# Default thread pool config
+thread_pool.default.boundarySize=2000
thread_pool.default.maximumPoolSize=150
thread_pool.default.minimumPoolSize=4
thread_pool.default.keepAliveTime=350000
-thread_pool.default.abortWhenBlocked=false
+#RUN ABORT WAIT BLOCK DISCARDOLDEST
+thread_pool.default.whenBlockedPolicy=RUN
thread_pool.default.startUpSize=4
-# remote cache client thread pool config
+# Default Cache Event Queue thread pool config, used by auxiliaries
+thread_pool.cache_event_queue.useBoundary=false
+#thread_pool.cache_event_queue.boundarySize=2000
+#thread_pool.cache_event_queue.maximumPoolSize=10
+thread_pool.cache_event_queue.minimumPoolSize=5
+thread_pool.cache_event_queue.keepAliveTime=3500
+#thread_pool.cache_event_queue.whenBlockedPolicy=RUN
+thread_pool.cache_event_queue.startUpSize=5
+
+# Remote cache client thread pool config
thread_pool.remote_cache_client.boundarySize=75
thread_pool.remote_cache_client.maximumPoolSize=150
thread_pool.remote_cache_client.minimumPoolSize=4
thread_pool.remote_cache_client.keepAliveTime=350000
-thread_pool.remote_cache_client.abortWhenBlocked=false
+thread_pool.remote_cache_client.whenBlockedPolicy=RUN
thread_pool.remote_cache_client.startUpSize=4
+
1.14 +13 -2 jakarta-turbine-jcs/src/java/org/apache/jcs/engine/CacheEventQueue.java
Index: CacheEventQueue.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/engine/CacheEventQueue.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- CacheEventQueue.java 6 Jan 2005 01:18:27 -0000 1.13
+++ CacheEventQueue.java 7 Jan 2005 22:27:15 -0000 1.14
@@ -48,6 +48,8 @@
// private LinkedQueue queue = new LinkedQueue();
+ private static final int queueType = SINGLE_QUEUE_TYPE;
+
// time to wait for an event before snuffing the background thread
// if the queue is empty.
// make configurable later
@@ -122,6 +124,15 @@
}
}
+ /*
+ * (non-Javadoc)
+ * @see org.apache.jcs.engine.behavior.ICacheEventQueue#getQueueType()
+ */
+ public int getQueueType()
+ {
+ return queueType;
+ }
+
/**
* Event Q is emtpy.
*/
@@ -377,8 +388,8 @@
se.setData("" + this.isAlive());
elems.add(se);
- se.setName( "Empty" );
se = new StatElement();
+ se.setName( "Empty" );
se.setData("" + this.isEmpty());
elems.add(se);
@@ -400,8 +411,8 @@
}
}
+ se = new StatElement();
se.setName( "Size" );
- se = new StatElement();
se.setData("" + size);
elems.add(se);
}
1.1 jakarta-turbine-jcs/src/java/org/apache/jcs/engine/CacheEventQueueFactory.java
Index: CacheEventQueueFactory.java
===================================================================
package org.apache.jcs.engine;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jcs.engine.behavior.ICacheEventQueue;
import org.apache.jcs.engine.behavior.ICacheListener;
/**
* This class hands out event Queues. This allows us to change the
* implementation more easily.
*
* @author aaronsm
*
*/
public class CacheEventQueueFactory
{
private static final Log log = LogFactory.getLog( CacheEventQueueFactory.class );
/**
* The most commonly used factory method.
*
* @param listener
* @param listenerId
* @param cacheName
* @param threadPoolName
* @param poolType
* @return
*/
public ICacheEventQueue createCacheEventQueue( ICacheListener listener,
long listenerId, String cacheName, String threadPoolName, int poolType )
{
return createCacheEventQueue( listener, listenerId, cacheName, 10, 500,
threadPoolName, poolType );
}
/**
* Fully configured event queue.
*
* @param listener
* @param listenerId
* @param cacheName
* @param maxFailure
* @param waitBeforeRetry
* @param threadPoolName
* null is ok, if not a pooled event queue this is ignored
* @param poolType
* single or pooled
* @return
*/
public ICacheEventQueue createCacheEventQueue( ICacheListener listener,
long listenerId, String cacheName, int maxFailure, int waitBeforeRetry,
String threadPoolName, int poolType )
{
if ( log.isDebugEnabled() )
{
log.debug( "threadPoolName = [" + threadPoolName + "] poolType = " + poolType + " ");
}
if (poolType == ICacheEventQueue.SINGLE_QUEUE_TYPE)
{
return new CacheEventQueue( listener, listenerId, cacheName, maxFailure,
waitBeforeRetry );
}
else
{
return new PooledCacheEventQueue( listener, listenerId, cacheName,
maxFailure, waitBeforeRetry, threadPoolName );
}
}
}
1.7 +2 -1 jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/disk/hsql/HSQLCache.java
Index: HSQLCache.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/disk/hsql/HSQLCache.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- HSQLCache.java 15 Apr 2004 19:22:54 -0000 1.6
+++ HSQLCache.java 7 Jan 2005 22:27:15 -0000 1.7
@@ -36,6 +36,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
import org.apache.jcs.auxiliary.disk.AbstractDiskCache;
import org.apache.jcs.engine.CacheConstants;
import org.apache.jcs.engine.behavior.ICacheElement;
@@ -73,7 +74,7 @@
*/
public HSQLCache( HSQLCacheAttributes cattr )
{
- super( cattr.getCacheName() );
+ super( (AuxiliaryCacheAttributes)cattr );
this.cattr = cattr;
1.6 +3 -44 jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/disk/hsql/HSQLCacheAttributes.java
Index: HSQLCacheAttributes.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/disk/hsql/HSQLCacheAttributes.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- HSQLCacheAttributes.java 12 Jun 2004 02:34:13 -0000 1.5
+++ HSQLCacheAttributes.java 7 Jan 2005 22:27:15 -0000 1.6
@@ -18,18 +18,17 @@
*/
+import org.apache.jcs.auxiliary.AbstractAuxiliaryCacheAttributes;
import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
/**
* Description of the Class
*
*/
-public class HSQLCacheAttributes implements AuxiliaryCacheAttributes
+public class HSQLCacheAttributes extends AbstractAuxiliaryCacheAttributes
+ implements AuxiliaryCacheAttributes
{
- private String cacheName;
- private String name;
-
private String diskPath;
/** Constructor for the HSQLCacheAttributes object */
@@ -55,46 +54,6 @@
public String getDiskPath()
{
return this.diskPath;
- }
-
- /**
- * Sets the cacheName attribute of the HSQLCacheAttributes object
- *
- * @param s The new cacheName value
- */
- public void setCacheName( String s )
- {
- this.cacheName = s;
- }
-
- /**
- * Gets the cacheName attribute of the HSQLCacheAttributes object
- *
- * @return The cacheName value
- */
- public String getCacheName()
- {
- return this.cacheName;
- }
-
- /**
- * Gets the name attribute of the HSQLCacheAttributes object
- *
- * @return The name value
- */
- public String getName()
- {
- return this.name;
- }
-
- /**
- * Sets the name attribute of the HSQLCacheAttributes object
- *
- * @param name The new name value
- */
- public void setName( String name )
- {
- this.name = name;
}
/** Description of the Method */
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-jcs-dev-help@jakarta.apache.org