Top Description Fields Constructors Methods
org.glassfish.grizzly.comet

public Class DefaultNotificationHandler

extends Object
implements NotificationHandler
Class Inheritance
All Implemented Interfaces
org.glassfish.grizzly.comet.NotificationHandler
Imports
java.io.IOException, java.util.Iterator, java.util.concurrent.ExecutorService, java.util.logging.Level, .Logger

Default NotificationHandler that uses a thread pool dedicated to the CometEngine to execute the notification process.
Authors
Jeanfrancois Arcand, Gustav Trede

Field Summary

Modifier and TypeField and Description
private static final IllegalStateException
private static final Logger
protected ExecutorService
threadPool

The ExecutorService used to execute threaded notification.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
notify(final CometEvent<E>
the CometEvent used to notify CometHandler
cometEvent
,
final Iterator<CometHandler<E>>
An iterator over a list of CometHandler
iteratorHandlers
)

Implements org.glassfish.grizzly.comet.NotificationHandler.notify.

Notify all CometHandler.

public void
notify(final CometEvent<E>
cometEvent the CometEvent used to notify CometHandler
cometEvent
,
final CometHandler<E> cometHandler)

Implements org.glassfish.grizzly.comet.NotificationHandler.notify.

Notify the CometHandler.

protected void
notify0(CometEvent<E>
An object shared amongst CometHandler.
cometEvent
,
CometHandler<E>
The CometHandler to invoke.
cometHandler
)

Notify a CometHandler.

protected void
setThreadPool(ExecutorService threadPool)

Set the ExecutorService used for notifying the CometHandler.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ISEemptyback to summary
private static final IllegalStateException ISEempty
loggerback to summary
private static final Logger logger
threadPoolback to summary
protected ExecutorService threadPool

The ExecutorService used to execute threaded notification.

Constructor Detail

DefaultNotificationHandlerback to summary
public DefaultNotificationHandler()

Method Detail

notifyback to summary
public void notify(final CometEvent<E> cometEvent, final Iterator<CometHandler<E>> iteratorHandlers) throws IOException

Implements org.glassfish.grizzly.comet.NotificationHandler.notify.

Notify all CometHandler.

Parameters
cometEvent:CometEvent<E>

the CometEvent used to notify CometHandler

iteratorHandlers:Iterator<CometHandler<E>>

An iterator over a list of CometHandler

Annotations
@Override
notifyback to summary
public void notify(final CometEvent<E> cometEvent, final CometHandler<E> cometHandler) throws IOException

Implements org.glassfish.grizzly.comet.NotificationHandler.notify.

Notify the CometHandler.

Parameters
cometEvent:CometEvent<E>

cometEvent the CometEvent used to notify CometHandler

Annotations
@Override
notify0back to summary
protected void notify0(CometEvent<E> cometEvent, CometHandler<E> 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:CometEvent<E>

An object shared amongst CometHandler.

cometHandler:CometHandler<E>

The CometHandler to invoke.

setThreadPoolback to summary
protected void setThreadPool(ExecutorService threadPool)

Set the ExecutorService used for notifying the CometHandler.