Class ParaServer
java.lang.Object
com.erudika.para.server.ParaServer
Para modules are initialized and destroyed from here.
- Author:
- Alex Bogdanovski [[email protected]]
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.boot.web.servlet.ServletRegistrationBean<?> Filter.static org.springframework.boot.builder.SpringApplicationBuilderbuilder(org.springframework.boot.builder.SpringApplicationBuilder b, boolean isWar, Class<?>... sources) This is the initializing method when running ParaServer as executable JAR (or WAR), from the command line: java -jar para.jar.org.springframework.boot.web.servlet.FilterRegistrationBean<?> Filter.static voiddestroy()Calls all registered listeners on exit.static com.google.inject.Module[]Returns the list of core modules.static List<com.erudika.para.core.rest.CustomResourceHandler> Try loading externalCustomResourceHandlerclasses.static <T> TgetInstance(Class<T> type) Return an instance of some class if it has been wired through DI.intgetOrder()org.springframework.boot.web.servlet.FilterRegistrationBean<?> Filter.static voidinitialize(com.google.inject.Module... modules) Initializes the Para core modules and allows the user to override them.static voidinjectInto(Object obj) Inject dependencies into a given object.org.springframework.boot.web.servlet.server.ServletWebServerFactoryJetty config.static voidPara starts from here.voidonStartup(jakarta.servlet.ServletContext arg0) voidCalled before shutdown.
-
Field Details
-
HIGHEST_PRECEDENCE
static final int HIGHEST_PRECEDENCE- See Also:
-
LOWEST_PRECEDENCE
static final int LOWEST_PRECEDENCE- See Also:
-
-
Constructor Details
-
ParaServer
public ParaServer()
-
-
Method Details
-
getCoreModules
public static com.google.inject.Module[] getCoreModules()Returns the list of core modules.- Returns:
- the core modules
-
initialize
public static void initialize(com.google.inject.Module... modules) Initializes the Para core modules and allows the user to override them. Call this method first. This method callsPara.initialize().- Parameters:
modules- a list of modules that override the main modules
-
destroy
public static void destroy()Calls all registered listeners on exit. Call this method last. This method callsPara.destroy(). -
injectInto
Inject dependencies into a given object.- Parameters:
obj- the object we inject into
-
getInstance
Return an instance of some class if it has been wired through DI.- Type Parameters:
T- any type- Parameters:
type- any type- Returns:
- an object
-
getCustomResourceHandlers
Try loading externalCustomResourceHandlerclasses. These will handle custom API requests. viaServiceLoader.load(java.lang.Class).- Returns:
- a loaded list of ServletContextListener class.
-
getOrder
public int getOrder() -
apiV1RegistrationBean
@Bean public org.springframework.boot.web.servlet.ServletRegistrationBean<?> apiV1RegistrationBean()Filter.- Returns:
- API servlet bean
-
gzipFilterRegistrationBean
@Bean public org.springframework.boot.web.servlet.FilterRegistrationBean<?> gzipFilterRegistrationBean()Filter.- Returns:
- GZIP filter bean
-
corsFilterRegistrationBean
@Bean public org.springframework.boot.web.servlet.FilterRegistrationBean<?> corsFilterRegistrationBean()Filter.- Returns:
- CORS filter bean
-
jettyConfigBean
@Bean public org.springframework.boot.web.servlet.server.ServletWebServerFactory jettyConfigBean()Jetty config.- Returns:
- Jetty config bean
-
preDestroy
@PreDestroy public void preDestroy()Called before shutdown. -
builder
public static org.springframework.boot.builder.SpringApplicationBuilder builder(org.springframework.boot.builder.SpringApplicationBuilder b, boolean isWar, 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 builderisWar- is it started from a WAR filesources- the application classes that will be scanned- Returns:
- the application builder
-
main
-
onStartup
public void onStartup(jakarta.servlet.ServletContext arg0) throws jakarta.servlet.ServletException - Throws:
jakarta.servlet.ServletException
-