Package fr.gouv.vitam.common.serverv2
Class VitamStarter
- java.lang.Object
-
- fr.gouv.vitam.common.serverv2.VitamStarter
-
public class VitamStarter extends java.lang.Object
launch vitam server
-
-
Constructor Summary
Constructors Constructor Description VitamStarter(java.lang.Class<? extends VitamApplicationConfiguration> configurationType, java.lang.String configurationFile, java.lang.Class<? extends javax.ws.rs.core.Application> businessApplication, java.lang.Class<? extends javax.ws.rs.core.Application> adminApplication)
ConstructorVitamStarter(java.lang.Class<? extends VitamApplicationConfiguration> configurationType, java.lang.String configurationFile, java.lang.Class<? extends javax.ws.rs.core.Application> businessApplication, java.lang.Class<? extends javax.ws.rs.core.Application> adminApplication, java.util.List<javax.servlet.ServletContextListener> customListeners, boolean deployStaticResources)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.eclipse.jetty.server.Handler
buildAdminHandler(java.lang.String configurationFile)
protected org.eclipse.jetty.server.Handler
buildApplicationHandler(java.lang.String configurationFile, VitamApplicationConfiguration configuration)
protected void
configure(java.lang.String configurationFile)
protected void
configureVitamParameters()
Allow override Vitam parametersjava.lang.Class<? extends VitamApplicationConfiguration>
getConfigurationType()
Get configuration TypeVitamServer
getVitamServer()
Get the vitam serverboolean
isStarted()
Check if server is startedboolean
isStopped()
Check if server is stoppedvoid
run()
Run method, start and join the servervoid
start()
For Junit tests, starts only, not joinvoid
stop()
For Junit tests, stops the server
-
-
-
Constructor Detail
-
VitamStarter
public VitamStarter(java.lang.Class<? extends VitamApplicationConfiguration> configurationType, java.lang.String configurationFile, java.lang.Class<? extends javax.ws.rs.core.Application> businessApplication, java.lang.Class<? extends javax.ws.rs.core.Application> adminApplication)
Constructor- Parameters:
configurationType
- configuration typeconfigurationFile
- configuration filebusinessApplication
- business applicationadminApplication
- admin application
-
VitamStarter
public VitamStarter(java.lang.Class<? extends VitamApplicationConfiguration> configurationType, java.lang.String configurationFile, java.lang.Class<? extends javax.ws.rs.core.Application> businessApplication, java.lang.Class<? extends javax.ws.rs.core.Application> adminApplication, java.util.List<javax.servlet.ServletContextListener> customListeners, boolean deployStaticResources)
Constructor- Parameters:
configurationType
- configuration typeconfigurationFile
- configuration filebusinessApplication
- business applicationadminApplication
- admin applicationcustomListeners
- list of custom listeners
-
-
Method Detail
-
configure
protected final void configure(java.lang.String configurationFile)
-
configureVitamParameters
protected void configureVitamParameters()
Allow override Vitam parameters
-
getConfigurationType
public final java.lang.Class<? extends VitamApplicationConfiguration> getConfigurationType()
Get configuration Type- Returns:
- configuration type
-
buildApplicationHandler
protected org.eclipse.jetty.server.Handler buildApplicationHandler(java.lang.String configurationFile, VitamApplicationConfiguration configuration) throws VitamApplicationServerException
- Throws:
VitamApplicationServerException
-
buildAdminHandler
protected org.eclipse.jetty.server.Handler buildAdminHandler(java.lang.String configurationFile)
-
run
public final void run() throws VitamApplicationServerException
Run method, start and join the server- Throws:
VitamApplicationServerException
-
start
public void start() throws VitamApplicationServerException
For Junit tests, starts only, not join- Throws:
VitamApplicationServerException
- in case the server could not be started
-
stop
public void stop() throws VitamApplicationServerException
For Junit tests, stops the server- Throws:
VitamApplicationServerException
-
isStarted
public boolean isStarted()
Check if server is started- Returns:
- true if started
-
getVitamServer
public VitamServer getVitamServer()
Get the vitam server- Returns:
- the vitam server
-
isStopped
public boolean isStopped()
Check if server is stopped- Returns:
- true if stopped
-
-