Package com.erudika.para.server
Class ParaServer
java.lang.Object
com.erudika.para.server.ParaServer
- All Implemented Interfaces:
org.springframework.core.Ordered
@SpringBootApplication
public class ParaServer
extends Object
implements org.springframework.core.Ordered
Para modules are initialized and destroyed from here.
- Author:
- Alex Bogdanovski [[email protected]]
-
Field Summary
FieldsFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.boot.builder.SpringApplicationBuilderThis is the initializing method when running ParaServer as executable JAR (or WAR), from the command line: java -jar para.jar.static voiddestroy()Calls all registered listeners on exit.org.springframework.boot.web.error.ErrorPageRegistrarRegisters custom error pages.intgetOrder()com.fasterxml.jackson.databind.ObjectMapperConfigures a custom Jackson object mapper.static StringloadResource(String filePath) Loads a file from classpath.static voidPara starts from here.voidCalled before shutdown.
-
Field Details
-
API_PATH
The path of the API controller.- See Also:
-
-
Constructor Details
-
ParaServer
public ParaServer()Creates the main Para server bootstrapper.
-
-
Method Details
-
jacksonObjectMapper
@Bean public com.fasterxml.jackson.databind.ObjectMapper jacksonObjectMapper()Configures a custom Jackson object mapper.- Returns:
- the
ParaObjectUtils.getJsonMapper()
-
errorPageRegistrar
@Bean public org.springframework.boot.web.error.ErrorPageRegistrar errorPageRegistrar()Registers custom error pages.- Returns:
- Error page registry bean
-
loadResource
Loads a file from classpath.- Parameters:
filePath- a file path.- Returns:
- file contents as a string
-
destroy
public static void destroy()Calls all registered listeners on exit. Call this method last. This method callsPara.destroy(). -
preDestroy
@PreDestroy public void preDestroy()Called before shutdown. -
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
builder
public static org.springframework.boot.builder.SpringApplicationBuilder builder(org.springframework.boot.builder.SpringApplicationBuilder b, Class<?>... sources) This is the initializing method when running ParaServer as executable JAR (or WAR), from the command line: java -jar para.jar.- Parameters:
b- Spring app buildersources- the application classes that will be scanned- Returns:
- the application builder
-
main
Para starts from here.- Parameters:
args- args
-