Package org.glassfish.grizzly.comet
Class DefaultNotificationHandler
java.lang.Object
org.glassfish.grizzly.comet.DefaultNotificationHandler
- All Implemented Interfaces:
NotificationHandler
Default NotificationHandler that uses a thread pool dedicated to the CometEngine to execute the notification
process.
- Author:
- Jeanfrancois Arcand, Gustav Trede
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ExecutorServiceTheExecutorServiceused to execute threaded notification. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidnotify(CometEvent cometEvent, Iterator<CometHandler> iteratorHandlers) Notify allCometHandler.voidnotify(CometEvent cometEvent, CometHandler cometHandler) Notify theCometHandler.protected voidnotify0(CometEvent cometEvent, CometHandler cometHandler) Notify aCometHandler.protected voidsetThreadPool(ExecutorService threadPool) Set theExecutorServiceused for notifying the CometHandler.
-
Field Details
-
threadPool
TheExecutorServiceused to execute threaded notification.
-
-
Constructor Details
-
DefaultNotificationHandler
public DefaultNotificationHandler()
-
-
Method Details
-
setThreadPool
Set theExecutorServiceused for notifying the CometHandler. -
notify
public void notify(CometEvent cometEvent, Iterator<CometHandler> iteratorHandlers) throws IOException Notify allCometHandler.- Specified by:
notifyin interfaceNotificationHandler- Parameters:
cometEvent- the CometEvent used to notify CometHandleriteratorHandlers- An iterator over a list of CometHandler- Throws:
IOException
-
notify
Notify theCometHandler.- Specified by:
notifyin interfaceNotificationHandler- Parameters:
cometEvent- cometEvent the CometEvent used to notify CometHandlercometHandler- An iterator over a list of CometHandler- Throws:
IOException
-
notify0
Notify aCometHandler. CometEvent.INTERRUPT ->CometHandler.onInterruptCometEvent.NOTIFY ->CometHandler.onEventCometEvent.INITIALIZE ->CometHandler.onInitializeCometEvent.TERMINATE ->CometHandler.onTerminateCometEvent.READ ->CometHandler.onEventCometEvent.WRITE ->CometHandler.onEvent- Parameters:
cometEvent- An object shared amongstCometHandler.cometHandler- The CometHandler to invoke.
-