|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.grizzly.comet.DefaultNotificationHandler
public class DefaultNotificationHandler
Default Notificationhandler that uses a thread pool dedicated to the CometEngine
to execute the notification process.
Field Summary | |
---|---|
protected boolean |
blockingNotification
true if the caller of CometContext.notify should block when notifying other CometHandler. |
protected ExecutorService |
threadPool
The ExecutorService used to execute threaded notification. |
Constructor Summary | |
---|---|
DefaultNotificationHandler()
|
Method Summary | |
---|---|
boolean |
isBlockingNotification()
Return true if the invoker of notify() should block when notifying Comet Handlers. |
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 . |
void |
setBlockingNotification(boolean blockingNotification)
Set to true if the invoker of notify() should block when notifying Comet Handlers. |
void |
setSpreadNotifyToManyToThreads(boolean spreadNotifyToManyToThreads)
if true a notify to Iterator |
protected void |
setThreadPool(ExecutorService threadPool)
Set the ExecutorService used for notifying the CometHandler. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ExecutorService threadPool
ExecutorService
used to execute threaded notification.
protected boolean blockingNotification
Constructor Detail |
---|
public DefaultNotificationHandler()
Method Detail |
---|
protected void setThreadPool(ExecutorService threadPool)
ExecutorService
used for notifying the CometHandler.
public boolean isBlockingNotification()
isBlockingNotification
in interface NotificationHandler
public void setBlockingNotification(boolean blockingNotification)
setBlockingNotification
in interface NotificationHandler
public void setSpreadNotifyToManyToThreads(boolean spreadNotifyToManyToThreads)
spreadNotifyToManyToThreads
- 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 CometHandler
IOException
public void notify(CometEvent cometEvent, CometHandler cometHandler) throws IOException
CometHandler
.
notify
in interface NotificationHandler
cometEvent
- cometEvent the CometEvent used to notify CometHandlercometHandler
-
IOException
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
attachment
- An object shared amongst CometHandler
.cometHandler
- The CometHandler to invoke.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |