geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r1076568 - in /geronimo/server/trunk: plugingroups/console-jetty/ plugingroups/console-jetty/src/main/history/ plugingroups/console-tomcat/ plugingroups/console-tomcat/src/main/history/ plugins/ plugins/debugviews/debugviews-console-jetty/s...
Date Thu, 03 Mar 2011 09:38:16 GMT
Author: xiaming
Date: Thu Mar  3 09:38:16 2011
New Revision: 1076568

URL: http://svn.apache.org/viewvc?rev=1076568&view=rev
Log:
GERONIMO-5598 reenable debug view portlet, patch provided by Shenghao Fang

Modified:
    geronimo/server/trunk/plugingroups/console-jetty/pom.xml
    geronimo/server/trunk/plugingroups/console-jetty/src/main/history/dependencies.xml
    geronimo/server/trunk/plugingroups/console-tomcat/pom.xml
    geronimo/server/trunk/plugingroups/console-tomcat/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/debugviews/debugviews-console-jetty/src/main/plan/plan.xml
    geronimo/server/trunk/plugins/debugviews/debugviews-console-tomcat/src/main/plan/plan.xml
    geronimo/server/trunk/plugins/debugviews/debugviews-portlets/pom.xml
    geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/classloaderview/ClassLoaderViewHelper.java
    geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/classloaderview/ClassLoaderViewPortlet.java
    geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/dependencyview/DependencyViewHelper.java
    geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/jndiview/JNDIViewHelper.java
    geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/portlet.xml
    geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/web.xml
    geronimo/server/trunk/plugins/pom.xml

Modified: geronimo/server/trunk/plugingroups/console-jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugingroups/console-jetty/pom.xml?rev=1076568&r1=1076567&r2=1076568&view=diff
==============================================================================
--- geronimo/server/trunk/plugingroups/console-jetty/pom.xml (original)
+++ geronimo/server/trunk/plugingroups/console-jetty/pom.xml Thu Mar  3 09:38:16 2011
@@ -87,12 +87,12 @@
             <!--<type>car</type>-->
         <!--</dependency>-->
 
-        <!--<dependency>-->
-            <!--<groupId>org.apache.geronimo.plugins</groupId>-->
-            <!--<artifactId>debugviews-console-jetty</artifactId>-->
-            <!--<version>${project.version}</version>-->
-            <!--<type>car</type>-->
-        <!--</dependency>-->
+        <dependency>
+            <groupId>org.apache.geronimo.plugins</groupId>
+            <artifactId>debugviews-console-jetty</artifactId>
+            <version>${project.version}</version>
+            <type>car</type>
+        </dependency>
 
         <!--<dependency>-->
             <!--<groupId>org.apache.geronimo.plugins</groupId>-->

Modified: geronimo/server/trunk/plugingroups/console-jetty/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugingroups/console-jetty/src/main/history/dependencies.xml?rev=1076568&r1=1076567&r2=1076568&view=diff
==============================================================================
--- geronimo/server/trunk/plugingroups/console-jetty/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugingroups/console-jetty/src/main/history/dependencies.xml Thu
Mar  3 09:38:16 2011
@@ -18,6 +18,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.plugins</groupId>
+        <artifactId>debugviews-console-jetty</artifactId>
+        <type>car</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.plugins</groupId>
         <artifactId>openejb-console-jetty</artifactId>
         <type>car</type>
     </dependency>

Modified: geronimo/server/trunk/plugingroups/console-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugingroups/console-tomcat/pom.xml?rev=1076568&r1=1076567&r2=1076568&view=diff
==============================================================================
--- geronimo/server/trunk/plugingroups/console-tomcat/pom.xml (original)
+++ geronimo/server/trunk/plugingroups/console-tomcat/pom.xml Thu Mar  3 09:38:16 2011
@@ -87,12 +87,12 @@
             <!--<type>car</type>-->
         <!--</dependency>-->
 
