001 package railo.runtime.debug; 002 003 import java.io.IOException; 004 import java.util.List; 005 006 import railo.runtime.PageContext; 007 import railo.runtime.PageSource; 008 import railo.runtime.db.SQL; 009 import railo.runtime.dump.Dumpable; 010 import railo.runtime.type.Struct; 011 012 /** 013 * debugger interface 014 */ 015 public interface Debugger extends Dumpable { 016 017 /** 018 * reset the debug object 019 */ 020 public abstract void reset(); 021 022 /** 023 * @param source 024 * @return returns a single DebugEntry without a key 025 */ 026 public abstract DebugEntry getEntry(PageContext pc,PageSource source); 027 028 /** 029 * @param source 030 * @param key 031 * @return returns a single DebugEntry witho a key 032 */ 033 public abstract DebugEntry getEntry(PageContext pc,PageSource source, String key); 034 035 /** 036 * add new query execution time 037 * @param datasource 038 * @param name 039 * @param sql 040 * @param recordcount 041 * @param src 042 * @param time 043 */ 044 public abstract void addQueryExecutionTime(String datasource, String name, SQL sql, int recordcount, PageSource src, int time); 045 046 /** 047 * sets if toHTML print html output info or not 048 * @param output The output to set. 049 */ 050 public abstract void setOutput(boolean output); 051 052 /** 053 * @return Returns the queries. 054 */ 055 public abstract List getQueries(); 056 057 /** 058 * @param pc 059 * @throws IOException 060 */ 061 public abstract void writeOut(PageContext pc) throws IOException; 062 063 /** 064 * returns the Debugging Info 065 * @return debugging Info 066 */ 067 public abstract Struct getDebuggingData(); 068 069 /** 070 * adds ne Timer info to debug 071 * @param label 072 * @param exe 073 */ 074 public abstract DebugTimer addTimer(String label, long exe, String template); 075 076 /** 077 * add new Trace to debug 078 * @param type 079 * @param category 080 * @param text 081 * @param page 082 * @param varName 083 * @param varValue 084 * @return debug trace object 085 */ 086 public abstract DebugTrace addTrace(int type, String category, String text, PageSource page, String varName, String varValue); 087 088 public abstract DebugTrace[] getTraces(); 089 090 // FUTURE public abstract void addException(PageException exception); 091 092 }