[jboss-cvs] JBossAS SVN: r106341 - branches/JBPAPP_5_1/profileservice/src/main/org/jboss/profileservice/web.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jun 30 05:54:29 EDT 2010


Author: emuckenhuber
Date: 2010-06-30 05:54:28 -0400 (Wed, 30 Jun 2010)
New Revision: 106341

Modified:
   branches/JBPAPP_5_1/profileservice/src/main/org/jboss/profileservice/web/DebugServlet.java
Log:


Modified: branches/JBPAPP_5_1/profileservice/src/main/org/jboss/profileservice/web/DebugServlet.java
===================================================================
--- branches/JBPAPP_5_1/profileservice/src/main/org/jboss/profileservice/web/DebugServlet.java	2010-06-30 09:45:54 UTC (rev 106340)
+++ branches/JBPAPP_5_1/profileservice/src/main/org/jboss/profileservice/web/DebugServlet.java	2010-06-30 09:54:28 UTC (rev 106341)
@@ -48,9 +48,12 @@
  */
 public class DebugServlet extends HttpServlet
 {
+   private static final String MgtViewName = "ManagementView";
    private static final long serialVersionUID = 1;
-   @Resource(mappedName="ManagementView")
+
+   @Resource(mappedName = MgtViewName)
    private ManagementView mgtView;
+   
    enum Operations {
       listDeploymentTree,
       listOperations
@@ -66,7 +69,7 @@
          try
          {
             InitialContext ctx = new InitialContext();
-            mgtView = (ManagementView) ctx.lookup("ManagementView");
+            mgtView = (ManagementView) ctx.lookup(MgtViewName);
          }
          catch (NamingException e)
          {
@@ -80,7 +83,9 @@
          throws ServletException, IOException
    {
       if(mgtView == null)
+      {
          throw new ServletException("The ManagementView has not been injected");
+      }
       String op = req.getParameter("op");
       if(op == null)
          op = "listOperations";
@@ -91,7 +96,7 @@
       {
          case listDeploymentTree:
             opResult = listDeploymentTree();
-         break;
+            break;
          case listOperations:
             opResult = listOperations();
             break;
@@ -124,10 +129,10 @@
             tmp.append(md.getName());
             tmp.append("; state: ").append(state);
             tmp.append('\n');
-            if(state == DeploymentState.STOPPED)
+            if(state == DeploymentState.STOPPED || state == DeploymentState.FAILED)
             {
                // In case there are debug information
-               Exception e = md.getAttachment(Exception.class);
+               final Exception e = md.getAttachment(Exception.class);
                if(e != null)
                {
                   tmp.append("Cause: ").append(getStackTrace(e));
@@ -161,6 +166,7 @@
       }
       return tmp.toString();
    }
+   
    protected String listOperations()
    {
       StringBuilder tmp = new StringBuilder();



More information about the jboss-cvs-commits mailing list