public class DefaultNotificationHandler extends Object implements NotificationHandler
Modifier and Type | Field and Description |
---|---|
protected ExecutorService |
threadPool
The
ExecutorService used to execute threaded notification. |
Constructor and Description |
---|
DefaultNotificationHandler() |
Modifier and Type | Method and Description |
---|---|
void |
notify(CometEvent cometEvent,
CometHandler cometHandler)
Notify the
CometHandler . |
void |
notify(CometEvent cometEvent,
Iterator<CometHandler> iteratorHandlers)
Notify all
CometHandler . |
protected void |
notify0(CometEvent cometEvent,
CometHandler cometHandler)
Notify a
CometHandler . |
protected void |
setThreadPool(ExecutorService threadPool)
Set the
ExecutorService used for notifying the CometHandler. |
protected ExecutorService threadPool
ExecutorService
used to execute threaded notification.protected void setThreadPool(ExecutorService threadPool)
ExecutorService
used for notifying the CometHandler.public void notify(CometEvent cometEvent, Iterator<CometHandler> iteratorHandlers) throws IOException
CometHandler
.notify
in interface NotificationHandler
cometEvent
- the CometEvent used to notify CometHandleriteratorHandlers
- An iterator over a list of CometHandlerIOException
public void notify(CometEvent cometEvent, CometHandler cometHandler) throws IOException
CometHandler
.notify
in interface NotificationHandler
cometEvent
- cometEvent the CometEvent used to notify CometHandlercometHandler
- An iterator over a list of CometHandlerIOException
protected void notify0(CometEvent cometEvent, CometHandler cometHandler)
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
cometEvent
- An object shared amongst CometHandler
.cometHandler
- The CometHandler to invoke.Copyright © 2015 Oracle Corporation. All rights reserved.