com.sun.grizzly.comet
Class CometEvent<E>

java.lang.Object
  extended by com.sun.grizzly.comet.CometEvent<E>
Direct Known Subclasses:
CometEvent

public class CometEvent<E>
extends Object

Simple event class used to pass information between CometHandler and the Comet implementation.

Author:
Jeanfrancois Arcand

Field Summary
protected  E attachment
          Share an E amongst CometHandler
static int INITIALIZE
          Initialize the CometHandler.
static int INTERRUPT
          Interrupt the CometHandler.
static int NOTIFY
          Notify the CometHandler.
static int READ
          Notify the CometHandler of available bytes.
static int TERMINATE
          Terminate the CometHandler.
protected  int type
          This type of event.
static int WRITE
          Notify the CometHandler when the channel is writable.
 
Constructor Summary
CometEvent()
          Create a new ComettEvent
 
Method Summary
 void attach(E attachment)
          Attach an
 E attachment()
          Return the attachment
 CometContext getCometContext()
          Return the CometContext that fired this event.
 int getType()
          Return the type of this object.
protected  void setCometContext(CometContext cometContext)
          Set the CometContext that fired this event.
protected  void setType(int type)
          Set the type of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTERRUPT

public static final int INTERRUPT
Interrupt the CometHandler.

See Also:
Constant Field Values

NOTIFY

public static final int NOTIFY
Notify the CometHandler.

See Also:
Constant Field Values

INITIALIZE

public static final int INITIALIZE
Initialize the CometHandler.

See Also:
Constant Field Values

TERMINATE

public static final int TERMINATE
Terminate the CometHandler.

See Also:
Constant Field Values

READ

public static final int READ
Notify the CometHandler of available bytes.

See Also:
Constant Field Values

WRITE

public static final int WRITE
Notify the CometHandler when the channel is writable.

See Also:
Constant Field Values

type

protected int type
This type of event.


attachment

protected E attachment
Share an E amongst CometHandler

Constructor Detail

CometEvent

public CometEvent()
Create a new ComettEvent

Method Detail

getType

public int getType()
Return the type of this object.

Returns:
int Return the type of this object

setType

protected void setType(int type)
Set the type of this object.

Parameters:
int - the type of this object

attach

public void attach(E attachment)
Attach an

Parameters:
attachment - An attachment.

attachment

public E attachment()
Return the attachment

Returns:
attachment An attachment.

getCometContext

public CometContext getCometContext()
Return the CometContext that fired this event.


setCometContext

protected void setCometContext(CometContext cometContext)
Set the CometContext that fired this event.



Copyright © 2008 SUN Microsystems. All Rights Reserved.