Jules (et al),

I've modified the Jetty/JBoss integration code to work with the new 
Jetty JMX structure (and Jetty4). I'm attaching an rcsdiff of the 
changes. Could you update your JBoss tree with the latest Jetty4, then 
apply these changes, and verify all is OK? I leave it up to you and the 
JBoss group to judge when the time is ripe to commit!

To update your tree to the latest version of Jetty:

1.change the Jetty and JettyExtra CVS tag lines in
   plugins/jetty/build.xml:

<property name="mortbay.jetty.cvs.tag" value="JBossJetty_4_0_B0"/>
<property name="mortbay.jetty.cvs.extra.tag"value="JBossJetty_4_0_B0"/>

2.Run plugins/jetty/build.sh merge-mortbay-cvs

3.apply the attched patch

Here's a summary of what has changed:

+ added a Jetty request log (see jetty.xml)
+ removed unnecessary Debug mbean (see jboss-service.xml)
+ added LogMBean to allow management of LogSinks
+ harmonized DistributedHttpSessionManager with new o.m.j.s.SessionManager


thanks & cheers,
Jan

cvs server: Diffing main/org/jboss
cvs server: Diffing main/org/jboss/jetty
Index: main/org/jboss/jetty/JettyMBean.java
===================================================================
RCS file: /cvsroot/jboss/contrib/jetty/src/main/org/jboss/jetty/JettyMBean.java,v
retrieving revision 1.6
diff -c -I\$Id: -r1.6 JettyMBean.java
*** main/org/jboss/jetty/JettyMBean.java        2002/01/03 04:00:55     1.6
--- main/org/jboss/jetty/JettyMBean.java        2002/02/04 09:33:40
***************
*** 13,33 ****
  import javax.management.MBeanException;
  import javax.management.MBeanServer;
  import javax.management.ObjectName;
! import org.mortbay.jetty.jmx.JettyServerMBean;
  
  public class JettyMBean
!   extends JettyServerMBean
  {
    public JettyMBean(Jetty jetty)
      throws MBeanException, InstanceNotFoundException
!   {
!     super(jetty);
!   }
  
-   protected String
-     newObjectName(MBeanServer server)
-   {
-     //return super.newObjectName(server);
-     return uniqueObjectName(server, "jboss.web:");
-   }
  }
--- 13,34 ----
  import javax.management.MBeanException;
  import javax.management.MBeanServer;
  import javax.management.ObjectName;
! import org.mortbay.jetty.jmx.ServerMBean;
  
  public class JettyMBean
!   extends ServerMBean
  {
+     public static final String JBOSS_DOMAIN = "jboss.web";
+ 
+     static
+     {
+         setDefaultDomain (JBOSS_DOMAIN);
+     }
+     
    public JettyMBean(Jetty jetty)
      throws MBeanException, InstanceNotFoundException
!     {
!         super(jetty);
!     }
  
  }
Index: main/org/jboss/jetty/JettyService.java
===================================================================
RCS file: /cvsroot/jboss/contrib/jetty/src/main/org/jboss/jetty/JettyService.java,v
retrieving revision 1.41
diff -c -I\$Id: -r1.41 JettyService.java
*** main/org/jboss/jetty/JettyService.java      2002/02/02 01:53:30     1.41
--- main/org/jboss/jetty/JettyService.java      2002/02/04 09:33:40
***************
*** 25,31 ****
  import org.jboss.web.AbstractWebContainer.WebDescriptorParser;
  import org.jboss.web.AbstractWebContainer;
  import org.jboss.web.WebApplication;
! import org.mortbay.jetty.jmx.DebugMBean;
  import org.mortbay.util.Log;
  
  //------------------------------------------------------------------------------
--- 25,32 ----
  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;
  
  //------------------------------------------------------------------------------
***************
*** 49,57 ****
  
    Logger       _log    = Logger.getLogger(JettyService.class);
    JettyMBean   _mbean  = null;
!   DebugMBean   _debug  = null;
    Jetty        _jetty  = null;
!   MBeanServer  _server = null;
  
    public
      JettyService()
--- 50,60 ----
  
    Logger       _log    = Logger.getLogger(JettyService.class);
    JettyMBean   _mbean  = null;
!   CodeMBean   _debug  = null;
    Jetty        _jetty  = null;
!     MBeanServer  _server = null;
!     LogMBean _logbean = null;
!     
  
    public
      JettyService()
***************
*** 101,107 ****
--- 104,113 ----
      // why doesn't this work? - investigate...
      //    _jetty.setLogSink(logSink);
  
+      
      _log.debug("connected JBoss and Jetty Log models");
+ 
+     
    }
  
    /** the usual path separators we know */