-        <!--<dependency>-->
-            <!--<groupId>org.apache.geronimo.plugins</groupId>-->
-            <!--<artifactId>debugviews-console-tomcat</artifactId>-->
-            <!--<version>${project.version}</version>-->
-            <!--<type>car</type>-->
-        <!--</dependency>-->
+        <dependency>
+            <groupId>org.apache.geronimo.plugins</groupId>
+            <artifactId>debugviews-console-tomcat</artifactId>
+            <version>${project.version}</version>
+            <type>car</type>
+        </dependency>
 
         <!--<dependency>-->
             <!--<groupId>org.apache.geronimo.plugins</groupId>-->

Modified: geronimo/server/trunk/plugingroups/console-tomcat/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugingroups/console-tomcat/src/main/history/dependencies.xml?rev=1076568&r1=1076567&r2=1076568&view=diff
==============================================================================
--- geronimo/server/trunk/plugingroups/console-tomcat/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugingroups/console-tomcat/src/main/history/dependencies.xml Thu
Mar  3 09:38:16 2011
@@ -18,6 +18,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.plugins</groupId>
+        <artifactId>debugviews-console-tomcat</artifactId>
+        <type>car</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.plugins</groupId>
         <artifactId>openejb-console-tomcat</artifactId>
         <type>car</type>
     </dependency>

Modified: geronimo/server/trunk/plugins/debugviews/debugviews-console-jetty/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/debugviews/debugviews-console-jetty/src/main/plan/plan.xml?rev=1076568&r1=1076567&r2=1076568&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/debugviews/debugviews-console-jetty/src/main/plan/plan.xml
(original)
+++ geronimo/server/trunk/plugins/debugviews/debugviews-console-jetty/src/main/plan/plan.xml
Thu Mar  3 09:38:16 2011
@@ -57,18 +57,8 @@ limitations under the License.
         </reference>
     </gbean>
 
-    <gbean name="ClassLoaderViewer" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
-        <attribute name="pageTitle">5-3/Debug Views/ClassLoader Viewer</attribute>
-        <attribute name="portletContext">/debug-views</attribute>
-        <attribute name="portletList">[ClassLoaderViewer]</attribute>
-        <attribute name="icon">/images/ico_viewer_16x16.gif</attribute>
-        <reference name="PortalContainerServices">
-            <name>PlutoPortalServices</name>
-        </reference>
-    </gbean>
-
     <gbean name="JNDIViewer" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
-        <attribute name="pageTitle">5-4/Debug Views/JNDI Viewer</attribute>
+        <attribute name="pageTitle">5-3/Debug Views/JNDI Viewer</attribute>
         <attribute name="portletContext">/debug-views</attribute>
         <attribute name="portletList">[JNDIViewer]</attribute>
         <attribute name="icon">/images/ico_viewer_16x16.gif</attribute>
@@ -78,7 +68,7 @@ limitations under the License.
     </gbean>
 
     <gbean name="DependencyViewer" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
-        <attribute name="pageTitle">5-5/Debug Views/Dependency Viewer</attribute>
+        <attribute name="pageTitle">5-4/Debug Views/Dependency Viewer</attribute>
         <attribute name="portletContext">/debug-views</attribute>
         <attribute name="portletList">[DependencyViewer]</attribute>
         <attribute name="icon">/images/ico_viewer_16x16.gif</attribute>

Modified: geronimo/server/trunk/plugins/debugviews/debugviews-console-tomcat/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/debugviews/debugviews-console-tomcat/src/main/plan/plan.xml?rev=1076568&r1=1076567&r2=1076568&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/debugviews/debugviews-console-tomcat/src/main/plan/plan.xml
(original)
+++ geronimo/server/trunk/plugins/debugviews/debugviews-console-tomcat/src/main/plan/plan.xml
Thu Mar  3 09:38:16 2011
@@ -39,7 +39,7 @@ limitations under the License.
     </gbean>
 
     <gbean name="JMXViewer" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
-        <attribute name="pageTitle">5-3-1/Debug Views/JMX Viewer</attribute>
+        <attribute name="pageTitle">5-3-1/Monitoring and Troubleshooting/Debug Views/JMX
Viewer</attribute>
         <attribute name="portletContext">/debug-views</attribute>
         <attribute name="portletList">[JMXViewer]</attribute>
         <attribute name="icon">/images/ico_viewer_16x16.gif</attribute>
