Package org.saidone.component
Class BaseComponent
java.lang.Object
org.saidone.component.BaseComponent
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
AbstractCryptoService
,AlfrescoService
,AuditCollectionCreator
,AuditService
,AuditWebFilter
,EventHandler
,GridFsRepositoryImpl
,MongoNodeRepositoryImpl
,MongoNodeService
,NodeArchivingJob
,S3ContentService
,S3RepositoryImpl
,SecretService
,VaultService
public abstract class BaseComponent
extends Object
implements org.springframework.context.ApplicationContextAware
Base class for all Spring managed components of the Alfresco Node Vault.
This class centralises common lifecycle handling. It logs a message when
a component is initialised or destroyed and exposes a helper method to
gracefully close the ApplicationContext
and terminate the
application.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
init()
Called after dependency injection is complete.void
setApplicationContext
(@NonNull org.springframework.context.ApplicationContext applicationContext) Stores the injectedApplicationContext
for later use.void
shutDown
(int exitCode) Closes the Spring context and terminates the JVM with the given exit code.void
stop()
Called just before the bean is destroyed.
-
Constructor Details
-
BaseComponent
public BaseComponent()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(@NonNull @NonNull org.springframework.context.ApplicationContext applicationContext) Stores the injectedApplicationContext
for later use.- Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
-
init
@PostConstruct public void init()Called after dependency injection is complete. Logs a startup message indicating that the component is ready. -
stop
@PreDestroy public void stop()Called just before the bean is destroyed. Logs a shutdown message indicating that the component is stopping. -
shutDown
public void shutDown(int exitCode) Closes the Spring context and terminates the JVM with the given exit code.- Parameters:
exitCode
- exit code returned to the operating system
-