giacomo 01/12/11 13:08:45 Modified: src/org/apache/cocoon/generation StatusGenerator.java Log: Displaying status Submitted by: Sebastien Koechlin <[EMAIL PROTECTED]> Revision Changes Path 1.9 +18 -15 xml-cocoon2/src/org/apache/cocoon/generation/StatusGenerator.java Index: StatusGenerator.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/generation/StatusGenerator.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- StatusGenerator.java 2001/12/06 13:13:47 1.8 +++ StatusGenerator.java 2001/12/11 21:08:45 1.9 @@ -52,7 +52,8 @@ * * @author <a href="mailto:[EMAIL PROTECTED]">Paul Russell</a> (Luminas Limited) * @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a> - * @version CVS $Revision: 1.8 $ $Date: 2001/12/06 13:13:47 $ + * @author <a href="mailto:[EMAIL PROTECTED]">Sébastien Kœchlin</a> (iVision) + * @version CVS $Revision: 1.9 $ $Date: 2001/12/11 21:08:45 $ */ public class StatusGenerator extends ComposerGenerator implements Recyclable { @@ -181,28 +182,30 @@ Iterator i = this.storejanitor.iterator(); while( i.hasNext() ) { Store store = (Store) i.next(); - startGroup(ch, store.getClass().getName()+" (hash = "+store.hashCode()+")" ); + startGroup(ch, store.getClass().getName()+" (hash = 0x"+Integer.toHexString(store.hashCode())+")" ); int size = 0; + int empty = 0; atts.addAttribute(namespace, "name", "name", "CDATA", "cached"); ch.startElement(namespace, "value", "value", atts); // For each element in Store Enumeration e = store.keys(); - List cachelist = new ArrayList(); + atts.clear(); while( e.hasMoreElements() ) { size++; - atts.clear(); - - ch.startElement(namespace, "line", "line", atts); - - Object o = e.nextElement(); - String value = - o.toString() + " (hash: " + - o.hashCode() + " | class: " + - o.getClass().getName() + + Object key = e.nextElement(); + Object val = store.get( key ); + String line = null; + if( val == null ) { + empty++; + } else { + line = key.toString() + " (class: " + + val.getClass().getName() + ")" ; - - ch.characters(value.toCharArray(), 0, value.length()); + ch.startElement(namespace, "line", "line", atts); + ch.characters(line.toCharArray(), 0, line.length()); ch.endElement(namespace, "line", "line"); + }; + }; @@ -216,7 +219,7 @@ ch.endElement(namespace, "value", "value"); - addValue(ch, "size", String.valueOf(size) + " items in cache"); + addValue(ch, "size", String.valueOf(size) + " items in cache (" + empty + " are empty)"); endGroup(ch); }; endGroup(ch);
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]