Interface LightyModule

All Known Subinterfaces:
LightyController
All Known Implementing Classes:
AbstractLightyModule, LightyControllerImpl

public interface LightyModule
This is common interface for all Lighty modules. Main Lighty components are modules. There is only one core module LightyController and other modules depend on this module. Typically, module is north-bound plugin or south-bound plugin, or any logical component of Lighty application using services provided by core module.
Author:
juraj.veverka
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.common.util.concurrent.ListenableFuture<Boolean>
    Shutdown module.
    boolean
    shutdown(long duration, TimeUnit unit)
    Shutdown module and wait for completion for specified amount of time.
    com.google.common.util.concurrent.ListenableFuture<Boolean>
    Start in background and return immediately.
    void
    Start and block until shutdown is requested.
  • Method Details

    • start

      com.google.common.util.concurrent.ListenableFuture<Boolean> start()
      Start in background and return immediately.
      Returns:
      true if module initialization was successful, false or exception otherwise.
    • startBlocking

      void startBlocking() throws InterruptedException
      Start and block until shutdown is requested.
      Throws:
      InterruptedException - thrown in case module initialization fails.
    • shutdown

      com.google.common.util.concurrent.ListenableFuture<Boolean> shutdown() throws Exception
      Shutdown module.
      Returns:
      true if module shutdown was successful, false or exception otherwise.
      Throws:
      Exception - thrown while module shutdown failed
    • shutdown

      boolean shutdown(long duration, TimeUnit unit)
      Shutdown module and wait for completion for specified amount of time.
      Parameters:
      duration - duration of time to wait for completion
      unit - unit of time duration
      Returns:
      true if module shutdown was successful in specified time, false otherwise.