|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.client.http.HttpJmsSessionStub
The client side stub implementing the JmsServerSession. All session requests are passed on to the server.
HttpClient
Constructor Summary | |
HttpJmsSessionStub(org.exolab.core.ipc.IpcIfc connection,
java.lang.String clientId,
java.lang.String connectionId,
java.lang.String sessionId)
A new session has been established with these ids. |
Method Summary | |
void |
acknowledgeMessage(long clientId,
java.lang.String messageId)
Acknowledge a message |
void |
beforeClose()
This method is called before the call to close , so that the
stub can do some local clean up |
void |
close()
Close this session. |
void |
commit()
Commit the session which will send all the published messages and acknowledge all received messages |
void |
commit(javax.transaction.xa.Xid xid,
boolean onePhase)
Commits an XA transaction that is in progress. |
void |
createBrowser(JmsQueue queue,
long clientId,
java.lang.String selector)
Create a queue browser for this session. |
void |
createPublisher(JmsTopic topic)
Create a new topic publisher |
void |
createQueue(JmsQueue queue)
Create a new queue |
void |
createReceiver(JmsQueue queue,
long clientId,
java.lang.String selector)
Create a receiver. |
void |
createSender(JmsQueue queue)
Create a queue sender |
void |
createSubscriber(JmsTopic topic,
java.lang.String name,
long clientId,
java.lang.String selector,
boolean noLocal)
Create a new topic subscriber |
void |
createTopic(JmsTopic topic)
Create a new topic |
void |
deleteBrowser(long clientId)
Delete the queue browser associated with the specified queue from the session. |
void |
deleteReceiver(long clientId)
Delete the receiver for this queue. |
void |
deleteSubscriber(long clientId)
Delete the subscriber for this topic |
void |
disconnection(java.lang.String id)
A client has disconnected. |
void |
enableAsynchronousDelivery(long clientId,
java.lang.String id,
boolean enable)
Enable or disable asynchronous message delivery for a particular consumer |
void |
end(javax.transaction.xa.Xid xid,
int flags)
Ends the work performed on behalf of a transaction branch. |
void |
forget(javax.transaction.xa.Xid xid)
Tell the resource manager to forget about a heuristically completed transaction branch. |
java.lang.String |
getClientId()
Get the client Id |
java.lang.String |
getResourceManagerId()
Return the identity of the associated resource manager. |
java.lang.String |
getSessionId()
Get the sessionId |
int |
getTransactionTimeout()
Return the transaction timeout for this instance of the resource manager. |
java.io.Serializable |
notify(java.lang.Object ob,
java.lang.String id)
A message has been received. |
int |
prepare(javax.transaction.xa.Xid xid)
Ask the resource manager to prepare for a transaction commit of the transaction specified in xid |
javax.jms.Message |
receiveMessage(long clientId,
long wait)
Return the next message for the specified client. |
java.util.Vector |
receiveMessages(long clientId,
int count)
Return a collection of messages from the specified client upto the nominated count. |
void |
recover()
Recover the session. |
javax.transaction.xa.Xid[] |
recover(int flag)
Obtain a list of prepared transaction branches from a resource manager. |
void |
rollback()
Rollback the session, which will not acknowledge any of the sent messages |
void |
rollback(javax.transaction.xa.Xid xid)
Inform the resource manager to roll back work done on behalf of a transaction branch |
void |
sendMessage(javax.jms.Message message)
Send the specified message to the server. |
void |
sendMessages(java.util.Vector messages)
Send the specified messages to the server. |
void |
setMessageListener(JmsMessageListener listener)
Set a message listener to be called when new Messages arrive from the server. |
boolean |
setTransactionTimeout(int seconds)
Set the current transaction timeout value for this XAResource instance. |
void |
start(javax.transaction.xa.Xid xid,
int flags)
Start work on behalf of a transaction branch specified in xid If TMJOIN is specified, the start is for joining a transaction previously seen by the resource manager |
void |
startMessageDelivery()
Start message delivery for this session. |
void |
stopMessageDelivery()
Stop message delivery for this session. |
void |
stopReceiver()
Stop the message receiver thread. |
void |
unsubscribe(java.lang.String name)
Unsubscribe a durable subscription |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HttpJmsSessionStub(org.exolab.core.ipc.IpcIfc connection, java.lang.String clientId, java.lang.String connectionId, java.lang.String sessionId)
connection
- The http connection to the server.clientId
- This clients unique id.connectionId
- This objects connection identifier.sessionId
- The unique session id for this object.Method Detail |
public java.lang.String getClientId()
getClientId
in interface JmsSessionStubIfc
public java.lang.String getSessionId()
getSessionId
in interface JmsSessionStubIfc
public void beforeClose() throws javax.jms.JMSException
JmsSessionStubIfc
close
, so that the
stub can do some local clean upbeforeClose
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
javax.jms.JMSException
- for any JMS errorpublic void close() throws javax.jms.JMSException
close
in interface JmsSessionStubIfc
javax.jms.JMSException
- if the close failspublic void acknowledgeMessage(long clientId, java.lang.String messageId) throws javax.jms.JMSException
acknowledgeMessage
in interface JmsSessionStubIfc
clientId
- the identity of the clientmessageId
- the message identity to ackjavax.jms.JMSException
- if the message can't be acknowledgedpublic void sendMessage(javax.jms.Message message) throws javax.jms.JMSException
JmsSessionStubIfc
sendMessage
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
message
- the message to sendjavax.jms.JMSException
- for any JMS errorpublic void sendMessages(java.util.Vector messages) throws javax.jms.JMSException
JmsSessionStubIfc
sendMessages
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
messages
- the messages to sendjavax.jms.JMSException
- for any JMS errorpublic javax.jms.Message receiveMessage(long clientId, long wait) throws javax.jms.JMSException
JmsSessionStubIfc
receiveMessage
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
clientId
- the client identitywait
- the number of ms to wait. -1 means wait indefinitely.javax.jms.JMSException
- for any JMS errorpublic java.util.Vector receiveMessages(long clientId, int count) throws javax.jms.JMSException
JmsSessionStubIfc
receiveMessages
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
client
- the client identitycount
- max messages to returnjavax.jms.JMSException
- for any JMS errorpublic void createQueue(JmsQueue queue) throws javax.jms.JMSException
createQueue
in interface JmsSessionStubIfc
topic
- the queue to createjavax.jms.JMSException
- if the queue can't be createdpublic void createTopic(JmsTopic topic) throws javax.jms.JMSException
createTopic
in interface JmsSessionStubIfc
topic
- the topic to createjavax.jms.JMSException
- if the topic can't be createdpublic void createReceiver(JmsQueue queue, long clientId, java.lang.String selector) throws javax.jms.JMSException
createReceiver
in interface JmsSessionStubIfc
queue
- the queue to listen toclientId
- the session allocated identifierselector
- the selector to filter messages (may be null)javax.jms.JMSException
- if the receiver cannot be createdpublic void createSender(JmsQueue queue) throws javax.jms.JMSException
createSender
in interface JmsSessionStubIfc
queue
- the queue to send messages tojavax.jms.JMSException
- if the sender cannot be createdpublic void createBrowser(JmsQueue queue, long clientId, java.lang.String selector) throws javax.jms.JMSException
createBrowser
in interface JmsSessionStubIfc
queue
- the queue to browseclientId
- the identity of the clientselector
- the message selector. May be nulljavax.jms.JMSException
- if the browser can't be createdpublic void deleteReceiver(long clientId) throws javax.jms.JMSException
deleteReceiver
in interface JmsSessionStubIfc
clientId
- the id of the client to deletejavax.jms.JMSException
- if the receiver cannot be deletedpublic void deleteBrowser(long clientId) throws javax.jms.JMSException
deleteBrowser
in interface JmsSessionStubIfc
clientId
- the identity of the browserjavax.jms.JMSException
- if the browser cannot be deletedpublic void createSubscriber(JmsTopic topic, java.lang.String name, long clientId, java.lang.String selector, boolean noLocal) throws javax.jms.JMSException
createSubscriber
in interface JmsSessionStubIfc
topic
- the topic to subscribe toname
- the subscribers nameclient
- the client identityselector
- the selector to filter messages (may be null)javax.jms.JMSException
- if the topic subscriber can't be createdpublic void createPublisher(JmsTopic topic) throws javax.jms.JMSException
createPublisher
in interface JmsSessionStubIfc
topic
- the topic to publish tojavax.jms.JMSException
- if the publisher can't be createdpublic void unsubscribe(java.lang.String name) throws javax.jms.JMSException
unsubscribe
in interface JmsSessionStubIfc
name
- the name used to identify the subscriptionjavax.jms.JMSException
- if the subscription cannot be removedpublic void deleteSubscriber(long clientId) throws javax.jms.JMSException
deleteSubscriber
in interface JmsSessionStubIfc
clientId
- the client identityjavax.jms.JMSException
- for any errorpublic void stopMessageDelivery() throws javax.jms.JMSException
stopMessageDelivery
in interface JmsSessionStubIfc
javax.jms.JMSException
- for any errorpublic void startMessageDelivery() throws javax.jms.JMSException
startMessageDelivery
in interface JmsSessionStubIfc
javax.jms.JMSException
- for any errorpublic void recover() throws javax.jms.JMSException
JmsSessionStubIfc
recover
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
javax.jms.JMSException
- if the session cannot be recoveredpublic void commit() throws javax.jms.JMSException
JmsSessionStubIfc
commit
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
javax.jms.JMSException
- if the session cannot be committedpublic void rollback() throws javax.jms.JMSException
JmsSessionStubIfc
rollback
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
javax.jms.JMSException
- if the session cannot be rolled backpublic void commit(javax.transaction.xa.Xid xid, boolean onePhase) throws javax.transaction.xa.XAException
JmsSessionStubIfc
commit
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
xid
- the xa transaction identityonePhase
- true if it is a one phase commitjavax.transaction.xa.XAException
- if there is a problem completing the callpublic void end(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
JmsSessionStubIfc
end
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
xid
- the xa transaction identityflags
- one of TMSUCCESS, TMFAIL, or TMSUSPENDjavax.transaction.xa.XAException
- if there is a problem completing the callpublic void forget(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
JmsSessionStubIfc
forget
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
xid
- the xa transaction identityjavax.transaction.xa.XAException
- if there is a problem completing the callpublic int getTransactionTimeout() throws javax.transaction.xa.XAException
JmsSessionStubIfc
getTransactionTimeout
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
javax.transaction.xa.XAException
- if there is a problem completing the callpublic int prepare(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
JmsSessionStubIfc
prepare
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
xid
- the xa transaction identityjavax.transaction.xa.XAException
- if there is a problem completing the callpublic javax.transaction.xa.Xid[] recover(int flag) throws javax.transaction.xa.XAException
JmsSessionStubIfc
recover
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
flag
- One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGSjavax.transaction.xa.XAException
- - if there is a problem completing the callpublic void rollback(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
JmsSessionStubIfc
rollback
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
xid
- the xa transaction identityjavax.transaction.xa.XAException
- if there is a problem completing the callpublic boolean setTransactionTimeout(int seconds) throws javax.transaction.xa.XAException
JmsSessionStubIfc
setTransactionTimeout
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
seconds
- timeout in secondsjavax.transaction.xa.XAException
- if there is a problem completing the callpublic void start(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
JmsSessionStubIfc
start
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
xid
- the xa transaction identityflags
- One of TMNOFLAGS, TMJOIN, or TMRESUMEjavax.transaction.xa.XAException
- if there is a problem completing the callpublic java.lang.String getResourceManagerId() throws javax.transaction.xa.XAException
JmsSessionStubIfc
getResourceManagerId
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
javax.transaction.xa.XAException
- if there is a problem completing the callpublic void setMessageListener(JmsMessageListener listener)
setMessageListener
in interface JmsSessionStubIfc
listener
- A reference to the client listener.public void enableAsynchronousDelivery(long clientId, java.lang.String id, boolean enable) throws javax.jms.JMSException
JmsSessionStubIfc
enableAsynchronousDelivery
in interface JmsSessionStubIfc
org.exolab.jms.client.JmsSessionStubIfc
clientId
- the id of the client to checkid
- the message id of the last delivered messageenable
- true to enable; false to disablejavax.jms.JMSException
- for any JMS errorpublic void stopReceiver()
public java.io.Serializable notify(java.lang.Object ob, java.lang.String id)
notify
in interface org.exolab.core.ipc.NotifierIfc
ob
- The data received,id
- The connection id this data is received frompublic void disconnection(java.lang.String id)
disconnection
in interface org.exolab.core.ipc.NotifierIfc
The
- unique identifier of this connection.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |