tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tveron...@apache.org
Subject svn commit: r1291228 - in /openejb/trunk/openejb/tomee: tomee-loader/src/main/java/org/apache/tomee/loader/dto/ tomee-loader/src/main/java/org/apache/tomee/loader/servlet/ tomee-webapp/src/main/webapp/staging/js/tomee/ tomee-webapp/src/main/webapp/stag...
Date Mon, 20 Feb 2012 12:22:36 GMT
Author: tveronezi
Date: Mon Feb 20 12:22:35 2012
New Revision: 1291228

URL: http://svn.apache.org/viewvc?rev=1291228&view=rev
Log:
https://issues.apache.org/jira/browse/TOMEE-130

Creating a carousel to show jndi details.

Modified:
    openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/dto/JndiDTO.java
    openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/servlet/JndiServlet.java
    openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/staging/js/tomee/ApplicationI18N.js
    openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/staging/js/tomee/view/ApplicationJndiPanel.js

Modified: openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/dto/JndiDTO.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/dto/JndiDTO.java?rev=1291228&r1=1291227&r2=1291228&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/dto/JndiDTO.java
(original)
+++ openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/dto/JndiDTO.java
Mon Feb 20 12:22:35 2012
@@ -17,8 +17,9 @@
 package org.apache.tomee.loader.dto;
 
 public class JndiDTO {
-
+    public String deploymentId;
     public String path;
     public String name;
     public String value;
+    public String beanType;
 }

Modified: openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/servlet/JndiServlet.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/servlet/JndiServlet.java?rev=1291228&r1=1291227&r2=1291228&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/servlet/JndiServlet.java
(original)
+++ openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/servlet/JndiServlet.java
Mon Feb 20 12:22:35 2012
@@ -18,10 +18,12 @@
 package org.apache.tomee.loader.servlet;
 
 import com.google.gson.Gson;
+import org.apache.openejb.BeanContext;
+import org.apache.openejb.core.ivm.BaseEjbProxyHandler;
 import org.apache.openejb.loader.SystemInstance;
 import org.apache.openejb.spi.ContainerSystem;
+import org.apache.openejb.util.proxy.ProxyManager;
 import org.apache.tomee.loader.dto.JndiDTO;
-import org.apache.tomee.loader.dto.TestDTO;
 
 import javax.naming.Context;
 import javax.naming.InitialContext;
@@ -33,9 +35,7 @@ import javax.servlet.annotation.WebServl
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.io.File;
 import java.io.IOException;
-import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -91,12 +91,29 @@ public class JndiServlet extends HttpSer
                 mountJndiList(jndi, Context.class.cast(obj), key);
             } else {
                 final JndiDTO dto = new JndiDTO();
+
                 dto.path = key;
                 dto.name = pair.getName();
                 dto.value = String.valueOf(obj);
+                dto.deploymentId = getDeploymentId(obj);
+
+                final BeanContext beanContext = getDeployment(dto.deploymentId);
+                dto.beanType = String.valueOf(beanContext.getComponentType());
+                
                 jndi.add(dto);
             }
         }
+    }
+
+    private BeanContext getDeployment(String deploymentID) {
+        ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
+        BeanContext ejb = containerSystem.getBeanContext(deploymentID);
+        return ejb;
+    }
+
+    private String getDeploymentId(Object ejbObj) throws NamingException {
+        final BaseEjbProxyHandler handler = (BaseEjbProxyHandler) ProxyManager.getInvocationHandler(ejbObj);
+        return String.valueOf(handler.deploymentID);
 
     }
 }

Modified: openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/staging/js/tomee/ApplicationI18N.js
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/staging/js/tomee/ApplicationI18N.js?rev=1291228&r1=1291227&r2=1291228&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/staging/js/tomee/ApplicationI18N.js
(original)
+++ openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/staging/js/tomee/ApplicationI18N.js
Mon Feb 20 12:22:35 2012
@@ -48,7 +48,8 @@ TOMEE.ApplicationI18N = (function () {
 
         'app.home.menu.tools.jndi.browser': 'Jndi browser',
         'app.home.menu.tools.jndi.browser.info': 'Click to see more information about the
object',
-        'app.home.menu.tools.jndi.name': 'Name',
+        'app.home.menu.tools.jndi.browser.bean': 'Bean',
+        'app.home.menu.tools.jndi.browser.bean.details': 'See your bean details',
 
         'dummy': 'dummy'
     };

Modified: openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/staging/js/tomee/view/ApplicationJndiPanel.js
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/staging/js/tomee/view/ApplicationJndiPanel.js?rev=1291228&r1=1291227&r2=1291228&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/staging/js/tomee/view/ApplicationJndiPanel.js
(original)
+++ openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/staging/js/tomee/view/ApplicationJndiPanel.js
Mon Feb 20 12:22:35 2012
@@ -65,7 +65,7 @@ TOMEE.ApplicationJndiPanel = function (c
             '          <div class="carousel-caption">',
             '              <h4>{0}</h4>',
             '              <p>{1}</p>',
-            '          </div>',
+            '          </div>'
         ].join('');
 
         var tpl = [
@@ -94,12 +94,20 @@ TOMEE.ApplicationJndiPanel = function (c
     };
 
     var showBeanPanel = function (bean) {
+        var bodyTpl = [
+            '<p>deploymentId: ' + bean.deploymentId + '</p>',
+            '<p>path: ' + bean['path'] + '</p>',
+            '<p>name: ' + bean['name'] + '</p>',
+            '<p>value: ' + bean['value'] + '</p>',
+            '<p>beanType: ' + bean['beanType'] + '</p>'
+        ].join('');
+
         addCarouselItem({
             caption: {
-                title: 'Details',
-                message: 'Here comes the detail'
+                title: TOMEE.ApplicationI18N.get('app.home.menu.tools.jndi.browser.bean'),
+                message: TOMEE.ApplicationI18N.get('app.home.menu.tools.jndi.browser.bean.details')
             },
-            bodyTpl: 'Test!!!'
+            bodyTpl: bodyTpl
         });
     };
 
@@ -135,7 +143,6 @@ TOMEE.ApplicationJndiPanel = function (c
         });
     };
 
-
     return {
         getEl: function () {
             return elements.all;



Mime
View raw message