@@ -49,7 +49,7 @@ limitations under the License.
     </gbean>
 
     <gbean name="LDAPViewer" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
-        <attribute name="pageTitle">5-3-2/Debug Views/LDAP Viewer</attribute>
+        <attribute name="pageTitle">5-3-2/Monitoring and Troubleshooting/Debug Views/LDAP
Viewer</attribute>
         <attribute name="portletContext">/debug-views</attribute>
         <attribute name="portletList">[LDAPViewer]</attribute>
         <attribute name="icon">/images/ico_viewer_16x16.gif</attribute>
@@ -58,18 +58,8 @@ limitations under the License.
         </reference>
     </gbean>
 
-    <gbean name="ClassLoaderViewer" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
-        <attribute name="pageTitle">5-3-3/Debug Views/ClassLoader Viewer</attribute>
-        <attribute name="portletContext">/debug-views</attribute>
-        <attribute name="portletList">[ClassLoaderViewer]</attribute>
-        <attribute name="icon">/images/ico_viewer_16x16.gif</attribute>
-        <reference name="PortalContainerServices">
-            <name>PlutoPortalServices</name>
-        </reference>
-    </gbean>
-
     <gbean name="JNDIViewer" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
-        <attribute name="pageTitle">5-3-4/Debug Views/JNDI Viewer</attribute>
+        <attribute name="pageTitle">5-3-3/Monitoring and Troubleshooting/Debug Views/JNDI
Viewer</attribute>
         <attribute name="portletContext">/debug-views</attribute>
         <attribute name="portletList">[JNDIViewer]</attribute>
         <attribute name="icon">/images/ico_viewer_16x16.gif</attribute>
@@ -79,7 +69,7 @@ limitations under the License.
     </gbean>
 
     <gbean name="DependencyViewer" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
-        <attribute name="pageTitle">5-3-5/Debug Views/Dependency Viewer</attribute>
+        <attribute name="pageTitle">5-3-4/Monitoring and Troubleshooting/Debug Views/Dependency
Viewer</attribute>
         <attribute name="portletContext">/debug-views</attribute>
         <attribute name="portletList">[DependencyViewer]</attribute>
         <attribute name="icon">/images/ico_viewer_16x16.gif</attribute>

Modified: geronimo/server/trunk/plugins/debugviews/debugviews-portlets/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/debugviews/debugviews-portlets/pom.xml?rev=1076568&r1=1076567&r2=1076568&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/debugviews/debugviews-portlets/pom.xml (original)
+++ geronimo/server/trunk/plugins/debugviews/debugviews-portlets/pom.xml Thu Mar  3 09:38:16
2011
@@ -96,6 +96,7 @@
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-servlet_3.0_spec</artifactId>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>

