org.overlord.commons.dev.server
Class DevServer

java.lang.Object
  extended by org.overlord.commons.dev.server.DevServer
Direct Known Subclasses:
ErraiDevServer

public abstract class DevServer
extends Object

Base class for dev servers.

Author:
eric.wittmann@redhat.com

Field Summary
protected  String[] args
           
 
Constructor Summary
DevServer(String[] args)
          Constructor.
 
Method Summary
protected abstract  void addModules(DevServerEnvironment environment)
          Adds dev server modules.
protected abstract  void addModulesToJetty(DevServerEnvironment environment, org.eclipse.jetty.server.handler.ContextHandlerCollection handlers)
          Adds the dev server modules as contexts in jetty.
protected abstract  DevServerEnvironment createDevEnvironment()
           
 void disableDebug()
          Disables debug logging.
 void enableDebug()
          Enables debug logging.
 void go()
          Start/run the server.
protected  void postStart(DevServerEnvironment environment)
          Do any post startup tasks.
protected  void preConfig()
          Do any configuration steps.
protected  int serverPort()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

args

protected final String[] args
Constructor Detail

DevServer

public DevServer(String[] args)
Constructor.

Method Detail

enableDebug

public void enableDebug()
Enables debug logging.


disableDebug

public void disableDebug()
Disables debug logging.


go

public void go()
        throws Exception
Start/run the server.

Throws:
Exception

preConfig

protected void preConfig()
Do any configuration steps.


createDevEnvironment

protected abstract DevServerEnvironment createDevEnvironment()
Returns:
the development environment to use for this run

addModules

protected abstract void addModules(DevServerEnvironment environment)
Adds dev server modules.

Parameters:
environment -

addModulesToJetty

protected abstract void addModulesToJetty(DevServerEnvironment environment,
                                          org.eclipse.jetty.server.handler.ContextHandlerCollection handlers)
                                   throws Exception
Adds the dev server modules as contexts in jetty.

Parameters:
environment -
handlers -
Throws:
Exception

postStart

protected void postStart(DevServerEnvironment environment)
                  throws Exception
Do any post startup tasks.

Throws:
Exception

serverPort

protected int serverPort()
Returns:
the port to run the dev server on


Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.