From: Jean-Marc V. <jm...@us...> - 2004-09-05 12:33:17
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/cocoon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10837/src/org/exist/cocoon Modified Files: StatusGenerator.java Log Message: factor out dependancy on package org.exist.storage.store Index: StatusGenerator.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/cocoon/StatusGenerator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StatusGenerator.java 6 Aug 2003 09:36:19 -0000 1.3 --- StatusGenerator.java 5 Sep 2004 12:33:04 -0000 1.4 *************** *** 8,21 **** import java.io.IOException; import java.io.InputStreamReader; - import java.util.Iterator; import java.util.Locale; import org.apache.cocoon.ProcessingException; import org.apache.cocoon.generation.AbstractGenerator; ! import org.exist.storage.BrokerPool; ! import org.exist.storage.BufferStats; ! import org.exist.storage.store.BFile; ! import org.exist.storage.store.DOMFile; ! import org.exist.util.Configuration; import org.xml.sax.SAXException; import org.xml.sax.helpers.AttributesImpl; --- 8,16 ---- import java.io.IOException; import java.io.InputStreamReader; import java.util.Locale; import org.apache.cocoon.ProcessingException; import org.apache.cocoon.generation.AbstractGenerator; ! import org.exist.storage.report.XMLStatistics; import org.xml.sax.SAXException; import org.xml.sax.helpers.AttributesImpl; *************** *** 30,47 **** public final static String NAMESPACE = "http://exist.sourceforge.net/generators/status"; public final static String PREFIX = "status"; public StatusGenerator() { super(); } ! /* (non-Javadoc) * @see org.apache.cocoon.generation.Generator#generate() */ public void generate() throws IOException, SAXException, ProcessingException { this.contentHandler.startDocument(); this.contentHandler.startPrefixMapping(PREFIX, NAMESPACE); this.contentHandler.startElement(NAMESPACE, "status", PREFIX + ":status", new AttributesImpl()); genVMStatus(); ! genInstanceStatus(); this.contentHandler.endElement(NAMESPACE, "status", PREFIX + ":status"); this.contentHandler.endPrefixMapping(PREFIX); --- 25,45 ---- public final static String NAMESPACE = "http://exist.sourceforge.net/generators/status"; public final static String PREFIX = "status"; + XMLStatistics stats; public StatusGenerator() { super(); + stats = new XMLStatistics(contentHandler); } ! /** * @see org.apache.cocoon.generation.Generator#generate() */ public void generate() throws IOException, SAXException, ProcessingException { + stats.setContentHandler(contentHandler); this.contentHandler.startDocument(); this.contentHandler.startPrefixMapping(PREFIX, NAMESPACE); this.contentHandler.startElement(NAMESPACE, "status", PREFIX + ":status", new AttributesImpl()); genVMStatus(); ! stats.genInstanceStatus(); this.contentHandler.endElement(NAMESPACE, "status", PREFIX + ":status"); this.contentHandler.endPrefixMapping(PREFIX); *************** *** 78,82 **** this.contentHandler.endElement(NAMESPACE, "system", PREFIX + ":system"); } ! private void genInstanceStatus() throws SAXException { AttributesImpl atts = new AttributesImpl(); --- 76,80 ---- this.contentHandler.endElement(NAMESPACE, "system", PREFIX + ":system"); } ! /* =================== private void genInstanceStatus() throws SAXException { AttributesImpl atts = new AttributesImpl(); *************** *** 158,160 **** --- 156,168 ---- this.contentHandler.endElement(NAMESPACE, elem, PREFIX + ':' + elem); } + */ + + /** + * @param elem + * @param value + * @throws SAXException + */ + private void addValue(String elem, String value) throws SAXException { + stats.addValue(elem, value); + } } |