com.atlassian.bamboo.server
Class Server

java.lang.Object
  extended by org.eclipse.jetty.util.component.AbstractLifeCycle
      extended by org.eclipse.jetty.util.component.AggregateLifeCycle
          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.Destroyable, org.eclipse.jetty.util.component.Dumpable, 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 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, String webAppDir, String contextPathSpec)
          Instantiate the server without using a jetty configuration file.
Server(int sslPort, String webAppDir, String contextPathSpec, String keystore, String keypass)
          Instantiate the server with SLL without using a jetty configuration file.
Server(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(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, getConnectors, getContainer, getGracefulShutdown, getMaxCookieVersion, getSendDateHeader, getSendServerVersion, getSessionIdManager, getStopAtShutdown, getThreadPool, getVersion, handle, handleAsync, isDumpAfterStart, isDumpBeforeStop, isUncheckedPrintWriter, join, removeAttribute, removeBean, removeConnector, removeLifeCycle, setAttribute, setConnectors, setDumpAfterStart, setDumpBeforeStop, setGracefulShutdown, setMaxCookieVersion, setSendDateHeader, setSendServerVersion, setSessionIdManager, setStopAtShutdown, setThreadPool, setUncheckedPrintWriter, toString
 
Methods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper
destroy, expandChildren, getHandler, getHandlers, getNestedHandlerByClass, handle, setHandler, setServer
 
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer
expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass
 
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
dumpThis, getServer
 
Methods inherited from class org.eclipse.jetty.util.component.AggregateLifeCycle
addBean, contains, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, isManaged, manage, removeBeans, unmanage
 
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, 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 String DEFAULT_JETTY_CONFIG
See Also:
Constant Field Values
Constructor Detail

Server

public Server(int port,
              String webAppDir,
              String contextPathSpec)
       throws 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:
IOException

Server

public Server(int sslPort,
              String webAppDir,
              String contextPathSpec,
              String keystore,
              String keypass)
       throws IOException
Instantiate the server with SLL without using a jetty configuration file.

Parameters:
sslPort - The ssl 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/*
keystore - The keystore location
keypass - The keystore password
Throws:
IOException

Server

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

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

main

public static void main(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 © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.