4A Server -  2.0
 All Classes Namespaces Files Functions Variables Enumerator
cz.vutbr.fit.knot.annotations.comet.AnnotCometServlet.AnnotHandler Class Reference

Comet handler. More...

Inheritance diagram for cz.vutbr.fit.knot.annotations.comet.AnnotCometServlet.AnnotHandler:
Inheritance graph
Collaboration diagram for cz.vutbr.fit.knot.annotations.comet.AnnotCometServlet.AnnotHandler:
Collaboration graph

Public Member Functions

void onEvent (CometEvent event) throws IOException
 
void onInitialize (CometEvent event) throws IOException
 
void onInterrupt (CometEvent event) throws IOException
 
void onTerminate (CometEvent event) throws IOException
 
void attach (HttpServletResponse attachment)
 
ArrayList< EditorSessiongetEdSessionList ()
 
void setEdSessionList (ArrayList< EditorSession > edSessionList)
 
EditorSession getFirstSessionAndRotate ()
 
void addSessionInSessionList (EditorSession session)
 

Private Member Functions

void removeThisFromContext () throws IOException
 

Private Attributes

HttpServletResponse response
 
ArrayList< EditorSessionedSessionList = new ArrayList<EditorSession>()
 
Boolean messagePrepared = false
 

Detailed Description

Comet handler.

Comet handler (handles comet request until timed out or sent data)

This class allow Java components part of an HTTP request to be polled by the Grizzly Asynchronous Request Mechanism. It will be notified when another CometHandler notify them using CometContext.notify. With Servlet, it is recommended to attach the HTTPServletResponse and use this object to push back bytes to the client.

Definition at line 65 of file AnnotCometServlet.java.

Member Function Documentation

void cz.vutbr.fit.knot.annotations.comet.AnnotCometServlet.AnnotHandler.addSessionInSessionList ( EditorSession  session)

Adds session to the session list

Parameters
sessionsession for add

Definition at line 263 of file AnnotCometServlet.java.

void cz.vutbr.fit.knot.annotations.comet.AnnotCometServlet.AnnotHandler.attach ( HttpServletResponse  attachment)

Attaches an attachment to this class

Parameters
attachment

Definition at line 211 of file AnnotCometServlet.java.

ArrayList<EditorSession> cz.vutbr.fit.knot.annotations.comet.AnnotCometServlet.AnnotHandler.getEdSessionList ( )

Gets client session list in which this handler was created

Returns
Returns client session list in which this handler was created

Definition at line 230 of file AnnotCometServlet.java.

EditorSession cz.vutbr.fit.knot.annotations.comet.AnnotCometServlet.AnnotHandler.getFirstSessionAndRotate ( )

Gets the latest used session in list in which this handler was created

Returns
Returns latest used client session in which this handler was created

Definition at line 248 of file AnnotCometServlet.java.

void cz.vutbr.fit.knot.annotations.comet.AnnotCometServlet.AnnotHandler.onEvent ( CometEvent  event) throws IOException

Event handler Process notify events created in POST requests

Parameters
eventEvent
Exceptions
java.io.IOException

Definition at line 82 of file AnnotCometServlet.java.

Here is the call graph for this function:

void cz.vutbr.fit.knot.annotations.comet.AnnotCometServlet.AnnotHandler.onInitialize ( CometEvent  event) throws IOException

This method is called when connection is suspended by addCometHandler()

Parameters
eventEvent

Definition at line 145 of file AnnotCometServlet.java.

void cz.vutbr.fit.knot.annotations.comet.AnnotCometServlet.AnnotHandler.onInterrupt ( CometEvent  event) throws IOException

This method is called when connection timed out or if client closes connnection. If timed out, ok message is sent. If client closes connection, ok message is sent too (but possibly discarded).

Parameters
eventEvent

Definition at line 165 of file AnnotCometServlet.java.

Here is the call graph for this function:

void cz.vutbr.fit.knot.annotations.comet.AnnotCometServlet.AnnotHandler.onTerminate ( CometEvent  event) throws IOException

This method is called when connection is resumed and terminated

Parameters
eventEvent

Definition at line 201 of file AnnotCometServlet.java.

Here is the call graph for this function:

void cz.vutbr.fit.knot.annotations.comet.AnnotCometServlet.AnnotHandler.removeThisFromContext ( ) throws IOException
private

Removes this hadler from comet context

Definition at line 218 of file AnnotCometServlet.java.

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.comet.AnnotCometServlet.AnnotHandler.setEdSessionList ( ArrayList< EditorSession edSessionList)

Sets client session list in which this handler was created

Parameters
edSessionListClient session list in which this handler was created

Definition at line 239 of file AnnotCometServlet.java.

Member Data Documentation

ArrayList<EditorSession> cz.vutbr.fit.knot.annotations.comet.AnnotCometServlet.AnnotHandler.edSessionList = new ArrayList<EditorSession>()
private

Client session in which this handler was created

Definition at line 70 of file AnnotCometServlet.java.

Boolean cz.vutbr.fit.knot.annotations.comet.AnnotCometServlet.AnnotHandler.messagePrepared = false
private

Was message already prepared?

Definition at line 72 of file AnnotCometServlet.java.

HttpServletResponse cz.vutbr.fit.knot.annotations.comet.AnnotCometServlet.AnnotHandler.response
private

Servlet response object

Definition at line 68 of file AnnotCometServlet.java.


The documentation for this class was generated from the following file: