Class DefaultNotificationHandler

java.lang.Object
org.glassfish.grizzly.comet.DefaultNotificationHandler
All Implemented Interfaces:
NotificationHandler

public class DefaultNotificationHandler extends Object implements NotificationHandler
Default NotificationHandler that uses a thread pool dedicated to the CometEngine to execute the notification process.
Author:
Jeanfrancois Arcand, Gustav Trede
  • Field Details

  • Constructor Details

    • DefaultNotificationHandler

      public DefaultNotificationHandler()
  • Method Details

    • setThreadPool

      protected void setThreadPool(ExecutorService threadPool)
      Set the ExecutorService used for notifying the CometHandler.
    • notify

      public void notify(CometEvent cometEvent, Iterator<CometHandler> iteratorHandlers) throws IOException
      Notify all CometHandler.
      Specified by:
      notify in interface NotificationHandler
      Parameters:
      cometEvent - the CometEvent used to notify CometHandler
      iteratorHandlers - An iterator over a list of CometHandler
      Throws:
      IOException
    • notify

      public void notify(CometEvent cometEvent, CometHandler cometHandler) throws IOException
      Notify the CometHandler.
      Specified by:
      notify in interface NotificationHandler
      Parameters:
      cometEvent - cometEvent the CometEvent used to notify CometHandler
      cometHandler - An iterator over a list of CometHandler
      Throws:
      IOException
    • notify0

      protected void notify0(CometEvent cometEvent, CometHandler cometHandler)
      Notify a CometHandler.

      CometEvent.INTERRUPT -> CometHandler.onInterrupt CometEvent.NOTIFY -> CometHandler.onEvent CometEvent.INITIALIZE -> CometHandler.onInitialize CometEvent.TERMINATE -> CometHandler.onTerminate CometEvent.READ -> CometHandler.onEvent CometEvent.WRITE -> CometHandler.onEvent

      Parameters:
      cometEvent - An object shared amongst CometHandler.
      cometHandler - The CometHandler to invoke.