asmuts 2004/07/15 18:29:20
Modified: src/java/org/apache/jcs/engine CacheEventQueue.java
Log:
logging on recreation
Revision Changes Path
1.11 +36 -1
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.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- CacheEventQueue.java 12 Jun 2004 02:34:13 -0000 1.10
+++ CacheEventQueue.java 16 Jul 2004 01:29:20 -0000 1.11
@@ -46,7 +46,7 @@
// time to wait for an event before snuffing the background thread
// if the queue is empty.
// make configurable later
- private int waitToDieMillis = 60000;
+ private int waitToDieMillis = 10000;
private ICacheListener listener;
private long listenerId;
@@ -305,6 +305,7 @@
destroyed = false;
processorThread = new QProcessor( this );
processorThread.start();
+ log.info( "Cache event queue created: " + this );
}
else
{
@@ -347,6 +348,40 @@
return value;
}
}
+
+
+ public String getStats()
+ {
+ StringBuffer buf = new StringBuffer();
+ buf.append( "\n -------------------------" );
+ buf.append( "\n Cache Event Queue:" );
+ buf.append( "\n working = " + this.working );
+ buf.append( "\n isAlive() = " + this.isAlive() );
+ buf.append( "\n isEmpty() = " + this.isEmpty() );
+
+ int size = 0;
+ synchronized (queueLock)
+ {
+ // wait until there is something to read
+ if (head == tail)
+ {
+ size = 0;
+ }
+ else
+ {
+ Node n = head;
+ while ( n != null )
+ {
+ n = n.next;
+ size++;
+ }
+ }
+
+ buf.append( "\n size = " + size );
+ }
+ return buf.toString();
+ }
+
///////////////////////////// Inner classes /////////////////////////////
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]