|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AggregateLifeCycle
org.eclipse.jetty.server.handler.AbstractHandler
org.eclipse.jetty.server.handler.AbstractHandlerContainer
org.eclipse.jetty.server.handler.HandlerWrapper
org.eclipse.jetty.server.Server
consciouscode.seedling.jetty.SeedlingServer
public class SeedlingServer
Extends Jetty's Server to automatically build context mappings from entries in the Seedling container.
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 |
---|
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 | |
---|---|
SeedlingServer()
|
|
SeedlingServer(int port)
|
Method Summary | |
---|---|
Log |
getLog()
|
NodeLocation |
getNodeLocation()
Returns the location of this node. |
BranchNode |
getPathBranch()
|
org.eclipse.jetty.server.handler.ContextHandler |
getRootContextHandler()
Gets the context that will handle "/" paths. |
void |
nodeInstalled(NodeLocation location)
Register the Seedling address at which this node has been installed. |
void |
setLog(Log log)
|
void |
setPathBranch(BranchNode branch)
|
void |
setRootContextHandler(org.eclipse.jetty.server.handler.ContextHandler handler)
Sets the context that will handle "/" paths. |
void |
startService()
Starts a Seedling service. |
void |
stopService()
Stops a Seedling service. |
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, join, main, removeAttribute, removeBean, removeConnector, removeLifeCycle, setAttribute, setConnectors, setDumpAfterStart, setDumpBeforeStop, setGracefulShutdown, setMaxCookieVersion, setSendDateHeader, setSendServerVersion, setSessionIdManager, setStopAtShutdown, setThreadPool, 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 |
---|
dump, dump, dump, dump, dumpStdErr, getBean, getBeans, getBeans, removeBeans |
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 |
Constructor Detail |
---|
public SeedlingServer()
public SeedlingServer(int port)
Method Detail |
---|
public Log getLog()
public void setLog(Log log)
public org.eclipse.jetty.server.handler.ContextHandler getRootContextHandler()
"/"
paths.
public void setRootContextHandler(org.eclipse.jetty.server.handler.ContextHandler handler)
"/"
paths.
public BranchNode getPathBranch()
public void setPathBranch(BranchNode branch)
public void nodeInstalled(NodeLocation location)
LocatableNode
Note: This is not called setNodeLocation
because
the location is not intended as a writable property.
nodeInstalled
in interface LocatableNode
location
- is this node's new location. It must not be null.public final NodeLocation getNodeLocation()
LocatableNode
NodeLocation
can be used
to access the node's name, parent branch, and path.
getNodeLocation
in interface LocatableNode
null
if the node has not
been installed into a Seedling.public void startService() throws Exception
ServiceNode
RuntimeException
are propagated
to the application, but any other kind of exception is wrapped in a
ServiceException
and rethrown.
startService
in interface ServiceNode
Exception
public void stopService()
ServiceNode
Implementations of this method must not do anything that may change
the state of the parent Seedling. In particular, it cannot call
any overload of the following methods:
BranchNode.getNode(java.lang.String)
,
BranchNode.getChild(java.lang.String)
, GrowingBranch.installChild(java.lang.String, java.lang.Object)
,
GrowingBranch.uninstallChild(java.lang.String)
.
Furthermore, this method may be called from within a JVM shutdown hook, which implies that it must work promptly and carefully.
stopService
in interface ServiceNode
Runtime.addShutdownHook(java.lang.Thread)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |