User: jules_gosnell
  Date: 01/06/23 03:08:30

  Modified:    jetty/src/main/org/jboss/jetty JettyService.java
  Log:
  touch up logging messages
  maintain our own 'started' state flag
  
  Revision  Changes    Path
  1.17      +23 -20    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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- JettyService.java 2001/06/21 22:24:46     1.16
  +++ JettyService.java 2001/06/23 10:08:30     1.17
  @@ -36,7 +36,7 @@
    *      
    *   @see <related>
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Julian Gosnell</a>
  - *   @version $Revision: 1.16 $
  + *   @version $Revision: 1.17 $
    */
   
   class JettyMBean extends HttpServerMBean
  @@ -86,6 +86,7 @@
   // NOTES
   
   // Logging is in serious need of tidying up...
  +// I could parameterise the properties file - do we still need it - shouldn't it 
use MLET ?
   
   public class JettyService extends AbstractWebContainer
     implements JettyServiceMBean, MBeanRegistration
  @@ -154,21 +155,22 @@
       com.mortbay.Util.Log.instance().disableLog(); // remove default logger
       com.mortbay.Util.Log.instance().add(_logSink);
       
  -    com.mortbay.Util.Log.event("JBoss and Jetty Log models connected");
  +    com.mortbay.Util.Log.event("connected JBoss and Jetty Log models");
     }
     
     protected void
       ensureProperties()
       throws IOException
     {
  -    InputStream propertiesIn = 
getClass().getClassLoader().getResourceAsStream("jetty.properties");
  +    String props="jetty.properties";
  +    InputStream propertiesIn = 
getClass().getClassLoader().getResourceAsStream(props);
       
       if (propertiesIn == null)
  -      throw new IOException("failed to load jetty.properties");
  +      throw new IOException("failed to load "+props);
       
       System.getProperties().load(propertiesIn);
       
  -    com.mortbay.Util.Log.event("successfully loaded properties");
  +    com.mortbay.Util.Log.event("loaded properties from: "+props);
     }
   
     protected void
  @@ -181,7 +183,7 @@
       _jetty.setWebDefault(getWebDefault());
       _jetty.setUnpackWars(getUnpackWars());
   
  -    com.mortbay.Util.Log.event("Jetty instantiated and initialised");
  +    com.mortbay.Util.Log.event("instantiated and configured server");
   
       // unset log for the main thread.
       // tomcat's child threads have a copy of it anyway.
  @@ -197,9 +199,9 @@
       {
         try
         {
  +     com.mortbay.Util.Log.event("MBean peers WILL be created for Jetty Contexts");
        _mbean  = new JettyMBean(_jetty);
        _server.registerMBean(_mbean, new ObjectName(_mbean.newObjectName(_server)));
  -     com.mortbay.Util.Log.event("MBean peers WILL be created for Jetty Contexts");
         }
         catch (Exception e)
         {
  @@ -219,7 +221,10 @@
       {
         try
         {
  -     _jetty.configure((String)_configuration.elementAt(i));
  +     String config=(String)_configuration.elementAt(i);
  +     com.mortbay.Util.Log.event("loading config: "+config);
  +     _jetty.configure(config);
  +     com.mortbay.Util.Log.event("loaded config: "+config);
         }
         catch(IOException e)
         {
  @@ -271,6 +276,8 @@
         com.mortbay.Util.Log.warning("Jetty has already been initialised");
     }
     
  +  protected boolean _started=false;
  +
     public void
       startService()
       throws Exception
  @@ -279,6 +286,7 @@
       {
         super.startService();
         _jetty.start();
  +      _started=true;
       }
       else
         com.mortbay.Util.Log.warning("Jetty has already been started");
  @@ -291,6 +299,7 @@
       {
         super.stopService();
         try {_jetty.stop();} catch (Exception e) {e.printStackTrace();}
  +      _started=false;
       }
       else
         com.mortbay.Util.Log.warning("Jetty has already been stopped");
  @@ -327,12 +336,6 @@
     {
       _jetty.undeploy(warUrl);
     }
  -  
  -  //   public boolean
  -  //     isDeployed(String warUrl)
  -  //   {
  -  //     return _jetty.isDeployed(warUrl);
  -  //   }
   
     //----------------------------------------------------------------------------
   
  @@ -345,13 +348,13 @@
     protected boolean
       isStarted()
     {
  -    return (_jetty!=null && _jetty.isStarted());
  +    return (_jetty!=null && _started);
     }
     
     protected boolean
       isStopped()
     {
  -    return (_jetty!=null && !_jetty.isStarted());
  +    return (!_started);
     }
     
     protected boolean
  @@ -373,7 +376,7 @@
     public void
       setPublishMBeans(boolean publishMBeans)
     {
  -    com.mortbay.Util.Log.event("setting PublishMBeans to "+publishMBeans);
  +    com.mortbay.Util.Log.event("set PublishMBeans to "+publishMBeans);
   
       _publishMBeans=publishMBeans;
     }
  @@ -394,7 +397,7 @@
     public void
       setUnpackWars(boolean unpackWars)
     {
  -    com.mortbay.Util.Log.event("setting UnpackWars to "+unpackWars);
  +    com.mortbay.Util.Log.event("set UnpackWars to "+unpackWars);
   
       if (isInitialised())
         _jetty.setUnpackWars(unpackWars);
  @@ -418,7 +421,7 @@
     public void
       setWebDefault(String webDefault)
     {
  -    com.mortbay.Util.Log.event("setting WebDefault to "+webDefault);
  +    com.mortbay.Util.Log.event("set WebDefault to "+webDefault);
   
       if (isInitialised())
         _jetty.setWebDefault(webDefault);
  @@ -441,7 +444,7 @@
     public void
       addConfiguration(String configUrl)
     {
  -    com.mortbay.Util.Log.event("adding Configuration "+configUrl);
  +    com.mortbay.Util.Log.event("added Configuration "+configUrl);
   
       if (isInitialised())
         _jetty.addConfiguration(configUrl);
  
  
  

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

Reply via email to