***************
*** 132,138 ****
    protected void
      ensureJetty()
    {
!     org.mortbay.jetty.jmx.ModelMBeanImpl.setJettyDomain("jboss.web");
  
      // make a Jetty...
      Jetty tmp = new Jetty();
--- 138,144 ----
    protected void
      ensureJetty()
    {
!       //org.mortbay.jetty.util.jmx.ModelMBeanImpl.setDefaultDomain("jboss.web");
  
      // make a Jetty...
      Jetty tmp = new Jetty();
***************
*** 159,167 ****
        {
        _log.debug("MBean peers WILL be created for Jetty Contexts");
        _mbean  = new JettyMBean(_jetty);
!       _debug  = new DebugMBean();
!       _server.registerMBean(_mbean, new ObjectName(_mbean.newObjectName(_server)));
!       _server.registerMBean(_debug, new ObjectName("jboss.web:Jetty=Debug"));
        }
        catch (Throwable e)
        {
--- 165,176 ----
        {
        _log.debug("MBean peers WILL be created for Jetty Contexts");
        _mbean  = new JettyMBean(_jetty);
!       _debug  = new CodeMBean();
!         _logbean = new LogMBean();
!       _server.registerMBean(_mbean, null);
!       _server.registerMBean(_debug, new 
ObjectName(_mbean.getDefaultDomain()+":Jetty=Debug"));
!         _server.registerMBean (_logbean, new 
ObjectName(_mbean.getDefaultDomain()+":Jetty=Log"));
!         
        }
        catch (Throwable e)
        {
***************
*** 260,266 ****
        }
        catch(Exception e)
        {
!       _log.error("problem unregistering DebugMBean", e);
        }
        _debug=null;
      }
--- 269,275 ----
        }
        catch(Exception e)
        {
!       _log.error("problem unregistering CodeMBean", e);
        }
        _debug=null;
      }
cvs server: Diffing main/org/jboss/jetty/ejb
cvs server: Diffing main/org/jboss/jetty/log
cvs server: Diffing main/org/jboss/jetty/security
cvs server: Diffing main/org/jboss/jetty/session
Index: main/org/jboss/jetty/session/DistributedHttpSessionManager.java
===================================================================
RCS file: 
/cvsroot/jboss/contrib/jetty/src/main/org/jboss/jetty/session/DistributedHttpSessionManager.java,v
retrieving revision 1.9
diff -c -I\$Id: -r1.9 DistributedHttpSessionManager.java
*** main/org/jboss/jetty/session/DistributedHttpSessionManager.java     2002/02/01 
19:12:03     1.9
--- main/org/jboss/jetty/session/DistributedHttpSessionManager.java     2002/02/04 
09:33:40
***************
*** 37,42 ****
--- 37,43 ----
  import org.jboss.jetty.util.AbstractTimeOutManager;
  import org.jboss.jetty.util.NaiveTimeOutManager;
  import org.jboss.logging.Logger;
+ import org.mortbay.util.Code;
  import org.mortbay.jetty.servlet.ServletHandler;
  
  //------------------------------------------------------------------------------
***************
*** 559,563 ****
--- 560,575 ----
        ((HttpSessionListener)_sessionListeners.get(i)).sessionDestroyed(event);
      }
    }
+ 
+ 
+     /** Implement the SessionManager interface. As the ServletHandler
+      * is set in the DistributedHttpSessionManager constructor, the
+      * one passed in should be the same.
+      * @param handler 
+      */
+     public void initialize (ServletHandler handler)
+     {
+         Code.assertTrue (_handler.equals(handler), "Servlet handlers are the same");
+     }
  }
  
cvs server: Diffing main/org/jboss/jetty/util
cvs server: Diffing main/org/jboss/jetty/xml
cvs server: Diffing resources
cvs server: Diffing resources/jetty-plugin
cvs server: Diffing resources/jetty-plugin/META-INF
Index: resources/jetty-plugin/META-INF/jboss-service.xml
===================================================================
RCS file: 
/cvsroot/jboss/contrib/jetty/src/resources/jetty-plugin/META-INF/jboss-service.xml,v
retrieving revision 1.13
diff -c -I\$Id: -r1.13 jboss-service.xml
*** resources/jetty-plugin/META-INF/jboss-service.xml   2002/02/01 00:32:24     1.13
--- resources/jetty-plugin/META-INF/jboss-service.xml   2002/02/04 09:33:41
***************
*** 26,40 ****
      <attribute name="HttpSessionSnapshotNotificationPolicy">neither</attribute>
    </mbean>
  
-   <mbean code="org.mortbay.jetty.jmx.DebugMBean"
-        name="jboss.web:Jetty=Debug2">
-   </mbean>
- 
-   <!--
-   <mbean code="org.mortbay.jetty.jmx.LogMBean"
-        name="jboss.web:Jetty=Log">
-   </mbean>
-    -->
  
    <!--classpath codebase="lib/ext" archives="javax.servlet.jar, 
org.apache.jasper.jar, jboss-j2ee.jar"/-->
  
--- 26,31 ----
cvs server: Diffing etc
Index: etc/jetty.xml
===================================================================
RCS file: /cvsroot/jboss/contrib/jetty/src/etc/jetty.xml,v
retrieving revision 1.5
diff -c -I\$Id: -r1.5 jetty.xml
*** etc/jetty.xml       2001/11/28 23:54:57     1.5
--- etc/jetty.xml       2002/02/04 09:33:41
***************
*** 16,21 ****
--- 16,22 ----
      </Arg>
    </Call>
  
+ 
  <!--  Uncomment this to add an SSL listener.
    <Call name="addListener">
      <Arg>
***************
*** 34,39 ****
--- 35,51 ----
      </Arg>
    </Call>
  -->
+ 
+   <Set name="RequestLog">
+     <New class="org.mortbay.http.NCSARequestLog">
+        <Arg><SystemProperty name="jetty.log" 
+default="../log"/>/yyyy_mm_dd.request.log</Arg>
+        <Set name="retainDays">90</Set>
+        <Set name="append">true</Set>
+        <Set name="extended">true</Set>
+        <Set name="LogTimeZone">GMT</Set>
+     </New>
+   </Set>
+ 
  
  </Configure>
  

Reply via email to