Package de.bytestore.hostinger
Class HostingerApplication
java.lang.Object
de.bytestore.hostinger.HostingerApplication
- All Implemented Interfaces:
com.vaadin.flow.component.page.AppShellConfigurator,Serializable
@Theme("hostinger")
@SpringBootApplication
@EnableSpringConfigured
@MessageSourceBasenames({"de/bytestore/hostinger/space_messages","de/bytestore/hostinger/menu_messages","de/bytestore/hostinger/guardian_messages"})
@EnableAspectJAutoProxy
@Configuration
public class HostingerApplication
extends Object
implements com.vaadin.flow.component.page.AppShellConfigurator
Entry point and main configuration class for the Hostinger application.
This class is the starting point of the Spring Boot application and contains
various configurations and event handling methods to manage application startup.
It integrates multiple Spring features such as dependency injection, application
configuration, database connection setup, and event listening.
Annotations applied:
-
@Push: Specifies WebSocket communication for push functionality.
- @Theme: Defines the application's theme.
- @PWA: Enables progressive web application configuration.
- @SpringBootApplication: Marks this class as the main configuration class of a Spring Boot application.
- @EnableSpringConfigured: Enables Spring Dependency Injection support.
- @MessageSourceBasenames: Configures the locations of message resource bundles for internationalization.
- @EnableAspectJAutoProxy: Enables proxy-based aspect-oriented programming (AOP).
- @Configuration: Marks this class as a configuration class for the Spring application context.
Implements:
- AppShellConfigurator: Interface for configuring the application shell.
Spring Beans:
- DataSourceProperties: Configures properties for the application's primary data source.
- DataSource: Initializes the application's primary data source using HikariCP.
Event Listeners:
- onApplicationStarted: Handles the ApplicationStartedEvent to log application startup and initialize the system service.
- printApplicationUrl: Logs the URL where the application is accessible after startup.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidMain method that serves as the entry point of the HostingerApplication.voidonApplicationStarted(org.springframework.boot.context.event.ApplicationStartedEvent event) Handles the `ApplicationStartedEvent` triggered when the Hostinger application has been fully started.voidprintApplicationUrl(org.springframework.boot.context.event.ApplicationStartedEvent event) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.page.AppShellConfigurator
configurePage
-
Constructor Details
-
HostingerApplication
public HostingerApplication()
-
-
Method Details
-
main
Main method that serves as the entry point of the HostingerApplication. It initializes and runs the Spring Boot application context.- Parameters:
args- an array of command-line arguments passed to the application
-
onApplicationStarted
@EventListener public void onApplicationStarted(org.springframework.boot.context.event.ApplicationStartedEvent event) Handles the `ApplicationStartedEvent` triggered when the Hostinger application has been fully started. This method is marked with the@GainRootannotation to indicate elevated access functionality and is registered as an event listener with@EventListener. It logs the application startup event and initializes the system services by invoking thesystemService.load()method.- Parameters:
event- theApplicationStartedEventinstance containing information about the application startup, such as the application context and environment details.
-
printApplicationUrl
@EventListener public void printApplicationUrl(org.springframework.boot.context.event.ApplicationStartedEvent event)
-