com.sun.grizzly.grizzlet
Interface AsyncConnection

All Known Implementing Classes:
AsyncConnectionImpl

public interface AsyncConnection

This class represent a possible asynchronous connection. An asynchronous connection can always be suspended or resumed, its associated request and response objects be used to construct a response, etc.

Author:
Jeanfrancois Arcand

Method Summary
 String getPushEvent()
          Return the message that can be pushed back.
 GrizzletRequest getRequest()
          Return the GrizzletRequest associated with this AsynchConnection.
 GrizzletResponse getResponse()
          Return the GrizzletResponse associated with this AsynchConnection.
 boolean hasPushEvent()
          Is this AsyncConnection has push events ready to push back data to its associated client.
 boolean isGet()
          Is the current asynchronous connection defined as an HTTP Get.
 boolean isPost()
          Is the current asynchronous connection defined as an HTTP Get.
 boolean isResuming()
          Is this AsyncConnection being in the process of being resumed?
 boolean isSuspended()
          Return true is the current connection associated with this event has been suspended.
 void push(String message)
          Advises the Grizzlet Container to start intiating a push operation, using the argument message.
 void resume()
          Resume a suspended connection.
 void suspend()
          Suspend the current connection.
 

Method Detail

isSuspended

boolean isSuspended()
Return true is the current connection associated with this event has been suspended.


suspend

void suspend()
             throws AlreadyPausedException
Suspend the current connection. Suspended connection are parked and eventually used when the Grizzlet Container initiates pushes.

Throws:
AlreadyPausedException

resume

void resume()
            throws NotYetPausedException
Resume a suspended connection. The response will be completed and the connection become synchronous (e.g. a normal http connection).

Throws:
NotYetPausedException

push

void push(String message)
          throws IOException
Advises the Grizzlet Container to start intiating a push operation, using the argument message. All asynchronous connection that has been suspended will have a chance to push the data back to their associated clients.

Parameters:
message - The data that will be pushed.
Throws:
IOException

getRequest

GrizzletRequest getRequest()
Return the GrizzletRequest associated with this AsynchConnection.


getResponse

GrizzletResponse getResponse()
Return the GrizzletResponse associated with this AsynchConnection.


isResuming

boolean isResuming()
Is this AsyncConnection being in the process of being resumed?


hasPushEvent

boolean hasPushEvent()
Is this AsyncConnection has push events ready to push back data to its associated client.


getPushEvent

String getPushEvent()
Return the message that can be pushed back.


isGet

boolean isGet()
Is the current asynchronous connection defined as an HTTP Get.


isPost

boolean isPost()
Is the current asynchronous connection defined as an HTTP Get.



Copyright © 2010 SUN Microsystems. All Rights Reserved.