Modified: geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/classloaderview/ClassLoaderViewHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/classloaderview/ClassLoaderViewHelper.java?rev=1076568&r1=1076567&r2=1076568&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/classloaderview/ClassLoaderViewHelper.java
(original)
+++ geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/classloaderview/ClassLoaderViewHelper.java
Thu Mar  3 09:38:16 2011
@@ -1,238 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.geronimo.console.classloaderview;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.geronimo.console.util.TreeEntry;
-import org.apache.geronimo.kernel.config.MultiParentClassLoader;
-import org.apache.geronimo.kernel.util.ClassLoaderRegistry;
-import org.directwebremoting.annotations.RemoteMethod;
-import org.directwebremoting.annotations.RemoteProxy;
-
-@RemoteProxy
-public class ClassLoaderViewHelper {
-    Map<String, TreeEntry> nodeHash;
-    private static final String NO_CHILD = "none";
-    
-    private static final String NORMAL_TYPE = "normal";
-    
-    private static final CmpTreeEntry cmp = new CmpTreeEntry();
-
-    @RemoteMethod
-    public String getTrees(boolean inverse) {
-        nodeHash = new HashMap<String, TreeEntry>();
-
-        List list = ClassLoaderRegistry.getList();
-        Iterator iter = list.iterator();
-        while (iter.hasNext()) {
-            if (!inverse)
-                updateTree((ClassLoader) iter.next());
-            else
-                inverseTree((ClassLoader) iter.next());
-        }
-
-        return this.printClassLoaders();
-    }
-
-    public TreeEntry inverseTree(ClassLoader classloader) {
-        TreeEntry node = nodeHash.get(classloader.toString());
-        if (null != node)
-            return node;
-        node = new TreeEntry(classloader.toString(), "root");
-        node = addClasses(node, classloader);
-        nodeHash.put(node.getName(), node);
-
-        if (classloader instanceof MultiParentClassLoader) {
-            MultiParentClassLoader mpclassloader = (MultiParentClassLoader) classloader;
-            ClassLoader[] parents = mpclassloader.getParents();
-            if (null != parents && 0 < parents.length) {
-                for (int i = 0; i < parents.length; i++) {
-                    TreeEntry parentNode = inverseTree(parents[i]);
-                    node.addChild(parentNode);
-                }
-            }
-        } else if (classloader.getParent() != null) {
-            TreeEntry parentNode = inverseTree(classloader.getParent());
-            node.addChild(parentNode);
-        }
-
-        return node;
-    }
-
-    public TreeEntry updateTree(ClassLoader classloader) {
-
-        TreeEntry node = nodeHash.get(classloader.toString());
-        if (null != node)
-            return node;
-
-        node = new TreeEntry(classloader.toString(), NORMAL_TYPE);
-        node = addClasses(node, classloader);
-        nodeHash.put(node.getName(), node);
-
-        if (classloader instanceof MultiParentClassLoader) {
-            MultiParentClassLoader mpclassloader = (MultiParentClassLoader) classloader;
-            ClassLoader[] parents = mpclassloader.getParents();
-            if (null != parents && 0 < parents.length) {
-                for (int i = 0; i < parents.length; i++) {
-                    TreeEntry parentNode = updateTree(parents[i]);
-                    parentNode.addChild(node);
-                }
-            }
-        } else if (classloader.getParent() != null) {
-            TreeEntry parentNode = updateTree(classloader.getParent());
-            parentNode.addChild(node);
-        } else {
-            node.setType("root");
-        }
-
-        return node;
-    }
-
-    private TreeEntry addClasses(TreeEntry node, ClassLoader loader) {
-        try {
-            java.lang.reflect.Field CLASSES_VECTOR_FIELD = ClassLoader.class.getDeclaredField("classes");
-
-            if (CLASSES_VECTOR_FIELD.getType() != java.util.Vector.class) {
-                return node;
-            }
-            CLASSES_VECTOR_FIELD.setAccessible(true);
-
-            final java.util.Vector classes = (java.util.Vector) CLASSES_VECTOR_FIELD.get(loader);
-            if (classes == null)
-                return node;
-
-            final Class[] result;
-
-            synchronized (classes) {
-                result = new Class[classes.size()];
-                classes.toArray(result);
-            }
-
-            CLASSES_VECTOR_FIELD.setAccessible(false);
-
-            TreeEntry classNames = new TreeEntry("Classes", NORMAL_TYPE);
-            TreeEntry interfaceNames = new TreeEntry("Interfaces", NORMAL_TYPE);
-            node.addChild(classNames);
-            node.addChild(interfaceNames);
-
-            for (int i = 0; i < result.length; i++) {
-                if (result[i].isInterface())
-                    interfaceNames.addChild(new TreeEntry(result[i].toString(), NORMAL_TYPE));
-                else
-                    classNames.addChild(new TreeEntry(result[i].toString(), NORMAL_TYPE));
-            }
-            if (classNames.getChildren().size() < 1)
-                classNames.addChild(new TreeEntry(NO_CHILD, NORMAL_TYPE));
-            if (interfaceNames.getChildren().size() < 1)
-                interfaceNames.addChild(new TreeEntry(NO_CHILD, NORMAL_TYPE));
-            return node;
-        } catch (Exception e) {
-            return node;
-        }
-    }
-
-    /*
-     * Usually we can directly give the java objects to clients via dwr, but we found that
it is too slow when the
-     * objects become larger and more complex because of the bad efficiency of dwr. So we
need to translate the java
-     * object to json text by hand in such cases. But it is more specific to the implementation
of dojo, so it is not
-     * very recommended.
-     */
-    String printClassLoaders() {
-        // generate an ordered id
-        List<TreeEntry> rootNodes = new ArrayList<TreeEntry>();
-        for (TreeEntry entry : nodeHash.values()) {
-            if (entry.getType().equals("root"))
-                rootNodes.add(entry);
-        }
-        markupId(-1, rootNodes); // here root nodes have already been sorted
-
-        List<TreeEntry> allNodes = rootNodes;
-        for (TreeEntry entry : nodeHash.values()) {
-            if (!entry.getType().equals("root"))
-                allNodes.add(entry);
-        }
-        StringBuilder sb = new StringBuilder(512);
-
-        sb.append("{label:\"name\",identifier:\"id\",items:[");
-        Iterator<TreeEntry> list = allNodes.iterator();
-        while (list.hasNext()) {
-            TreeEntry curr = list.next();
-            sb.append("{name:\"").append(curr.getName())
-            .append("\",id:\"").append(curr.getId())
-            .append("\",type:\"").append(curr.getType())
-            .append("\",children:[");
-
-            Iterator<TreeEntry> children = curr.getChildren().iterator();
-            // the first child is Classes and the second one is Interfaces
-            printClasses(sb, children.next());
-            sb.append(",");
-            printClasses(sb, children.next());
-            while (children.hasNext()) {
-                TreeEntry child = children.next();
-                sb.append(",{_reference:\"").append(child.getId()).append("\"}");
-            }
-            if (list.hasNext())
-                sb.append("]},");
-            else
-                sb.append("]}");
-        }
-        sb.append("]}");
-        return sb.toString();
-    }
-
-    private void printClasses(StringBuilder sb, TreeEntry classes) {
-        sb.append("{name:\"").append(classes.getName())
-        .append("\",id:\"").append(classes.getId())
-        .append("\",children:[");
-        Iterator<TreeEntry> children = classes.getChildren().iterator();
-        while (children.hasNext()) {
-            TreeEntry child = children.next();
-            sb.append("{name:\"").append(child.getName())
-            .append("\",id:\"").append(child.getId())
-            .append("\"}");
-            if (children.hasNext())
-                sb.append(",");
-        }
-        sb.append("]}");
-    }
-
-    private int markupId(int pre, List<TreeEntry> list) {
-        Collections.sort(list, cmp);
-        for (TreeEntry child : list) {
-            if (null == child.getId())
-                child.setId(String.valueOf(++pre));
-            pre = markupId(pre, child.getChildren());
-        }
-        return pre;
-    }
-
-    static class CmpTreeEntry implements Comparator<TreeEntry> {
-        public int compare(TreeEntry x, TreeEntry y) {
-            if (x.getName() == null)
-                return -1;
-            return x.getName().compareTo(y.getName());
-        }
-    }
-}

