Package org.dspace.app.rest
Class Application
java.lang.Object
org.springframework.boot.web.servlet.support.SpringBootServletInitializer
org.dspace.app.rest.Application
- All Implemented Interfaces:
org.springframework.web.WebApplicationInitializer
@SpringBootApplication
@EnableScheduling
@EnableCaching
public class Application
extends org.springframework.boot.web.servlet.support.SpringBootServletInitializer
Define the Spring Boot Application settings itself. This class takes the place
of a web.xml file, and configures all Filters/Listeners as methods (see below).
NOTE: Requires a Servlet 3.0 container, e.g. Tomcat 7.0 or above.
NOTE: This extends SpringBootServletInitializer in order to allow us to build a deployable WAR file with Spring Boot. See: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-create-a-deployable-war-file
- Author:
- Andrea Bollini (andrea.bollini at 4science.it), Tim Donohue
-
Field Summary
Fields inherited from class org.springframework.boot.web.servlet.support.SpringBootServletInitializer
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.boot.builder.SpringApplicationBuilderconfigure(org.springframework.boot.builder.SpringApplicationBuilder application) Override the default SpringBootServletInitializer.configure() method, passing it this Application class.protected javax.servlet.FilterRegister the DSpaceAPIRequestLoggingFilter, a Filter that provides Mapped Diagnostic Context for the DSpace Server Webappprotected DSpaceContextListenerRegister the "DSpaceContextListener" so that it is loaded for this Application.protected org.springframework.hateoas.server.LinkRelationProviderprotected javax.servlet.FilterRegister the DSpaceRequestContextFilter, a Filter which checks for open Context objects *after* a request has been fully processed, and closes themprotected javax.servlet.FilterRegister the DSpaceWebappServletFilter, which initializes the DSpace RequestService / SessionServicevoidorg.springframework.web.context.request.RequestContextListenervoidvoidorg.springframework.web.servlet.config.annotation.WebMvcConfigurerMethods inherited from class org.springframework.boot.web.servlet.support.SpringBootServletInitializer
createRootApplicationContext, createSpringApplicationBuilder, deregisterJdbcDrivers, onStartup, run, setRegisterErrorPageFilter
-
Constructor Details
-
Application
public Application()
-
-
Method Details
-
generateSitemap
- Throws:
IOExceptionSQLException
-
solrDatabaseResync
- Throws:
Exception
-
sendGoogleAnalyticsEvents
@Scheduled(cron="${google.analytics.cron:-}") public void sendGoogleAnalyticsEvents() -
configure
protected org.springframework.boot.builder.SpringApplicationBuilder configure(org.springframework.boot.builder.SpringApplicationBuilder application) Override the default SpringBootServletInitializer.configure() method, passing it this Application class.This is necessary to allow us to build a deployable WAR, rather than always relying on embedded Tomcat.
See: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-create-a-deployable-war-file
- Overrides:
configurein classorg.springframework.boot.web.servlet.support.SpringBootServletInitializer- Parameters:
application-- Returns:
-
dspaceContextListener
Register the "DSpaceContextListener" so that it is loaded for this Application.- Returns:
- DSpaceContextListener
-
dspaceWebappServletFilter
@Bean @Order(1) protected javax.servlet.Filter dspaceWebappServletFilter()Register the DSpaceWebappServletFilter, which initializes the DSpace RequestService / SessionService- Returns:
- DSpaceWebappServletFilter
-
dspaceRequestContextFilter
@Bean @Order(2) protected javax.servlet.Filter dspaceRequestContextFilter()Register the DSpaceRequestContextFilter, a Filter which checks for open Context objects *after* a request has been fully processed, and closes them- Returns:
- DSpaceRequestContextFilter
-
dspaceApiLoggingRequest
@Bean @Order(3) protected javax.servlet.Filter dspaceApiLoggingRequest()Register the DSpaceAPIRequestLoggingFilter, a Filter that provides Mapped Diagnostic Context for the DSpace Server Webapp- Returns:
- DSpaceRequestContextFilter
-
requestContextListener
@Bean public org.springframework.web.context.request.RequestContextListener requestContextListener() -
dspaceLinkRelationProvider
@Bean protected org.springframework.hateoas.server.LinkRelationProvider dspaceLinkRelationProvider() -
webMvcConfigurer
@Bean public org.springframework.web.servlet.config.annotation.WebMvcConfigurer webMvcConfigurer()
-