Class EventListenerAdaptorFactory

java.lang.Object
io.keikai.model.impl.EventListenerAdaptorFactory

public class EventListenerAdaptorFactory extends Object
Factory for creating EventListenerAdaptor instances.

When ZK is on the classpath, creates EventQueueListenerAdaptor for UI event dispatch. When ZK is not available (headless mode), falls back to DirectEventListenerAdaptor.

Since:
7.0.0
  • Constructor Details

    • EventListenerAdaptorFactory

      public EventListenerAdaptorFactory()
  • Method Details

    • createQueueAdaptor

      public static EventListenerAdaptor createQueueAdaptor(String scope, String bookId)
      Creates a queue-based listener adaptor (for UI event dispatch). Falls back to DirectEventListenerAdaptor if ZK is not on the classpath.
      Parameters:
      scope - the event queue scope (e.g. "desktop", "session", "application")
      bookId - the book identifier used as part of the queue name
      Returns:
      an EventListenerAdaptor instance
    • isZkAvailable

      public static boolean isZkAvailable()
      Returns whether ZK event queue is available on the classpath.
      Returns:
      true if ZK EventQueues can be used, false otherwise