Class BaseService

java.lang.Object
ortus.boxlang.runtime.services.BaseService
All Implemented Interfaces:
IService
Direct Known Subclasses:
ApplicationService, AsyncService, CacheService, ComponentService, DatasourceService, FunctionService, ModuleService, SchedulerService

public abstract class BaseService extends Object implements IService
A base service class that all services should extend.
  • Field Details

    • timerUtil

      protected static final Timer timerUtil
      The timer utility class
    • runtime

      protected BoxRuntime runtime
      The runtime singleton link
    • name

      protected Key name
      The service name
  • Constructor Details

    • BaseService

      protected BaseService(BoxRuntime runtime, Key name)
      Runtime Service Constructor
      Parameters:
      runtime - The runtime singleton
  • Method Details

    • getTimerUtil

      public Timer getTimerUtil()
      Get the timer utility class
      Returns:
      The timer utility class
    • getRuntime

      public BoxRuntime getRuntime()
      Get the runtime singleton
      Returns:
      The runtime
    • getName

      public Key getName()
      Get the service name
      Specified by:
      getName in interface IService
      Returns:
      The service name
    • onConfigurationLoad

      public abstract void onConfigurationLoad()
      The configuration load event is fired when the runtime loads the configuration
      Specified by:
      onConfigurationLoad in interface IService
    • onStartup

      public abstract void onStartup()
      The startup event is fired when the runtime starts up
      Specified by:
      onStartup in interface IService
    • onShutdown

      public abstract void onShutdown(Boolean force)
      The shutdown event is fired when the runtime shuts down
      Specified by:
      onShutdown in interface IService
      Parameters:
      force - Whether the shutdown is forced
    • announce

      public void announce(Key state, IStruct data)
      Announce an event with the provided IStruct of data.
      Parameters:
      state - The state key to announce
      data - The data to announce
    • announce

      public void announce(BoxEvent state, IStruct data)
      Announce an event with the provided IStruct of data.
      Parameters:
      state - The state key to announce
      data - The data to announce
    • announce

      public void announce(Key state)
      Announce an event with no data.
      Parameters:
      state - The state key to announce
    • announce

      public void announce(BoxEvent state)
      Announce an event with no data.
      Parameters:
      state - The state key to announce