com.caucho.mqueue.stomp
Class StompConnection

java.lang.Object
  extended by com.caucho.mqueue.stomp.StompConnection
All Implemented Interfaces:
ProtocolConnection

public class StompConnection
extends java.lang.Object
implements ProtocolConnection

Custom serialization for the cache


Method Summary
 boolean abort(java.lang.String tid)
           
 boolean ack(java.lang.String sid, long mid)
           
 boolean begin(java.lang.String tid)
           
 boolean commit(java.lang.String tid)
           
 StompReceiptListener createReceiptCallback()
           
 long getContentLength()
           
 java.lang.String getContentType()
           
 StompDestination getDestination()
           
 java.lang.String getId()
           
 long getMessageId()
           
 java.lang.String getProtocolRequestURL()
          Returns a request URL for debugging/management.
 java.lang.String getReceipt()
           
 long getSessionId()
           
 java.lang.String getSubscription()
           
 java.lang.String getTransaction()
           
 boolean handleRequest()
          Handles a new request.
 boolean handleResume()
          Handles a resumption of the connection for an async/comet request.
 void init()
          Initialize the connection.
 boolean isWaitForRead()
          Return true if the connection should wait for a read before handling the request.
 boolean nack(java.lang.String sid, long mid)
           
 void onCloseConnection()
          Handles a close event when the connection is closed.
 void onStartConnection()
          Called when the connection starts, i.e.
 boolean subscribe()
           
 boolean unsubscribe(java.lang.String id)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getProtocolRequestURL

public java.lang.String getProtocolRequestURL()
Description copied from interface: ProtocolConnection
Returns a request URL for debugging/management.

Specified by:
getProtocolRequestURL in interface ProtocolConnection

init

public void init()
Description copied from interface: ProtocolConnection
Initialize the connection. At this point, the current thread is the connection thread.

Specified by:
init in interface ProtocolConnection

getSessionId

public long getSessionId()

getContentLength

public long getContentLength()

getMessageId

public long getMessageId()

getSubscription

public java.lang.String getSubscription()

getContentType

public java.lang.String getContentType()

getDestination

public StompDestination getDestination()

getId

public java.lang.String getId()

getReceipt

public java.lang.String getReceipt()

createReceiptCallback

public StompReceiptListener createReceiptCallback()

getTransaction

public java.lang.String getTransaction()

subscribe

public boolean subscribe()
                  throws java.io.IOException
Throws:
java.io.IOException

unsubscribe

public boolean unsubscribe(java.lang.String id)

ack

public boolean ack(java.lang.String sid,
                   long mid)

nack

public boolean nack(java.lang.String sid,
                    long mid)

begin

public boolean begin(java.lang.String tid)

commit

public boolean commit(java.lang.String tid)

abort

public boolean abort(java.lang.String tid)

handleRequest

public boolean handleRequest()
                      throws java.io.IOException
Description copied from interface: ProtocolConnection
Handles a new request. The controlling TcpServer may call handleRequest again after the connection completes, so the implementation must initialize any variables for each connection.

Specified by:
handleRequest in interface ProtocolConnection
Throws:
java.io.IOException

handleResume

public boolean handleResume()
                     throws java.io.IOException
Description copied from interface: ProtocolConnection
Handles a resumption of the connection for an async/comet request.

Specified by:
handleResume in interface ProtocolConnection
Throws:
java.io.IOException

isWaitForRead

public boolean isWaitForRead()
Description copied from interface: ProtocolConnection
Return true if the connection should wait for a read before handling the request.

Specified by:
isWaitForRead in interface ProtocolConnection

onCloseConnection

public void onCloseConnection()
Description copied from interface: ProtocolConnection
Handles a close event when the connection is closed.

Specified by:
onCloseConnection in interface ProtocolConnection

onStartConnection

public void onStartConnection()
Description copied from interface: ProtocolConnection
Called when the connection starts, i.e. just after the accept

Specified by:
onStartConnection in interface ProtocolConnection