home *** CD-ROM | disk | FTP | other *** search
- <%@ page language="java"
- contentType="text/html"
- %>
- <html>
- <head><title>Bugzero console</title></head>
- <body topmargin=0>
- <center>
- <h2>Bugzero Console</h2>
- <%=com.websina.VersionUID.version%>
- <p>
- <%
- // WARNING: set consoleDisabled to true when all is done !!!!!!!
- // defaulted to true
-
- boolean consoleDisabled = true;
-
- String cmd = request.getParameter("cmd");
- boolean doDebug = com.websina.util.log.Log.doDebug();
- String enableDebug = "Enable Debug";
- String disableDebug = "Disable Debug";
- String debug = null;
- if (doDebug) {
- debug = disableDebug;
- } else {
- debug = enableDebug;
- }
- if (disableDebug.equals(cmd)) {
- debug = enableDebug;
- } else if (enableDebug.equals(cmd)) {
- debug = disableDebug;
- }
-
- String showLog = "Log Configuration";
- String showDatabase = "DB Configuration";
- String showMetaData = "Test DB Connection";
- String showConnectionPool = "Connection Pool";
- String showJVM = "Show JVM";
- %>
-
- <% if (consoleDisabled) { %>
- This console has been disabled.
- To enable it, edit console.jsp and set consoleDisabled = false.
- <% } else { %>
- <table cellspacing=2 cellpadding=2 border=0>
- <tr>
- <td><form method="post">
- <input type="submit" name="cmd" value="<%=showLog%>">
- </form></td>
- <td><form method="post">
- <input type="submit" name="cmd" value="<%=debug%>">
- </form></td>
- <td><form method="post">
- <input type="submit" name="cmd" value="<%=showDatabase%>">
- </form></td>
- <td><form method="post">
- <input type="submit" name="cmd" value="<%=showMetaData%>">
- </form></td>
- <td><form method="post">
- <input type="submit" name="cmd" value="<%=showConnectionPool%>">
- </form></td>
- <td><form method="post">
- <input type="submit" name="cmd" value="<%=showJVM%>">
- </form></td>
- </tr>
- </table>
- </center>
- <pre>
- <%
- if (showLog.equals(cmd)) {
- out.println(com.websina.util.log.Log.currentLog());
- } else if (enableDebug.equals(cmd)) {
- com.websina.util.log.Log.setDebug(true);
- out.println("Debug is enabled!");
- } else if (disableDebug.equals(cmd)) {
- com.websina.util.log.Log.setDebug(false);
- out.println("Debug is disabled!");
- } else if (showDatabase.equals(cmd)) {
- out.println(com.websina.persistence.DBManager.getConfiguration());
- } else if (showMetaData.equals(cmd)) {
- String result = null;
- try {
- result = com.websina.persistence.DBManager.getMetaData();
- out.println(result);
- } catch (Exception e) {
- e.printStackTrace(new java.io.PrintWriter(out));
- }
- } else if (showConnectionPool.equals(cmd)) {
- String result = null;
- try {
- result = com.websina.persistence.DBManager.getConnectionPoolInfo();
- out.println(result);
- } catch (Exception e) {
- e.printStackTrace(new java.io.PrintWriter(out));
- }
- } else if (showJVM.equals(cmd)) {
- try {
- out.println("<b>Java Runtime:</b>");
- out.println("java version " + System.getProperty("java.version"));
- out.println(System.getProperty("java.vm.name") + " " + System.getProperty("java.vm.version") + " " + System.getProperty("java.vm.vendor"));
- out.println(System.getProperty("os.name") + " " + System.getProperty("os.version") + " " + System.getProperty("os.arch"));
-
- out.println("\n<b>Classpath:</b>");
- out.println(System.getProperty("java.class.path"));
-
- out.println("\n<b>Web Context:</b>");
- out.println(request.getContextPath()+ " (" + application.getServerInfo() + ")");
-
- out.println("\n<b>lib Files:</b>");
- java.io.File file = new java.io.File(com.websina.bean.AppContext.getHome(), "lib");
- out.println(file.getPath());
- String[] fs = file.list();
- if (fs != null) {
- for (int i=0; i<fs.length; i++) {
- out.println(" " + fs[i]);
- }
- }
-
- out.println("\n<b>ClassLoader:</b>");
- out.println(Thread.currentThread().getContextClassLoader());
-
- out.println("\n<b>Memory Usage:</b>");
- long[] memory = com.websina.util.MemoryCounter.getMemory();
- out.println("Total: " + memory[0]/1024 + "K Available: "+memory[1]/1024 + "K\n");
- String[] threads = com.websina.util.ThreadCounter.lists();
- out.println("<b>" + threads[0] + "</b>");
- for (int i=1; i<threads.length; i++) {
- out.println(threads[i]);
- }
- } catch (Exception e) {
- e.printStackTrace(new java.io.PrintWriter(out));
- }
- } else { %>
- This console is used for trouble shooting only. You should disable it after all is done.
- To disable this console, edit console.jsp and set consoleDisabled = true.
- <% }} %>
- </pre>
- </body></html>
-