tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r585707 - /tomcat/sandbox/gdev6x/java/org/apache/catalina/startup/ConnectorCreateRule.java
Date Wed, 17 Oct 2007 21:38:24 GMT
Author: fhanik
Date: Wed Oct 17 14:38:24 2007
New Revision: 585707

URL: http://svn.apache.org/viewvc?rev=585707&view=rev
Log:
http://issues.apache.org/bugzilla/show_bug.cgi?id=43643

Modified:
    tomcat/sandbox/gdev6x/java/org/apache/catalina/startup/ConnectorCreateRule.java

Modified: tomcat/sandbox/gdev6x/java/org/apache/catalina/startup/ConnectorCreateRule.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/gdev6x/java/org/apache/catalina/startup/ConnectorCreateRule.java?rev=585707&r1=585706&r2=585707&view=diff
==============================================================================
--- tomcat/sandbox/gdev6x/java/org/apache/catalina/startup/ConnectorCreateRule.java (original)
+++ tomcat/sandbox/gdev6x/java/org/apache/catalina/startup/ConnectorCreateRule.java Wed Oct
17 14:38:24 2007
@@ -20,12 +20,15 @@
 package org.apache.catalina.startup;
 
 
-import org.apache.catalina.Executor;
-import org.apache.catalina.Service;
 import org.apache.catalina.connector.Connector;
-import org.apache.tomcat.util.IntrospectionUtils;
 import org.apache.tomcat.util.digester.Rule;
 import org.xml.sax.Attributes;
+import org.apache.catalina.Service;
+import org.apache.catalina.Executor;
+import org.apache.tomcat.util.IntrospectionUtils;
+import java.lang.reflect.Method;
+import org.apache.juli.logging.LogFactory;
+import org.apache.juli.logging.Log;
 
 
 /**
@@ -34,7 +37,7 @@
 
 public class ConnectorCreateRule extends Rule {
 
-
+    protected static Log log = LogFactory.getLog(ConnectorCreateRule.class);
     // --------------------------------------------------------- Public Methods
 
 
@@ -50,14 +53,18 @@
             ex = svc.getExecutor(attributes.getValue("executor"));
         }
         Connector con = new Connector(attributes.getValue("protocol"));
-        if ( ex != null )  setExecutor(con,ex);
-        
+        if ( ex != null )  _setExecutor(con,ex);
+
         digester.push(con);
     }
-    
-    public void setExecutor(Connector con, Executor ex) throws Exception {
-    	IntrospectionUtils.callMethod1(con.getProtocolHandler(), "setExecutor", 
-    			ex, java.util.concurrent.Executor.class.getName(), getClass().getClassLoader());
+
+    public void _setExecutor(Connector con, Executor ex) throws Exception {
+        Method m = IntrospectionUtils.findMethod(con.getProtocolHandler().getClass(),"setExecutor",new
Class[] {java.util.concurrent.Executor.class});
+        if (m!=null) {
+            m.invoke(con.getProtocolHandler(), new Object[] {ex});
+        }else {
+            log.warn("Connector ["+con+"] does not support external executors. Method setExecutor(java.util.concurrent.Executor)
not found.");
+        }
     }
 
 
@@ -65,7 +72,7 @@
      * Process the end of this element.
      */
     public void end() throws Exception {
-        digester.pop();
+        Object top = digester.pop();
     }
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message