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,AbstractNotarizationService,AlfrescoService,AuditCollectionCreator,AuditServiceImpl,AuditWebFilter,EventHandler,GridFsRepositoryImpl,MongoNodeRepositoryImpl,MongoNodeService,NodeArchivingJob,NodeCollectionCreator,NodeNotarizationJob,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 TypeMethodDescriptionvoidinit()Called after dependency injection is complete.voidsetApplicationContext(@NonNull org.springframework.context.ApplicationContext applicationContext) Stores the injectedApplicationContextfor later use.voidshutDown(int exitCode) Closes the Spring context and terminates the JVM with the given exit code.voidstop()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 injectedApplicationContextfor later use.- Specified by:
setApplicationContextin 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
-