Modified: geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/classloaderview/ClassLoaderViewPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/classloaderview/ClassLoaderViewPortlet.java?rev=1076568&r1=1076567&r2=1076568&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/classloaderview/ClassLoaderViewPortlet.java
(original)
+++ geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/classloaderview/ClassLoaderViewPortlet.java
Thu Mar  3 09:38:16 2011
@@ -1,83 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.apache.geronimo.console.classloaderview;
-
-import java.io.IOException;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.WindowState;
-
-import org.apache.geronimo.console.BasePortlet;
-
-public class ClassLoaderViewPortlet extends BasePortlet {
-
-    private static final String NORMALVIEW_JSP = "/WEB-INF/view/classloaderview/view.jsp";
-
-    private static final String MAXIMIZEDVIEW_JSP = "/WEB-INF/view/classloaderview/view.jsp";
-
-    private static final String HELPVIEW_JSP = "/WEB-INF/view/classloaderview/help.jsp";
-
-    private PortletRequestDispatcher normalView;
-
-    private PortletRequestDispatcher maximizedView;
-
-    private PortletRequestDispatcher helpView;
-    
-    public void processAction(ActionRequest actionRequest,
-            ActionResponse actionResponse) throws PortletException, IOException {
-    }
-
-    protected void doView(RenderRequest renderRequest,
-            RenderResponse renderResponse) throws IOException, PortletException {
-        if (WindowState.MINIMIZED.equals(renderRequest.getWindowState())) {
-            return;
-        }
-        if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
-            normalView.include(renderRequest, renderResponse);
-        } else {
-            maximizedView.include(renderRequest, renderResponse);
-        }
-    }
-
-    protected void doHelp(RenderRequest renderRequest,
-            RenderResponse renderResponse) throws PortletException, IOException {
-        helpView.include(renderRequest, renderResponse);
-    }
-
-    public void init(PortletConfig portletConfig) throws PortletException {
-        super.init(portletConfig);
-        normalView = portletConfig.getPortletContext().getRequestDispatcher(
-                NORMALVIEW_JSP);
-        maximizedView = portletConfig.getPortletContext().getRequestDispatcher(
-                MAXIMIZEDVIEW_JSP);
-        helpView = portletConfig.getPortletContext().getRequestDispatcher(
-                HELPVIEW_JSP);
-    }
-
-    public void destroy() {
-        normalView = null;
-        maximizedView = null;
-        helpView = null;
-        super.destroy();
-    }
-}

