jfclere 2003/06/12 14:51:21
Modified: daemon/src/java/org/apache/commons/daemon/support
DaemonLoader.java
Log:
Arrange it to start Tomcat5: There are 2 init methods in the Bootstrap
class.
Revision Changes Path
1.3 +13 -15
jakarta-commons-sandbox/daemon/src/java/org/apache/commons/daemon/support/DaemonLoader.java
Index: DaemonLoader.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/daemon/src/java/org/apache/commons/daemon/support/DaemonLoader.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DaemonLoader.java 11 Jun 2003 21:24:11 -0000 1.2
+++ DaemonLoader.java 12 Jun 2003 21:51:21 -0000 1.3
@@ -160,20 +160,16 @@
}
}
/* Check methods */
- Method[] method = c.getMethods();
- if ( method != null) {
- for(int i=0;i<method.length;i++) {
- if (method[i].getName().equals("start"))
- start = method[i];
- if (method[i].getName().equals("init"))
- init = method[i];
- if (method[i].getName().equals("stop"))
- stop = method[i];
- if (method[i].getName().equals("destroy"))
- destroy = method[i];
+ Class[] myclass = new Class[1];
+ myclass[0] = ar.getClass();
+ init = c.getMethod("init",myclass);
- }
- }
+ myclass = null;
+ start = c.getMethod("start",myclass);
+
+ stop = c.getMethod("stop",myclass);
+
+ destroy = c.getMethod("destroy",myclass);
/* Create a new instance of the daemon */
daemon=c.newInstance();
@@ -195,7 +191,9 @@
arg[0] = context;
init.invoke(daemon,arg);
} else {
- init.invoke(daemon,ar);
+ Object arg[] = new Object[1];
+ arg[0] = ar;
+ init.invoke(daemon,arg);
}
} catch (Throwable t) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]