Interface SdcDevicePlugin

All Known Implementing Classes:
SdcRequiredTypesAndScopes

public interface SdcDevicePlugin
Definition of a plugin for SdcDevice that is called back on different stages of startup and shutdown.

Every callback provides full control of Device. There is also access to the LocalMdibAccess and OperationInvocationReceiver collection passed to the SdcDevice constructor via SdcDeviceFactory.

All of the previously mentioned data is accessible through SdcDeviceContext.

The plugin mechanism can be used in order to run LocalMdibAccess controllers.

  • Method Details

    • beforeStartUp

      default void beforeStartUp(SdcDeviceContext context) throws Exception
      Called before the device starts up.
      Parameters:
      context - all accessible SdcDevice data.
      Throws:
      Exception - any exception thrown will immediately stop the device from continuing startup. Calls for afterStartUp(SdcDeviceContext), beforeShutDown(SdcDeviceContext) and afterShutDown(SdcDeviceContext) are omitted. No further plugin calls for this function are going to be invoked after.
    • afterStartUp

      default void afterStartUp(SdcDeviceContext context) throws Exception
      Called once the device is running.

      This callback is triggered only if the device was running before, i.e., AbstractIdleService.isRunning() returned true.

      Parameters:
      context - all accessible SdcDevice data.
      Throws:
      Exception - any exception thrown will immediately stop the device from continuing startup. Calls for beforeShutDown(SdcDeviceContext) and afterShutDown(SdcDeviceContext) are omitted. No further plugin calls for this function are going to be invoked after.
    • beforeShutDown

      default void beforeShutDown(SdcDeviceContext context) throws Exception
      Called before the device is about to shutdown.

      This callback is triggered only if the device was running before, i.e., AbstractIdleService.isRunning() returned true.

      Parameters:
      context - all accessible SdcDevice data.
      Throws:
      Exception - any exception thrown does not stop the device from shutting down. A message is sent to the logger, any subsequent plugins will be invoked and internal device functions will be stopped. afterShutDown(SdcDeviceContext) is still going to be invoked.
    • afterShutDown

      default void afterShutDown(SdcDeviceContext context) throws Exception
      Called after the device was shut down.

      This callback is triggered only if the device was running before, i.e., AbstractIdleService.isRunning() returned true.

      Parameters:
      context - all accessible SdcDevice data.
      Throws:
      Exception - any exception thrown does not affect any other plugins from being invoked. A message will be sent to the logger.