net.sf.jabb.jetty
Class ServerHelper

java.lang.Object
  extended by net.sf.jabb.jetty.ServerHelper
All Implemented Interfaces:
org.springframework.context.Lifecycle

public class ServerHelper
extends Object
implements org.springframework.context.Lifecycle

Helper for managing Jetty Server.

Author:
James Hu

Field Summary
protected  org.eclipse.jetty.server.Server server
          The Jetty Server
 
Constructor Summary
ServerHelper()
          Constructor with no Jetty Server specified.
ServerHelper(org.eclipse.jetty.server.Server svr)
          Constructor with Jetty Server specified.
 
Method Summary
 org.eclipse.jetty.server.Server getServer()
           
 boolean isRunning()
           
 void setServer(org.eclipse.jetty.server.Server server)
           
 void start()
          RuntimeException will be thrown if the server failed to start.
 void stop()
          RuntimeException will be thrown if the server failed to stop.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

server

protected org.eclipse.jetty.server.Server server
The Jetty Server

Constructor Detail

ServerHelper

public ServerHelper()
Constructor with no Jetty Server specified. The Server need to be specified later with setServer(Server svr) method.


ServerHelper

public ServerHelper(org.eclipse.jetty.server.Server svr)
Constructor with Jetty Server specified.

Parameters:
svr - The Jetty Server that will be associated with ServerHelper.
Method Detail

getServer

public org.eclipse.jetty.server.Server getServer()

setServer

public void setServer(org.eclipse.jetty.server.Server server)

isRunning

public boolean isRunning()
Specified by:
isRunning in interface org.springframework.context.Lifecycle
See Also:
Lifecycle.isRunning()

start

public void start()
RuntimeException will be thrown if the server failed to start.

Specified by:
start in interface org.springframework.context.Lifecycle
See Also:
Lifecycle.start()

stop

public void stop()
RuntimeException will be thrown if the server failed to stop.

Specified by:
stop in interface org.springframework.context.Lifecycle
See Also:
Lifecycle.stop()


Copyright © 2012. All Rights Reserved.