commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From billbar...@apache.org
Subject cvs commit: jakarta-commons/daemon/src/java/org/apache/commons/daemon/support DaemonLoader.java
Date Thu, 19 Aug 2004 05:44:58 GMT
billbarker    2004/08/18 22:44:58

  Modified:    daemon/src/java/org/apache/commons/daemon/support
                        DaemonLoader.java
  Log:
  Include super classes when checking for Daemon interface.
  
  Submitted By: Nigel Rantor wiggly@wiggly.org
  
  Revision  Changes    Path
  1.5       +7 -7      jakarta-commons/daemon/src/java/org/apache/commons/daemon/support/DaemonLoader.java
  
  Index: DaemonLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/daemon/src/java/org/apache/commons/daemon/support/DaemonLoader.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DaemonLoader.java	27 Feb 2004 07:57:51 -0000	1.4
  +++ DaemonLoader.java	19 Aug 2004 05:44:58 -0000	1.5
  @@ -110,14 +110,14 @@
               if (c==null) throw new ClassNotFoundException(cn);
   
               /* Check interface */
  -            Class[] interf = c.getInterfaces();
               boolean isdaemon = false;
  -            if ( interf != null ) {
  -              for(int i=0;i<interf.length;i++) {
  -                if (interf[i].getName().equals("org.apache.commons.daemon.Daemon"))
  -                  isdaemon = true;
  -              }
  +            try {
  +              Class dclass = cl.loadClass("org.apache.commons.daemon.Daemon");
  +              isdaemon = dclass.isAssignableFrom(c);
  +            } catch(Exception cnfex) {
  +              // Swallow if Daemon not found.
               }
  +
               /* Check methods */
               Class[] myclass = new Class[1];
               if (isdaemon) {
  
  
  

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


Mime
View raw message