Development documentation

This document provides an overview of the various documents and links that are part of this project's technical documentation.

Implementation

The projects implements a single class named com.alpha.pineapple.web.jetty.JettyStarter which is invoked through the public static main(String[] args) method.

When invoked the method performs these steps:

  1. Reads the following system properties:
    • pineapple.jettystarter.home
    • pineapple.jettystarter.host
    • pineapple.jettystarter.port
    • pineapple.jettystarter.stdoutlogging []
  2. Creates a new Jetty server instance.
  3. The Jetty server loads its configuration file from ${pineapple.server.home}\conf\jetty.xml.
  4. A WebAppContext is created with the properties:
    • context path = /
    • WAR file = ${pineapple.jettystarter.home}\webapps\pineapple-web-application-war.war"

    Please note that the version-less war file is generated by the assembly descriptor in the pineapple-standalone-web-client project.

  5. Creates a SelectChannelConnector which is configured with the properties:
    • host = ${pineapple.jettystarter.host}
    • port = ${pineapple.jettystarter.port}
  6. The server is configured to use the context and the connector.
  7. The server is started.

More information about embedding Jetty

For more info about embedding Jetty, see:

  • http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty
  • http://docs.codehaus.org/display/JETTY/Embedding+Jetty
  • http://copperykeenclaws.wordpress.com/2010/08/19/embedding-tomcat-7/
  • http://wiki.eclipse.org/Jetty/Tutorial/Jetty_and_Maven_HelloWorld

Creating executable jar file

The project creates a jar file through the usage of the JAR plugin. The plugin is configured to make the jar executable by adding a main class JettyStarter to the jar manifest:

Main-Class: com.alpha.pineapple.web.jetty.JettyStarter

Constructing the class path for Jetty

The JAR plugin is configured to a create a class path for the jar file and adding it to the jar manifest:

Class-Path: jetty-webapp-9.2.0.v20140526.jar jetty-xml-9.2.0.v20140526
 .jar jetty-util-9.2.0.v20140526.jar jetty-servlet-9.2.0.v20140526.jar
  jetty-security-9.2.0.v20140526.jar jetty-server-9.2.0.v20140526.jar 
 javax.servlet-api-3.1.0.jar jetty-http-9.2.0.v20140526.jar jetty-io-9
 .2.0.v20140526.jar log4j-1.2.17.jar slf4j-api-1.7.7.jar slf4j-log4j12
 -1.7.7.jar
 
 +---