public class EmbeddedServer
extends com.fredhopper.lifecycle.AbstractLifeCycle
LifeCycle that manages an instance of
Jetty's Server. The server uses
HandlerCollectionLoader to load all the available
implementations on the class path and adds the result as the
default Handler of this server.
The EmbeddedServer can be created using
createEmbeddedServer() or
createServer(Environment). This way it is ensured
that LifeCycle management of the server occurs in
separate threads.
| Constructor and Description |
|---|
EmbeddedServer(com.fredhopper.environment.Environment environment)
Ctor
|
| Modifier and Type | Method and Description |
|---|---|
static com.fredhopper.lifecycle.LifeCycle |
createEmbeddedServer()
Creates an instance
EmbeddedServer using
Environment.createEnvironment(). |
static com.fredhopper.lifecycle.LifeCycle |
createEmbeddedServer(com.fredhopper.environment.Environment environment)
Creates an instance of
EmbeddedServer. |
protected org.eclipse.jetty.server.Server |
createServer(com.fredhopper.environment.Environment environment)
Creates an instance of Jetty's server using
Environment. |
protected void |
doInitLifeCycle() |
protected void |
doStartLifeCycle() |
protected void |
doStopLifeCycle() |
protected org.eclipse.jetty.server.Server |
getServer() |
addStateListener, changeState, doPause, doResume, getState, getStateListeners, initLifeCycle, pause, publishState, removeStateListener, resume, startLifeCycle, stopLifeCycle, toStringpublic EmbeddedServer(com.fredhopper.environment.Environment environment)
environment - the environment of the serverpublic static com.fredhopper.lifecycle.LifeCycle createEmbeddedServer()
EmbeddedServer using
Environment.createEnvironment().LifeCycle wrapping around the
serverpublic static com.fredhopper.lifecycle.LifeCycle createEmbeddedServer(com.fredhopper.environment.Environment environment)
EmbeddedServer.environment - the environment of the serverLifeCycle wrapping around the
serverprotected void doInitLifeCycle()
throws Exception
doInitLifeCycle in class com.fredhopper.lifecycle.AbstractLifeCycleExceptionprotected void doStartLifeCycle()
throws Exception
doStartLifeCycle in class com.fredhopper.lifecycle.AbstractLifeCycleExceptionprotected void doStopLifeCycle()
throws Exception
doStopLifeCycle in class com.fredhopper.lifecycle.AbstractLifeCycleExceptionprotected org.eclipse.jetty.server.Server createServer(com.fredhopper.environment.Environment environment)
Environment. The provided Environment
specifies the host (Environment.getServerHost())
and the port (Environment.getServerPort()) of the
server.environment - the environment of the serverServerprotected final org.eclipse.jetty.server.Server getServer()
Copyright © 2015–2016 SDL Fredhopper. All rights reserved.