User: user57  
  Date: 02/03/01 16:03:57

  Modified:    jetty/src/main/org/jboss/jetty JettyService.java
  Log:
   o replace printStackTrace with logging
   o special handling for MultiException on start, since it does not
     implement a proper printStackTrace method...
  
  Revision  Changes    Path
  1.53      +26 -5     contrib/jetty/src/main/org/jboss/jetty/JettyService.java
  
  Index: JettyService.java
  ===================================================================
  RCS file: /cvsroot/jboss/contrib/jetty/src/main/org/jboss/jetty/JettyService.java,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- JettyService.java 24 Feb 2002 05:08:29 -0000      1.52
  +++ JettyService.java 2 Mar 2002 00:03:56 -0000       1.53
  @@ -5,7 +5,7 @@
    * See terms of license at gnu.org.
    */
   
  -// $Id: JettyService.java,v 1.52 2002/02/24 05:08:29 janb Exp $
  +// $Id: JettyService.java,v 1.53 2002/03/02 00:03:56 user57 Exp $
   
   //------------------------------------------------------------------------------
   
  @@ -17,6 +17,7 @@
   import java.io.InputStream;
   
   import java.net.URL;
  +import java.util.Iterator;
   import javax.management.MBeanRegistration;
   import javax.management.MBeanServer;
   import javax.management.ObjectName;
  @@ -27,10 +28,11 @@
   import org.jboss.web.AbstractWebContainer.WebDescriptorParser;
   import org.jboss.web.AbstractWebContainer;
   import org.jboss.web.WebApplication;
  +
   import org.mortbay.util.jmx.CodeMBean;
   import org.mortbay.util.jmx.LogMBean;
   import org.mortbay.util.Log;
  -
  +import org.mortbay.util.MultiException; 
   
   
   //------------------------------------------------------------------------------
  @@ -38,7 +40,7 @@
    * A service to launch jetty from JMX.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Julian Gosnell</a>
  - * @version $Revision: 1.52 $
  + * @version $Revision: 1.53 $
    */
   
   public class JettyService
  @@ -212,6 +214,17 @@
     // 'service' interface
     //----------------------------------------------------------------------------
   
  +  /**
  +   * mex should implement a better printStackTrace...
  +   */
  +  protected void log(MultiException e)
  +  {
  +     log.error("multipule exceptions...");
  +     Iterator iter = e.getExceptions().iterator();
  +     while (iter.hasNext()) {
  +        log.error("exception", (Exception)iter.next());
  +     }
  +  }
   
     protected boolean _started=false;
   
  @@ -223,14 +236,22 @@
   
       if (!isInitialised())
       {
  -      try {ensureService();} catch (Exception e) {e.printStackTrace();}      // TODO
  +      try {ensureService();} catch (Exception e) { log.error("operation failed", 
e); }
       }
       else
         _log.warn("Jetty has already been initialised");
   
       if (!isStarted())
       {
  -      try{_jetty.start();} catch (Exception e){e.printStackTrace();} // TODO
  +      try {
  +         _jetty.start();
  +      } 
  +      catch (MultiException e) { 
  +         log(e);
  +      }
  +      catch (Exception e) { 
  +         log.error("operation failed", e);
  +      }
         _started=true;
       }
       else
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to