Class Application
java.lang.Object
africa.absa.inception.application.Application
- All Implemented Interfaces:
org.springframework.web.WebApplicationInitializer
@Component
@ComponentScan(basePackages="africa.absa.inception",
lazyInit=true)
@EnableAsync
@EnableScheduling
public abstract class Application
extends Object
implements org.springframework.web.WebApplicationInitializer
The Application class provides the class that all application-specific application classes
should be derived from.
- Author:
- Marcus Portmann
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedApplication(org.springframework.context.ApplicationContext applicationContext) Constructs a new Application. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.context.ApplicationContextReturns the Spring application context.protected org.springframework.http.converter.json.Jackson2ObjectMapperBuilderReturns the Jackson2ObjectMapperBuilder bean, which configures the Jackson JSON processor package.protected org.springframework.context.MessageSourceReturns the application message source.protected com.codahale.metrics.MetricRegistryReturns the metric registry.com.fasterxml.jackson.databind.ObjectMapperReturns the Jackson2 object mapper.voidonStartup(javax.servlet.ServletContext container) protected ExecutorReturns the Spring task executor to use for @Async method invocations.protected org.springframework.scheduling.TaskSchedulerReturns the Spring task scheduler.
-
Constructor Details
-
Application
protected Application(org.springframework.context.ApplicationContext applicationContext) Constructs a new Application.- Parameters:
applicationContext- the Spring application context
-
-
Method Details
-
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext()Returns the Spring application context.- Returns:
- the Spring application context
-
objectMapper
@Bean public com.fasterxml.jackson.databind.ObjectMapper objectMapper()Returns the Jackson2 object mapper.- Returns:
- the Jackson2 object mapper
-
onStartup
public void onStartup(javax.servlet.ServletContext container) - Specified by:
onStartupin interfaceorg.springframework.web.WebApplicationInitializer
-
jackson2ObjectMapperBuilder
protected org.springframework.http.converter.json.Jackson2ObjectMapperBuilder jackson2ObjectMapperBuilder()Returns the Jackson2ObjectMapperBuilder bean, which configures the Jackson JSON processor package.- Returns:
- the Jackson2ObjectMapperBuilder bean, which configures the Jackson JSON processor package
-
messageSource
@Bean protected org.springframework.context.MessageSource messageSource()Returns the application message source.- Returns:
- the application message source
-
metricRegistry
@Bean protected com.codahale.metrics.MetricRegistry metricRegistry()Returns the metric registry.- Returns:
- the metric registry
-
taskExecutor
Returns the Spring task executor to use for @Async method invocations.- Returns:
- the Spring task executor to use for @Async method invocations
-
taskScheduler
@Bean protected org.springframework.scheduling.TaskScheduler taskScheduler()Returns the Spring task scheduler.- Returns:
- the Spring task scheduler
-