Class InterceptorService

java.lang.Object
ortus.boxlang.runtime.events.InterceptorPool
ortus.boxlang.runtime.services.InterceptorService
All Implemented Interfaces:
IService

public class InterceptorService extends InterceptorPool implements IService
The interceptor service is responsible for managing all events in BoxLang. A developer will register an interceptor with the service, and the service will invoke the interceptor when the event is fired. The interceptor service is a singleton. Each service manages interception points, which are the events that the service can announce and their states, which are where interceptors can register to listen to.
  • Constructor Details

    • InterceptorService

      public InterceptorService(BoxRuntime runtime)
      Get an instance of the service
      Parameters:
      runtime - The runtime singleton
  • Method Details

    • onConfigurationLoad

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

      public boolean canLoadInterceptor(Class<? extends IInterceptor> targetClass)
      This method encapsulates the logic to determine if an interceptor can be loaded or not.
      Parameters:
      targetClass - The class of the interceptor to be loaded
      Returns:
      True if the interceptor can be loaded, false otherwise
    • onStartup

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

      public void onShutdown(Boolean force)
      The shutdown event is fired when the runtime shuts down
      Specified by:
      onShutdown in interface IService
      Parameters:
      force - True if the shutdown is forced, false otherwise