[jboss-cvs] JBossAS SVN: r108286 - 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 Sep 22 14:49:55 EDT 2010


Author: emuckenhuber
Date: 2010-09-22 14:49:55 -0400 (Wed, 22 Sep 2010)
New Revision: 108286

Modified:
   branches/JBPAPP_5_1/profileservice/src/main/org/jboss/profileservice/web/DebugServlet.java
Log:
use profileservice binding to lookup the management view.

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-09-22 18:35:57 UTC (rev 108285)
+++ branches/JBPAPP_5_1/profileservice/src/main/org/jboss/profileservice/web/DebugServlet.java	2010-09-22 18:49:55 UTC (rev 108286)
@@ -28,7 +28,6 @@
 import java.util.Map;
 import java.util.Set;
 
-import javax.annotation.Resource;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import javax.servlet.ServletConfig;
@@ -41,6 +40,7 @@
 import org.jboss.managed.api.DeploymentState;
 import org.jboss.managed.api.ManagedComponent;
 import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.profileservice.spi.ProfileService;
 
 /**
  * @author Scott.Stark at jboss.org
@@ -48,10 +48,9 @@
  */
 public class DebugServlet extends HttpServlet
 {
-   private static final String MgtViewName = "ManagementView";
+   private static final String ProfileServiceJNDIName = "java:ProfileService";
    private static final long serialVersionUID = 1;
 
-   @Resource(mappedName = MgtViewName)
    private ManagementView mgtView;
    
    enum Operations {
@@ -68,8 +67,9 @@
       {
          try
          {
-            InitialContext ctx = new InitialContext();
-            mgtView = (ManagementView) ctx.lookup(MgtViewName);
+            final InitialContext ctx = new InitialContext();
+            final ProfileService profileService = ProfileService.class.cast(ctx.lookup(ProfileServiceJNDIName));
+            mgtView = profileService.getViewManager();
          }
          catch (NamingException e)
          {



More information about the jboss-cvs-commits mailing list