Geronimo_MoinMoin_wiki > Jetty
Added by Confluence Administrator, last edited by Confluence Administrator on Aug 02, 2006

Contents

About

Jetty is a HTTP server and servlet container that is used by geronimo to provide the J2EE web tier (with Jakarta Jasper to provide JSPs). Jetty has been integrated into Geronimo by wrapping the key Jetty components (eg server,listener,context,servlet leg) in GBeans.

Jetty GBeans

Jetty Web Connector GBeans

A connector is the abstraction for a single socket that is listening for HTTP requests (called a HTTP Listener in Jetty). There are HTTP, HTTPS and AJP13 variants of the connector GBean. There are common attributes for host and port as well as protocol specific attributes.

  <gbean name="JettyWebConnector" class="org.apache.geronimo.jetty.connector.HTTPConnector">
    <attribute name="host">localhost</attribute>
    <attribute name="port">8080</attribute>
    <reference name="JettyContainer">
      <name>JettyWebContainer</name>
    </reference>
    <attribute name="maxThreads">50</attribute>
    <attribute name="minThreads">10</attribute>
    <attribute name="maxIdleTimeMs">30000</attribute>
    <attribute name="lowThreads">10</attribute>
    <attribute name="lowThreadsMaxIdleTimeMs">900</attribute>
  </gbean>

  <gbean name="JettyAJP13Connector" class="org.apache.geronimo.jetty.connector.AJP13Connector">
    <attribute name="host">localhost</attribute>
    <attribute name="port">8019</attribute>
    <reference name="JettyContainer">
      <name>JettyWebContainer</name>
    </reference>
    <attribute name="maxThreads">50</attribute>
    <attribute name="minThreads">10</attribute>
  </gbean>

  <gbean name="JettySSLConnector" class="org.apache.geronimo.jetty.connector.HTTPSConnector">
    <attribute name="host">localhost</attribute>
    <attribute name="port">8443</attribute>
    <attribute name="keystoreFileName">var/security/keystore</attribute>
    <attribute name="keystoreType">JKS</attribute>
    <attribute name="keystorePassword">secret</attribute>
    <attribute name="keyPassword">secret</attribute>
    <attribute name="clientAuthRequired">false</attribute>
    <attribute name="algorithm">Default</attribute>
    <attribute name="secureProtocol">TLS</attribute>
    <attribute name="maxThreads">50</attribute>
    <attribute name="minThreads">10</attribute>
    <reference name="JettyContainer">
      <name>JettyWebContainer</name>
    </reference>
    <reference name="ServerInfo">
      <module>geronimo/j2ee-system/1.0/car</module>
      <name>ServerInfo</name>
    </reference>
  </gbean>
</configuration>

Common Attributes

Attribute

Required

Description

host

No

The host or IP interface to listen on. Null or 0.0.0.0 is interpreted as all known interfaces

port

Yes

The port to listen on. 0 is interpreted as any free port.

minThreads

No

Minimum number of threads allowed in thread pool

maxThreads

No

Maximum number of threass allowed in thread pool

bufferSizeBytes

No

Size in bytes of input and output buffers.

acceptQueueSize

No

The maximum unaccepted connections to queue if no threads are available.

lingerMillis

No

The maximum time in seconds that a connection lingers during close handshaking.

tcpNoDelay

No

if true then setTcpNoDelay(true) is called on accepted sockets.

redirectPort

No

Port to redirect to for confidential connections. 0 if not supported.

connectUrl

RO

The root URL with protocol, host and port

maxIdleTimeMs

No

The time in milliseconds that a connection can be idle before being closed

lowThreads

No

If less than lowThreads threads are available, the lowThreadsMaxIdleTimeMs is used

lowThreadsMaxIdleTimeMs

No

The time in milliseconds that a connection can be idle when the server is low on threads

HTTP Attributes

Attribute

Required

Description

HTTPS Attributes

