com.atlassian.bamboo.server
Class Server

java.lang.Object
  extended by org.mortbay.component.AbstractLifeCycle
      extended by org.mortbay.jetty.handler.AbstractHandler
          extended by org.mortbay.jetty.handler.AbstractHandlerContainer
              extended by org.mortbay.jetty.handler.HandlerWrapper
                  extended by org.mortbay.jetty.Server
                      extended by com.atlassian.bamboo.server.Server
All Implemented Interfaces:
org.mortbay.component.LifeCycle, org.mortbay.jetty.Handler, org.mortbay.jetty.HandlerContainer, org.mortbay.util.Attributes

public class Server
extends org.mortbay.jetty.Server

This class uses Jetty to run the Bamboo web server.

You can run the user by passing the port and webapp directory into the constructor, or pass a jetty configuration file from the command line. Having this lets us execute the jar from the command line


Nested Class Summary
 
Nested classes/interfaces inherited from class org.mortbay.jetty.Server
org.mortbay.jetty.Server.Graceful
 
Nested classes/interfaces inherited from interface org.mortbay.component.LifeCycle
org.mortbay.component.LifeCycle.Listener
 
Field Summary
static java.lang.String DEFAULT_JETTY_CONFIG
           
 
Fields inherited from class org.mortbay.jetty.handler.AbstractHandler
_string
 
Fields inherited from class org.mortbay.component.AbstractLifeCycle
_listeners
 
Fields inherited from interface org.mortbay.jetty.Handler
ALL, DEFAULT, ERROR, FORWARD, INCLUDE, REQUEST
 
Constructor Summary
Server(int port, java.lang.String webAppDir, java.lang.String contextPathSpec)
          Instantiate the server without using a jetty configuration file.
Server(java.lang.String string)
          Instantiate the server using a jetty configuration file.
 
Method Summary
 javax.servlet.ServletContext getWebApp()
          Provide access to the Bamboo web application context.
static void main(java.lang.String[] args)
          Used by the Java Service Wrapper to run the program.
 
Methods inherited from class org.mortbay.jetty.Server
addConnector, addHandler, addLifeCycle, addUserRealm, clearAttributes, doStart, doStop, getAttribute, getAttributeNames, getConnectors, getContainer, getGracefulShutdown, getHandlers, getSendDateHeader, getSendServerVersion, getSessionIdManager, getStopAtShutdown, getThreadPool, getUserRealms, getVersion, handle, join, removeAttribute, removeConnector, removeHandler, removeLifeCycle, removeUserRealm, setAttribute, setConnectors, setGracefulShutdown, setHandlers, setSendDateHeader, setSendServerVersion, setSessionIdManager, setStopAtShutdown, setThreadPool, setUserRealms
 
Methods inherited from class org.mortbay.jetty.handler.HandlerWrapper
expandChildren, getHandler, handle, setHandler, setServer
 
Methods inherited from class org.mortbay.jetty.handler.AbstractHandlerContainer
expandHandler, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass
 
Methods inherited from class org.mortbay.jetty.handler.AbstractHandler
destroy, getServer, toString
 
Methods inherited from class org.mortbay.component.AbstractLifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mortbay.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 

Field Detail

DEFAULT_JETTY_CONFIG

public static final java.lang.String DEFAULT_JETTY_CONFIG
See Also:
Constant Field Values
Constructor Detail

Server

public Server(int port,
              java.lang.String webAppDir,
              java.lang.String contextPathSpec)
       throws java.io.IOException
Instantiate the server without using a jetty configuration file.

Parameters:
port - The port bamboo is listening on
webAppDir - The location of the bamboo webapp files
contextPathSpec - The context path spec. Which must be of the form / or /path/*
Throws:
java.io.IOException

Server

public Server(java.lang.String string)
       throws java.lang.Exception
Instantiate the server using a jetty configuration file.

Parameters:
string - Location of the Jetty config file
Throws:
java.lang.Exception - if the server cannot be configured
Method Detail

main

public static void main(java.lang.String[] args)
Used by the Java Service Wrapper to run the program.

Parameters:
args - The arguments contained in the conf/wrapper.conf file

getWebApp

public javax.servlet.ServletContext getWebApp()
Provide access to the Bamboo web application context.

Used for acceptance testing

Returns:
The web app contextÔøΩ


Copyright © 2010 Atlassian. All Rights Reserved.