Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] Some jetty-9 distro changes

Now that Jetty-9-M0 is out, we are turning our minds to what other
important cleanups we can do before we hit 9.0.0.  There is probably a
lot of things that can be cleaned up in the standard distribution and
I'd like to float a couple of ideas to solicit feedback.


The contexts vs webapps  deployment difference has always been a pain
to explain and document and it is a little historic from the time that
contexts were not hot deployed.    I think we should drop contexts and
just have the webapps directory into which you can drop:

  myapp.war     - standard war files
  myapp/  -  expanded war files as directories
  myapp.xml  - a context XML descriptor (used to be deployed in contexts)
  myapp.d - an deployer ignored directory into which other resources
used by myapp.xml can be put

this would also reduce the number of config files as we would not need to have

  jetty-deploy,xml jetty-webapps.xml jetty-contexts.xml

we could instead just have

 jetty-deployer.xml





Jesse made the suggestion that we move all configuration out of the
xml files and put them as properties in the start.ini directories.
The XML would define structure and advanced configuration, while most
simple config would be in the ini files.  So for example in start.ini
we could have


jetty,port=8080
jetty.host=0.0.0.0
idleTimeout=3000
threads.max=250
threads.min=25
http.secure.port=8443
http.outputBufferSize=32768
http.requestHeaderSize=8192
http.responseHeaderSize=8192
sendDataHeader=true
sendServerVersion=true



The jetty.xml file would then be:



<Configure id="Server" class="org.eclipse.jetty.server.Server">
    <!-- =========================================================== -->
    <!-- Server Thread Pool                                          -->
    <!-- =========================================================== -->
    <Arg name="threadpool">
      <New id="threadpool"
class="org.eclipse.jetty.util.thread.QueuedThreadPool">
        <Set name="minThreads"><Property name="threads.min" default="10"/></Set>
        <Set name="maxThreads"><Property name="threads.max"
default="200"/></Set>
        <Set name="detailedDump">false</Set>
      </New>
    </Arg>

    <!-- =========================================================== -->
    <!-- HttpChannel Configuration                                   -->
    <!-- =========================================================== -->
    <New id="httpConfig" class="org.eclipse.jetty.server.HttpChannelConfig">
      <Set name="secureScheme">https</Set>
      <Set name="securePort"><Property name="http.secure.port"
default="8443"/></Set>
      <Set name="outputBufferSize"><Property
name="http.outputBufferSize" default="32768"/></Set>
      <Set name="requestHeaderSize"><Property
name="http.requestHeaderSize" default="8192"/></Set>
      <Set name="responseHeaderSize"><Property
name="http.responseHeaderSize" default="8192"/></Set>
      <Call name="addCustomizer">
        <Arg><New
class="org.eclipse.jetty.server.ForwardedRequestCustomizer"/></Arg>
      </Call>
    </New>

    <!-- =========================================================== -->
    <!-- Set connectors                                              -->
    <!-- =========================================================== -->
    <Call name="addConnector">
      <Arg>
          <New class="org.eclipse.jetty.server.ServerConnector">
            <Arg name="server"><Ref id="Server" /></Arg>
            <Arg name="factories">
              <Array type="org.eclipse.jetty.server.ConnectionFactory">
              <Item><New class="org.eclipse.jetty.server.HttpConnectionFactory">
                <Arg name="config"><Ref id="httpConfig"/></Arg>
              </New></Item>
              </Array>
            </Arg>
            <Set name="host"><Property name="jetty.host" /></Set>
            <Set name="port"><Property name="jetty.port" default="8080"/></Set>
            <Set name="idleTimeout"><Property name="idleTimeout"
default="30000"/></Set>
          </New>
      </Arg>
    </Call>
    <!-- =========================================================== -->
    <!-- Set handler Collection Structure                            -->
    <!-- =========================================================== -->
    <Set name="handler">
      <New id="Handlers"
class="org.eclipse.jetty.server.handler.HandlerCollection">
        <Set name="handlers">
         <Array type="org.eclipse.jetty.server.Handler">
           <Item>
             <New id="Contexts"
class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
           </Item>
           <Item>
             <New id="DefaultHandler"
class="org.eclipse.jetty.server.handler.DefaultHandler"/>
           </Item>
         </Array>
        </Set>
      </New>
    </Set>

    <!-- =========================================================== -->
    <!-- extra options                                               -->
    <!-- =========================================================== -->
    <Set name="stopAtShutdown">true</Set>
    <Set name="sendServerVersion"><Property name="sendServerVersion"
default="true"/></Set>
    <Set name="sendDateHeader"><Property name="sendDateHeader"
default="true"/></Set>
    <Set name="stopTimeout">1000</Set>
    <Set name="dumpAfterStart">true</Set>
    <Set name="dumpBeforeStop">false</Set>

</Configure>


I find this idea interesting... but have some concerns.    Which
config do we make into properites:
  All, including all the methods not currently even called in the XML);
  All the ones currently in the XML
  Just the ones we think are important from the XML (which is what I
have done above).

This may hide the complexities of the XML from your average user, but
it makes the XML more complex and to add a property not currently set
you have to add a line to both xml and ini files.




thoughts?











-- 
Greg Wilkins <gregw@xxxxxxxxxxx>
http://www.webtide.com
Developer advice and support from the Jetty & CometD experts.


Back to the top