Attribute

Required

Description

keystoreFileName

Yes

The filename of the keystore holding the private keys

algorithm

No

The certificate algorithm to use (default "SunX509")

keystorePassword

No

The password that protects the keystore file

keyPassword

No

The password that protects a key within the keystore

secureProtocol

No

The security protocol (default "TLS")

keystoreType

No

The keystore type (default "JKS" )

clientAuthRequired

No

True if client certificate authentication is required

clientAuthRequested

No

True if client certificate authentication is requested but not required

AJP13 Attributes

Attribute

Required

Description

something

No

blah blah blah

References

Attribute

Required

Description

something

No

blah blah blah

Jetty Log Access Manager & Request Log GBeans

  <gbean name="JettyAccessLogManager" class="org.apache.geronimo.jetty.requestlog.JettyLogManagerImpl">
    <references name="LogGBeans">
      <pattern>
        <gbean-name>geronimo.server:name=JettyRequestLog,*</gbean-name>
      </pattern>
    </references>
  </gbean>

  <gbean name="JettyRequestLog" class="org.apache.geronimo.jetty.requestlog.NCSARequestLog">
    <reference name="JettyContainer">
      <name>JettyWebContainer</name>
    </reference>
    <reference name="ServerInfo">
      <module>geronimo/j2ee-system/1.0/car</module>
      <name>ServerInfo</name>
    </reference>
    <attribute name="filename">var/log/jetty_yyyy_mm_dd.log</attribute>
    <attribute name="logDateFormat">dd/MMM/yyyy:HH:mm:ss ZZZ</attribute>
    <attribute name="logTimeZone">GMT</attribute>
  </gbean>

Attributes

Attribute

Required

Description

something

No

blah blah blah

References

Attribute

Required

Description

something

No

blah blah blah

.

Jetty Web Container GBean

  <gbean name="JettyWebContainer" class="org.apache.geronimo.jetty.JettyContainerImpl"></gbean>

This GBean wraps a Jetty Server and represents the connection between web connectors and the web contexts that service requests from the connectors. This bean is mostly read only and provides statistics for the server.

Attributes

Attribute

Required

Description

connections

RO

Number of connections accepted by the server since statsReset() called. Undefined if statsOn == false.

connectionsOpen

RO

Number of connections currently open that were opened since statsReset() called. Undefined if statsOn == false.

connectionsOpenMax

RO

Maximum number of connections opened simultaneously since statsReset() called. Undefined if statsOn == false.

connectionsDurationAve

RO

Sliding average duration in milliseconds of open connections since statsReset() called. Undefined if statsOn == false.

connectionsDurationMax

RO

Maximum duration in milliseconds of an open connection since statsReset() called. Undefined if statsOn == false.

connectionsRequestsAve

RO

Sliding average number of requests per connection since statsReset() called. Undefined if statsOn == false.

connectionsRequestsMax

RO

Maximum number of requests per connection since statsReset() called. Undefined if statsOn == false.

errors

RO

Number of errors since statsReset() called. Undefined if statsOn == false. An error is a request that resulted in an exception being thrown by the handler.

requests

RO

Number of requests since statsReset() called. Undefined if statsOn == false.

requestsActive

RO

Number of requests currently active. Undefined if statsOn == false.

requestsActiveMax

RO

Maximum number of active requests since statsReset() called. Undefined if statsOn == false.

requestsDurationAve

RO

Average duration of request handling in milliseconds since statsReset() called. Undefined if statsOn == false.

requestsDurationMax

RO

Get maximum duration in milliseconds of request handling since statsReset() called. Undefined if statsOn == false.

version

RO

The version of the HTTP server and environment.

Operations

References

Attribute

Required

Description

something

No

blah blah blah

Questions

Which Jetty ?

5.1.x

References

http://jetty.mortbay.org - Jetty home page

FrequentlyAskedQuestions - Jetty vs Tomcat