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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called after dependency injection is complete.
    void
    setApplicationContext(@NonNull org.springframework.context.ApplicationContext applicationContext)
    Stores the injected ApplicationContext for later use.
    void
    shutDown(int exitCode)
    Closes the Spring context and terminates the JVM with the given exit code.
    void
    Called just before the bean is destroyed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BaseComponent

      public BaseComponent()
  • Method Details

    • setApplicationContext

      public void setApplicationContext(@NonNull @NonNull org.springframework.context.ApplicationContext applicationContext)
      Stores the injected ApplicationContext for later use.
      Specified by:
      setApplicationContext in interface org.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