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_CONFIG
ADMIN_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
VitamServer
configure
in interface VitamServer
VitamApplicationServerException
public void startAndJoin() throws VitamApplicationServerException
VitamServer
startAndJoin
in interface VitamServer
VitamApplicationServerException
public void start() throws VitamApplicationServerException
start
in interface VitamServer
VitamApplicationServerException
public void stop() throws VitamApplicationServerException
stop
in interface VitamServer
VitamApplicationServerException
public org.eclipse.jetty.server.Server getServer()
getServer
in interface VitamServer
public org.eclipse.jetty.xml.XmlConfiguration getServerConfiguration()
getServerConfiguration
in interface VitamServer
public boolean isStarted()
isStarted
in interface VitamServer
public boolean isStopped()
isStopped
in interface VitamServer
public int getPort()
getPort
in interface VitamServerInterface
public int getAdminPort()
getAdminPort
in interface VitamServerInterface
public boolean isConfigured()
isConfigured
in interface VitamServer
protected void setConfigured(boolean configured)
configured
- configured statuspublic org.eclipse.jetty.server.Handler getHandler()
getHandler
in interface VitamServer
public void setHandler(org.eclipse.jetty.server.Handler handler)
setHandler
in interface VitamServer
handler
- the handler to setpublic VitamThreadPoolExecutor getVitamThreadPoolExecutor()
Copyright © 2018 Vitam. All rights reserved.