geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccard...@apache.org
Subject svn commit: r495833 [2/2] - in /geronimo/server/trunk: applications/console/geronimo-console-framework/src/main/webapp/ applications/console/geronimo-console-framework/src/main/webapp/WEB-INF/data/ applications/console/geronimo-console-standard/src/mai...
Date Sat, 13 Jan 2007 03:52:37 GMT
Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/web.xml?view=diff&rev=495833&r1=495832&r2=495833
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/web.xml
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/web.xml
Fri Jan 12 19:52:36 2007
@@ -799,6 +799,48 @@
             <param-value>console-standard.LDAPViewer</param-value>
         </init-param>
     </servlet>
+    <servlet>
+        <description>Automated generated Portlet Wrapper</description>
+        <display-name>Pluto Wrapper for ClassLoaderView Portlet</display-name>
+        <servlet-name>ClassLoaderViewer</servlet-name>
+        <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
+        <init-param>
+            <param-name>portlet-class</param-name>
+            <param-value>org.apache.geronimo.console.classloaderview.ClassLoaderViewPortlet</param-value>
+        </init-param>
+        <init-param>
+            <param-name>portlet-guid</param-name>
+            <param-value>console-standard.ClassLoaderViewer</param-value>
+        </init-param>
+    </servlet>
+    <servlet>
+        <description>Automated generated Portlet Wrapper</description>
+        <display-name>Pluto Wrapper for JNDIView Portlet</display-name>
+        <servlet-name>JNDIViewer</servlet-name>
+        <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
+        <init-param>
+            <param-name>portlet-class</param-name>
+            <param-value>org.apache.geronimo.console.jndiview.JNDIViewPortlet</param-value>
+        </init-param>
+        <init-param>
+            <param-name>portlet-guid</param-name>
+            <param-value>console-standard.JNDIViewer</param-value>
+        </init-param>
+    </servlet>
+    <servlet>
+        <description>Automated generated Portlet Wrapper</description>
+        <display-name>Pluto Wrapper for DependencyView Portlet</display-name>
+        <servlet-name>DependencyViewer</servlet-name>
+        <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
+        <init-param>
+            <param-name>portlet-class</param-name>
+            <param-value>org.apache.geronimo.console.dependencyview.DependencyViewPortlet</param-value>
+        </init-param>
+        <init-param>
+            <param-name>portlet-guid</param-name>
+            <param-value>console-standard.DependencyViewer</param-value>
+        </init-param>
+    </servlet>
 
 <!-- [INSERT FRAGMENT HERE] -->
 