Modified: geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/dependencyview/DependencyViewHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/dependencyview/DependencyViewHelper.java?rev=1076568&r1=1076567&r2=1076568&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/dependencyview/DependencyViewHelper.java
(original)
+++ geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/dependencyview/DependencyViewHelper.java
Thu Mar  3 09:38:16 2011
@@ -31,12 +31,14 @@ import org.apache.geronimo.console.util.
 import org.apache.geronimo.console.util.TreeEntry;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationInfo;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.Dependency;
 import org.apache.geronimo.kernel.repository.ListableRepository;
 import org.apache.geronimo.management.geronimo.J2EEServer;
 import org.directwebremoting.annotations.RemoteMethod;
@@ -60,12 +62,12 @@ public class DependencyViewHelper {
             return;
         TreeEntry dep = new TreeEntry("dependencies", NOT_LEAF_TYPE);
         curr.addChild(dep);
-        for (Iterator iterator = conf.getDependencies().iterator(); iterator.hasNext();)
{
-            dep.addChild(new TreeEntry(iterator.next().toString(), NORMAL_TYPE));
+        for (Iterator<Dependency> iterator = conf.getEnvironment().getDependencies().iterator();
iterator.hasNext();) {
+            dep.addChild(new TreeEntry(iterator.next().getArtifact().toString(), NORMAL_TYPE));
         }
-        for (Iterator iterator = conf.getServiceParents().iterator(); iterator.hasNext();)
{
-            Configuration config = (Configuration) iterator.next();
-            dep.addChild(new TreeEntry(config.getId().toString(), NORMAL_TYPE));
+        for (Iterator<Artifact> iterator = conf.getDependencyNode().getServiceParents().iterator();
iterator.hasNext();) {
+            Artifact artifact = iterator.next();
+            dep.addChild(new TreeEntry(artifact.toString(), NORMAL_TYPE));
         }
     }
 
@@ -93,7 +95,12 @@ public class DependencyViewHelper {
 
         org.apache.geronimo.kernel.Kernel kernel = org.apache.geronimo.kernel.KernelRegistry.getSingleKernel();
 
-        ConfigurationManager configManager = ConfigurationUtil.getConfigurationManager(kernel);
+        ConfigurationManager configManager = null;
+        try {
+        	configManager = ConfigurationUtil.getConfigurationManager(kernel);
+        } catch	(GBeanNotFoundException e) {
+        	// Ignore
+        }
 
         List infos = configManager.listConfigurations();
         for (Iterator infoIterator = infos.iterator(); infoIterator.hasNext();) {

Modified: geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/jndiview/JNDIViewHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/jndiview/JNDIViewHelper.java?rev=1076568&r1=1076567&r2=1076568&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/jndiview/JNDIViewHelper.java
(original)
+++ geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/jndiview/JNDIViewHelper.java
Thu Mar  3 09:38:16 2011
@@ -35,6 +35,9 @@ import javax.naming.NamingException;
 import org.apache.geronimo.console.util.Tree;
 import org.apache.geronimo.console.util.TreeEntry;
 import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gjndi.KernelContextGBean;
+import org.apache.geronimo.j2ee.jndi.ContextSource;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.naming.java.RootContext;
 import org.directwebremoting.annotations.RemoteMethod;
@@ -145,7 +148,6 @@ public class JNDIViewHelper {
                 treeEnt.addChild(webModule);
             }
 
-            Map map = (Map) kernel.getAttribute(gb, "componentContext");
             String[] servlets = (String[]) kernel.getAttribute(gb, "servlets");
 
             TreeEntry servletsNode = null;
@@ -174,9 +176,16 @@ public class JNDIViewHelper {
                     servletsNode.addChild(new TreeEntry(servlet, NORMAL_TYPE));
                 }
             }
-            Iterator contexts = map.keySet().iterator();
-            while (contexts.hasNext())
-                webModule.addChild(new TreeEntry("java:comp/" + contexts.next(), NORMAL_TYPE));
+            
+            Map map = new HashMap();
+            map.put("name", "ContextSource");
+            map.put("j2eeType", "ContextSource");
+            map.put("J2EEApplication", gb.getNameProperty("J2EEApplication"));
+            map.put("WebModule", gb.getNameProperty("name"));
+            ContextSource contextSource = (ContextSource) kernel.getGBean(new AbstractName(gb.getArtifact(),
map));
+            Context context = contextSource.getContext();
+            Context componentContext = (Context) context.lookup("comp/env");
+            buildContextSub(webModule, componentContext, "java:comp/env");
         }
     }
 
@@ -286,7 +295,6 @@ public class JNDIViewHelper {
 
         TreeEntry treeGlobal = new TreeEntry("Global Context", NOT_LEAF_TYPE);
         jndiTree.addItem(treeGlobal);
-        buildGlobal(treeGlobal, org.apache.xbean.naming.global.GlobalContextManager.getGlobalContext(),
"");
 
         TreeEntry tree = new TreeEntry("Enterprise Applications", NOT_LEAF_TYPE);
         jndiTree.addItem(tree);
@@ -330,7 +338,17 @@ public class JNDIViewHelper {
             temp = new TreeEntry("AppClientModule", NOT_LEAF_TYPE);
             curr.addChild(temp);
         }
-
+        
+        Context globalContext = null;
+        Set<AbstractName> names = kernel.listGBeans(new AbstractNameQuery(KernelContextGBean.class.getName()));
+        for (AbstractName name : names) {
+            String nameProperty = name.getNameProperty("name");
+            if ("ResourceBindings".equals(nameProperty)) {
+                globalContext = (Context) kernel.getGBean(name);
+            }
+        }
+        
+        buildGlobal(treeGlobal, globalContext, "");
         buildEJBModule(kernel, jndiTree.getItems(), entApp);
         buildWebModule(kernel, jndiTree.getItems(), entApp);
         buildResourceModule(kernel, jndiTree.getItems(), entApp);

Modified: geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/portlet.xml?rev=1076568&r1=1076567&r2=1076568&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/portlet.xml
(original)
+++ geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/portlet.xml
Thu Mar  3 09:38:16 2011
@@ -23,27 +23,6 @@ limitations under the License.
 <portlet-app version="1.0">
 
     <portlet>
-        <description>ClassLoader Viewer Portlet</description>
-        <portlet-name>ClassLoaderViewer</portlet-name>
-        <display-name>ClassLoader Viewer</display-name>
-        <portlet-class>org.apache.geronimo.console.classloaderview.ClassLoaderViewPortlet</portlet-class>
-        <expiration-cache>-1</expiration-cache>
-        <supports>
-            <mime-type>text/html</mime-type>
-            <portlet-mode>VIEW</portlet-mode>
-            <portlet-mode>HELP</portlet-mode>
-        </supports>
-        <supported-locale>en</supported-locale>
-        <supported-locale>zh</supported-locale>
-        <supported-locale>ja</supported-locale>
-        <resource-bundle>portletinfo</resource-bundle>
-        <portlet-info>
-            <title>ClassLoader Viewer</title>
-            <short-title>classloaderviewer</short-title>
-        </portlet-info>
-    </portlet>
-
-    <portlet>
         <description>Dependency Viewer Portlet</description>
         <portlet-name>DependencyViewer</portlet-name>
         <display-name>Dependency Viewer</display-name>

Modified: geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/web.xml?rev=1076568&r1=1076567&r2=1076568&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/web.xml
(original)
+++ geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/webapp/WEB-INF/web.xml
Thu Mar  3 09:38:16 2011
@@ -18,7 +18,7 @@ See the License for the specific languag
 limitations under the License.
 -->
 <web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5" metadata-complete="true">
-    <display-name>Geronimo Plan Creator Portlet</display-name>
+    <display-name>Geronimo Debug Views Portlet</display-name>
 
     <servlet>
       <servlet-name>dwr-invoker</servlet-name>
@@ -30,7 +30,6 @@ limitations under the License.
             org.apache.geronimo.console.ldapmanager.LDAPManagerHelper,
 			org.apache.geronimo.console.dependencyview.DependencyViewHelper,
 			org.apache.geronimo.console.jndiview.JNDIViewHelper,
-			org.apache.geronimo.console.classloaderview.ClassLoaderViewHelper,
 			org.apache.geronimo.console.util.Tree,
 			org.apache.geronimo.console.util.TreeEntry
         </param-value>
@@ -46,18 +45,8 @@ limitations under the License.
     </servlet>
 
     <servlet>
-        <servlet-name>ClassLoaderViewer</servlet-name>
-        <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
-        <init-param>
-            <param-name>portlet-name</param-name>
-            <param-value>ClassLoaderViewer</param-value>
-        </init-param>
-        <load-on-startup>1</load-on-startup>
-    </servlet>
-
-    <servlet>
         <servlet-name>DependencyViewer</servlet-name>
-        <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
+        <servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
         <init-param>
             <param-name>portlet-name</param-name>
             <param-value>DependencyViewer</param-value>
@@ -67,7 +56,7 @@ limitations under the License.
 
     <servlet>
         <servlet-name>JMXViewer</servlet-name>
-        <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
+        <servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
         <init-param>
             <param-name>portlet-name</param-name>
             <param-value>JMXViewer</param-value>
@@ -77,7 +66,7 @@ limitations under the License.
 
     <servlet>
         <servlet-name>JNDIViewer</servlet-name>
-        <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
+        <servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
         <init-param>
             <param-name>portlet-name</param-name>
             <param-value>JNDIViewer</param-value>
@@ -87,7 +76,7 @@ limitations under the License.
 
     <servlet>
         <servlet-name>LDAPViewer</servlet-name>
-        <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
+        <servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
         <init-param>
             <param-name>portlet-name</param-name>
             <param-value>LDAPViewer</param-value>
@@ -99,12 +88,7 @@ limitations under the License.
         <servlet-name>dwr-invoker</servlet-name>
         <url-pattern>/dwr2/*</url-pattern>
     </servlet-mapping>
-
-    <servlet-mapping>
-        <servlet-name>ClassLoaderViewer</servlet-name>
-        <url-pattern>/PlutoInvoker/ClassLoaderViewer</url-pattern>
-    </servlet-mapping>
-
+    
     <servlet-mapping>
         <servlet-name>DependencyViewer</servlet-name>
         <url-pattern>/PlutoInvoker/DependencyViewer</url-pattern>

Modified: geronimo/server/trunk/plugins/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/pom.xml?rev=1076568&r1=1076567&r2=1076568&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/pom.xml (original)
+++ geronimo/server/trunk/plugins/pom.xml Thu Mar  3 09:38:16 2011
@@ -162,7 +162,7 @@
         <module>corba</module>
         <module>cxf</module>
         <module>dojo</module>
-        <!--<module>debugviews</module>-->
+        <module>debugviews</module>
         <module>hotdeploy</module>
         <module>j2ee</module>
         <module>jasper</module>



Mime
View raw message