Class BusMemoryStateManager

java.lang.Object
it.rebirthproject.ufoeb.architecture.state.BusMemoryStateManager
All Implemented Interfaces:
Runnable

public class BusMemoryStateManager extends Object implements Runnable
The bus memory state manager which stores and manages events and listeners
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
      The logger used by this class
    • commandQueryMessageQueue

      private final BlockingQueue<Message> commandQueryMessageQueue
      The message queue is used by the BusMemoryStateManager to receive internal system messages.
      example: (REGISTER_MESSAGE, UNREGISTER_MESSAGE, SHUTDOWN_STATE_MANAGER, etc... )
      Once one of those messages is received, it will be handled accordingly.
    • workersPoolExecutor

      private final ExecutorService workersPoolExecutor
      This is the thread pool cache that handles thread parallelism to obtain bus scalability.
    • countDownLatch

      private final CountDownLatch countDownLatch
      A CountDownLatch used during the shutdown phase to notify when the BusMemoryStateManager is shutting down.
    • memoryState

      private final MemoryState memoryState
    • listenerMethodFinder

      private final ListenerMethodFinder listenerMethodFinder
      The ListenerMethodFinder is a service used to retrieve registered listeners methods annotated with Listen and to store them inside the MemoryState
    • throwNoRegistrationsWarning

      private final boolean throwNoRegistrationsWarning
      A boolean flag used to determine if a throwNoRegistrationsWarning should be raised or not. If the flag is false no warning be will be thrown when an event is posted and no listeners are registered to listen to that precise event.
  • Constructor Details

    • BusMemoryStateManager

      public BusMemoryStateManager(BlockingQueue<Message> commandQueryMessageQueue, ExecutorService workersPoolExecutor, CountDownLatch countDownLatch, MemoryState memoryState, ListenerMethodFinder listenerMethodFinder, boolean throwNoRegistrationsWarning)
      The constructor used to build the BusMemoryStateManager
      Parameters:
      commandQueryMessageQueue - The message queue is used by the BusMemoryStateManager to receive internal system messages.
      example: (REGISTER_MESSAGE, UNREGISTER_MESSAGE, SHUTDOWN_STATE_MANAGER, etc... )
      Once one of those messages is received, it will be handled accordingly.
      workersPoolExecutor - This is the thread pool cache that handles thread parallelism to obtain bus scalability.
      countDownLatch - A countDownLatch used during the shutdown phase to notify when the BusMemoryStateManager is shutting down.
      memoryState - The MemoryState of the EventBus
      listenerMethodFinder - The ListenerMethodFinder is a service used to retrieve registered listeners methods annotated with Listen and to store them inside the MemoryState
      throwNoRegistrationsWarning - A boolean flag used to determine if a throwNoRegistrationsWarning should be raised or not. If the flag is false no warning be will be thrown when an event is posted and no listeners are registered to listen to that precise event.
  • Method Details