@@ -809,6 +851,18 @@
     <servlet-mapping>
         <servlet-name>JMXViewer</servlet-name>
         <url-pattern>/JMXViewer/*</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>ClassLoaderViewer</servlet-name>
+        <url-pattern>/ClassLoaderViewer/*</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>JNDIViewer</servlet-name>
+        <url-pattern>/JNDIViewer/*</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>DependencyViewer</servlet-name>
+        <url-pattern>/DependencyViewer/*</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
       <servlet-name>dwr-invoker</servlet-name>

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationClassLoader.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationClassLoader.java?view=diff&rev=495833&r1=495832&r2=495833
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationClassLoader.java
(original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationClassLoader.java
Fri Jan 12 19:52:36 2007
@@ -28,6 +28,8 @@
 
 import org.apache.commons.logging.LogFactory;
 
+import org.apache.geronimo.kernel.util.ClassLoaderRegistry;
+
 /**
  *
  * @version $Rev$ $Date$
@@ -37,6 +39,7 @@
     
     public ConfigurationClassLoader(URI id, URL[] urls, ClassLoader parent) {
         super(urls, parent);
+        ClassLoaderRegistry.add(this);
         this.id = id;
     }
     
@@ -50,6 +53,7 @@
         clearSoftCache(ObjectOutputStream.class, "subclassAudits");
         clearSoftCache(ObjectStreamClass.class, "localDescs");
         clearSoftCache(ObjectStreamClass.class, "reflectors");
+        ClassLoaderRegistry.remove(this);    
     }
 
     public String toString() {
@@ -78,5 +82,8 @@
                 cache.clear();
             }
         }
+    }
+    protected void Finalize(){
+        ClassLoaderRegistry.remove(this);
     }
 }

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java?view=diff&rev=495833&r1=495832&r2=495833
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java
(original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java
Fri Jan 12 19:52:36 2007
@@ -34,6 +34,7 @@
 
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.util.ClassLoaderRegistry;
 
 /**
  * A MultiParentClassLoader is a simple extension of the URLClassLoader that simply changes
the single parent class
@@ -69,6 +70,7 @@
         nonOverridableClasses = new String[0];
         hiddenResources = new String[0];
         nonOverridableResources = new String[0];
+        ClassLoaderRegistry.add(this);
     }
 
 
@@ -116,6 +118,7 @@
         nonOverridableClasses = new String[0];
         hiddenResources = new String[0];
         nonOverridableResources = new String[0];
+        ClassLoaderRegistry.add(this);
     }
 
     public MultiParentClassLoader(Artifact id, URL[] urls, ClassLoader[] parents, boolean
inverseClassLoading, Collection hiddenClasses, Collection nonOverridableClasses) {
@@ -131,6 +134,7 @@
         this.nonOverridableClasses = nonOverridableClasses;
         hiddenResources = toResources(hiddenClasses);
         nonOverridableResources = toResources(nonOverridableClasses);
+        ClassLoaderRegistry.add(this);
     }
 
     public MultiParentClassLoader(MultiParentClassLoader source) {
@@ -178,6 +182,7 @@
         nonOverridableClasses = new String[0];
         hiddenResources = new String[0];
         nonOverridableResources = new String[0];
+        ClassLoaderRegistry.add(this);
     }
 
     private static ClassLoader[] copyParents(ClassLoader[] parents) {
@@ -442,6 +447,8 @@
         // it has introspected. If we don't flush the cache, we may run out of
         // Permanent Generation space.
         Introspector.flushCaches();
+        
+        ClassLoaderRegistry.remove(this);
     }
 
     private static final Object lock = new Object();
@@ -467,6 +474,9 @@
                 cache.clear();
             }
         }
+    }
+    protected void Finalize(){
+        ClassLoaderRegistry.remove(this);
     }
 
 }

Added: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/ClassLoaderRegistry.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/ClassLoaderRegistry.java?view=auto&rev=495833
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/ClassLoaderRegistry.java
(added)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/ClassLoaderRegistry.java
Fri Jan 12 19:52:36 2007
@@ -0,0 +1,44 @@
+package org.apache.geronimo.kernel.util;
+
+import java.util.List;
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+
+
+public class ClassLoaderRegistry {
+    private static List<WeakReference> list = new ArrayList<WeakReference>();
+    public static List getList(){
+        List<ClassLoader> ret = new ArrayList<ClassLoader>();
+        for(int i=0;i<list.size();i++)
+            if(list.get(i) != null)ret.add((ClassLoader)list.get(i).get());
+            else
+                list.remove(i);
+        return ret;
+    }
+    public static boolean add(ClassLoader cloader){
+        if(contains(cloader))
+            return false;
+        return list.add(new WeakReference<ClassLoader>(cloader));
+    } 
+    public static boolean contains(ClassLoader cloader){
+        for(int i=0;i<list.size();i++){
+            WeakReference wk = list.get(i);
+            if(wk.get() == null)list.remove(i);
+            else if(wk.get().equals(cloader))
+                return true;            
+        }
+        return false;
+    }
+    public static boolean remove(ClassLoader cloader){
+        boolean result = false;
+        for(int i=0;i<list.size();i++){
+            WeakReference wk = list.get(i);
+            if(wk.get() == null)list.remove(i);
+            else if(wk.get().equals(cloader)){
+                list.remove(i);
+                result = true;
+            }
+        }
+        return result;
+    } 
+}



Mime
View raw message