geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r667080 - /geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/ValveGBean.java
Date Thu, 12 Jun 2008 13:33:18 GMT
Author: kevan
Date: Thu Jun 12 06:33:17 2008
New Revision: 667080

URL: http://svn.apache.org/viewvc?rev=667080&view=rev
Log:
GERONIMO-4113 Merge from branches/2.1. Use appropriate classloader when loading valve class

Modified:
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/ValveGBean.java

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/ValveGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/ValveGBean.java?rev=667080&r1=667079&r2=667080&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/ValveGBean.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/ValveGBean.java
Thu Jun 12 06:33:17 2008
@@ -16,6 +16,7 @@
  */
 package org.apache.geronimo.tomcat;
 
+import java.lang.ClassLoader;
 import java.util.Map;
 
 import org.apache.catalina.Valve;
@@ -37,7 +38,6 @@
     private final Valve valve;
     private final ValveGBean nextValve;
     private final String className;
- 
     
     public ValveGBean(){      
         valve = null;
@@ -45,7 +45,7 @@
         className = null;
     }
     
-    public ValveGBean(String className, Map initParams, ValveGBean nextValve) throws Exception{
+    public ValveGBean(String className, Map initParams, ValveGBean nextValve, ClassLoader
classLoader) throws Exception{
 
         //Validate
         if (className == null){
@@ -62,9 +62,9 @@
         }
         
         this.className = className;
-        
+
         //Create the Valve object
-        valve = (Valve)Class.forName(className).newInstance();
+        valve = (Valve)classLoader.loadClass(className).newInstance();
 
         //Set the parameters
         setParameters(valve, initParams);
@@ -97,10 +97,11 @@
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(ValveGBean.class, J2EE_TYPE);
         infoFactory.addAttribute("className", String.class, true);
         infoFactory.addAttribute("initParams", Map.class, true);
+        infoFactory.addAttribute("classLoader", ClassLoader.class, false);
         infoFactory.addReference("NextValve", ValveGBean.class, J2EE_TYPE);
         infoFactory.addOperation("getInternalObject");
         infoFactory.addOperation("getNextValve");
-        infoFactory.setConstructor(new String[] { "className", "initParams", "NextValve"
});
+        infoFactory.setConstructor(new String[] { "className", "initParams", "NextValve",
"classLoader" });
         GBEAN_INFO = infoFactory.getBeanInfo();
     }
 



Mime
View raw message