com.atlassian.bamboo.server
Class Server

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

public class Server
extends org.eclipse.jetty.server.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.eclipse.jetty.server.Server
org.eclipse.jetty.server.Server.Graceful
 
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
 
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener
 
Field Summary
static java.lang.String DEFAULT_JETTY_CONFIG
           
 
Fields inherited from class org.eclipse.jetty.server.handler.HandlerWrapper
_handler
 
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
 
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.eclipse.jetty.server.Server
addBean, addConnector, addLifeCycle, clearAttributes, doStart, doStop, dump, getAttribute, getAttributeNames, getBean, getBeans, getConnectors, getContainer, getGracefulShutdown, getMaxCookieVersion, getSendDateHeader, getSendServerVersion, getSessionIdManager, getStopAtShutdown, getThreadPool, getVersion, handle, handleAsync, join, removeAttribute, removeBean, removeConnector, removeLifeCycle, setAttribute, setConnectors, setGracefulShutdown, setMaxCookieVersion, setSendDateHeader, setSendServerVersion, setSessionIdManager, setStopAtShutdown, setThreadPool, toString
 
Methods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper
expandChildren, getHandler, getHandlers, getNestedHandlerByClass, handle, setHandler, setServer
 
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer
dumpHandlers, expandHandler, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass
 
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
destroy, dump, dump, getServer
 
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, 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.eclipse.jetty.util.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 © 2011 Atlassian. All Rights Reserved.