public class BasicVitamServer extends Object implements VitamServer
CAN_CONFIGURE_SERVER, CONFIG_FILE_IS_A_MANDATORY_ARGUMENT, CONFIGURATION_IS_A_MANDATORY_ARGUMENT, SERVER_CAN_NOT_START, SERVER_START_WITH_JETTY_CONFIGADMIN_CONNECTOR_NAME, BUSINESS_CONNECTOR_NAME| Modifier | Constructor and Description |
|---|---|
protected |
BasicVitamServer(int port)
A Vitam server can only be instantiated with a given port to listen to
|
protected |
BasicVitamServer(String jettyConfigPath)
A Vitam server can be instantiated with a jetty xml configuration file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.eclipse.jetty.server.Handler applicationHandler)
Configure the server with one handler
|
int |
getAdminPort()
Retrieving all ports of the vitam server.
|
org.eclipse.jetty.server.Handler |
getHandler()
retrieving the handler
|
int |
getPort()
Retrieving the vitam server port.
If the server is started, this returns the real port used.
|
org.eclipse.jetty.server.Server |
getServer()
Retrieving the underlying jetty server is restricted to sub-implementations only
|
org.eclipse.jetty.xml.XmlConfiguration |
getServerConfiguration()
Retrieving the server jetty configuration
|
VitamThreadPoolExecutor |
getVitamThreadPoolExecutor() |
boolean |
isConfigured()
check if is configured
|
boolean |
isStarted()
check if vitam server is started
|
boolean |
isStopped()
check if vitam server is stopped
|
protected void |
setConfigured(boolean configured)
setter configured status
|
void |
setHandler(org.eclipse.jetty.server.Handler handler)
setter of the handler
|
void |
start()
For Junit tests, starts only, not join
|
void |
startAndJoin()
Start the server with implicit Join
|
void |
stop()
For Junit tests, stops the server
|
protected BasicVitamServer(int port)
port - the port to listen to (must be a valid logical port number)IllegalArgumentException - if port <= 0protected BasicVitamServer(String jettyConfigPath) throws VitamApplicationServerException
jettyConfigPath - configuration file of jetty serverVitamApplicationServerException - if configuration not found, can't be parsed, can't be read or server
can't startedpublic void configure(org.eclipse.jetty.server.Handler applicationHandler)
throws VitamApplicationServerException
VitamServerconfigure in interface VitamServerVitamApplicationServerExceptionpublic void startAndJoin()
throws VitamApplicationServerException
VitamServerstartAndJoin in interface VitamServerVitamApplicationServerExceptionpublic void start()
throws VitamApplicationServerException
start in interface VitamServerVitamApplicationServerExceptionpublic void stop()
throws VitamApplicationServerException
stop in interface VitamServerVitamApplicationServerExceptionpublic org.eclipse.jetty.server.Server getServer()
getServer in interface VitamServerpublic org.eclipse.jetty.xml.XmlConfiguration getServerConfiguration()
getServerConfiguration in interface VitamServerpublic boolean isStarted()
isStarted in interface VitamServerpublic boolean isStopped()
isStopped in interface VitamServerpublic int getPort()
getPort in interface VitamServerInterfacepublic int getAdminPort()
getAdminPort in interface VitamServerInterfacepublic boolean isConfigured()
isConfigured in interface VitamServerprotected void setConfigured(boolean configured)
configured - configured statuspublic org.eclipse.jetty.server.Handler getHandler()
getHandler in interface VitamServerpublic void setHandler(org.eclipse.jetty.server.Handler handler)
setHandler in interface VitamServerhandler - the handler to setpublic VitamThreadPoolExecutor getVitamThreadPoolExecutor()
Copyright © 2018 Vitam. All rights reserved.