|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--org.exolab.jms.client.mipc.IpcJmsSessionStub
The client side stub implementing the JmsServerSession. All session requests are passed on to the server. This class also an IPC server connection when a listener os subscriber is set up.
Note: There is only one receive connection per client, all JmsMessages for any queue/topic that the client is interested in receiving are multiplexed on this single connection. The connection is not bi-directional, that is no replies are sent back using this connection. It is assumed that the underlying IPC protocol will confirm delivery to the client. After that it is the clients responsibility to ensure correct message processing. Durable messages are acked on a separate port, reliable messages, are not.
IpcJmsSessionConnection,
Server| Constructor Summary | |
IpcJmsSessionStub(org.exolab.core.ipc.IpcIfc connection,
java.lang.String clientId,
java.lang.String connectionId,
java.lang.String sessionId,
org.exolab.jms.client.mipc.IpcJmsMessageListener listener)
A new session has been established with these ids. |
|
| Method Summary | |
void |
acknowledgeMessage(long clientId,
java.lang.String messageId)
Extract the destination and messageId for the message and send back an ack. |
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 |
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. |
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 |
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 IpcJmsSessionStub(org.exolab.core.ipc.IpcIfc connection,
java.lang.String clientId,
java.lang.String connectionId,
java.lang.String sessionId,
org.exolab.jms.client.mipc.IpcJmsMessageListener listener)
connection - the connection to the server.clientId - this clients unique id.connectionId - this objects connection identifier.sessionId - the unique session id for this object.listener - the message dispatcher| Method Detail |
public java.lang.String getClientId()
throws javax.jms.JMSException
getClientId in interface JmsSessionStubIfcjavax.jms.JMSException - On error
public java.lang.String getSessionId()
throws javax.jms.JMSException
getSessionId in interface JmsSessionStubIfcjavax.jms.JMSException - On error
public void beforeClose()
throws javax.jms.JMSException
JmsSessionStubIfcclose, so that the
stub can do some local clean upbeforeClose in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcjavax.jms.JMSException - for any JMS error
public void close()
throws javax.jms.JMSException
close in interface JmsSessionStubIfcjavax.jms.JMSException - On error
public void acknowledgeMessage(long clientId,
java.lang.String messageId)
throws javax.jms.JMSException
acknowledgeMessage in interface JmsSessionStubIfcclientId - the identity ofthe clientmessageId - the message identity to ackjavax.jms.JMSException -
public void sendMessage(javax.jms.Message message)
throws javax.jms.JMSException
JmsSessionStubIfcsendMessage in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcmessage - the message to sendjavax.jms.JMSException - for any JMS error
public void sendMessages(java.util.Vector messages)
throws javax.jms.JMSException
JmsSessionStubIfcsendMessages in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcmessages - the messages to sendjavax.jms.JMSException - for any JMS error
public javax.jms.Message receiveMessage(long clientId,
long wait)
throws javax.jms.JMSException
JmsSessionStubIfcreceiveMessage in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcclientId - the client identitywait - the number of ms to wait. -1 means wait indefinitely.javax.jms.JMSException - for any JMS error
public java.util.Vector receiveMessages(long clientId,
int count)
throws javax.jms.JMSException
JmsSessionStubIfcreceiveMessages in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcclient - the client identitycount - max messages to returnjavax.jms.JMSException - for any JMS error
public void createQueue(JmsQueue queue)
throws javax.jms.JMSException
createQueue in interface JmsSessionStubIfcqueue - The queue to create.javax.jms.JMSException - On error
public void createTopic(JmsTopic topic)
throws javax.jms.JMSException
createTopic in interface JmsSessionStubIfctopic - The topic to create.javax.jms.JMSException - On error
public void createReceiver(JmsQueue queue,
long clientId,
java.lang.String selector)
throws javax.jms.JMSException
createReceiver in interface JmsSessionStubIfcqueue - The queue to listen toclientId - The session allocated identifierselector - The selector to filter messages (may be null)javax.jms.JMSException - On error
public void createSender(JmsQueue queue)
throws javax.jms.JMSException
createSender in interface JmsSessionStubIfcqueue - The queue to send messages tojavax.jms.JMSException - On error
public void createBrowser(JmsQueue queue,
long clientId,
java.lang.String selector)
throws javax.jms.JMSException
You cannot create more than one queue browser for the same queue in a single session.
createBrowser in interface JmsSessionStubIfcqueue - queue to browseclientId - idenity of the clientselector - message selector. This may be nulljavax.jms.JMSException -
public void deleteReceiver(long clientId)
throws javax.jms.JMSException
deleteReceiver in interface JmsSessionStubIfcclientId - The id of the client to deletejavax.jms.JMSException - On error
public void deleteBrowser(long clientId)
throws javax.jms.JMSException
deleteBrowser in interface JmsSessionStubIfcclientId - identity of the browserjavax.jms.JMSException -
public void createSubscriber(JmsTopic topic,
java.lang.String name,
long clientId,
java.lang.String selector,
boolean noLocal)
throws javax.jms.JMSException
createSubscriber in interface JmsSessionStubIfctopic - The topic to subscribe toname - The subscribers nameclient - The client identityselector - The selector to filter messages (may be null)javax.jms.JMSException - On error
public void createPublisher(JmsTopic topic)
throws javax.jms.JMSException
createPublisher in interface JmsSessionStubIfctopic - The topic to publish tojavax.jms.JMSException - On error
public void unsubscribe(java.lang.String name)
throws javax.jms.JMSException
unsubscribe in interface JmsSessionStubIfcname - the name used to identify the
subscriptionjavax.jms.JMSException - if the subscription cannot be removed
public void deleteSubscriber(long clientId)
throws javax.jms.JMSException
deleteSubscriber in interface JmsSessionStubIfcclientId - - the client identityjavax.jms.JMSException - On error
public void stopMessageDelivery()
throws javax.jms.JMSException
stopMessageDelivery in interface JmsSessionStubIfcjavax.jms.JMSException - On error
public void startMessageDelivery()
throws javax.jms.JMSException
startMessageDelivery in interface JmsSessionStubIfcjavax.jms.JMSException - On error
public void recover()
throws javax.jms.JMSException
JmsSessionStubIfcrecover in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcjavax.jms.JMSException - if the session cannot be recovered
public void commit()
throws javax.jms.JMSException
JmsSessionStubIfccommit in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcjavax.jms.JMSException - if the session cannot be committed
public void rollback()
throws javax.jms.JMSException
JmsSessionStubIfcrollback in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcjavax.jms.JMSException - if the session cannot be rolled back
public void commit(javax.transaction.xa.Xid xid,
boolean onePhase)
throws javax.transaction.xa.XAException
JmsSessionStubIfccommit in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcxid - the xa transaction identityonePhase - true if it is a one phase commitjavax.transaction.xa.XAException - if there is a problem completing the call
public void end(javax.transaction.xa.Xid xid,
int flags)
throws javax.transaction.xa.XAException
JmsSessionStubIfcend in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcxid - the xa transaction identityflags - one of TMSUCCESS, TMFAIL, or TMSUSPENDjavax.transaction.xa.XAException - if there is a problem completing the call
public void forget(javax.transaction.xa.Xid xid)
throws javax.transaction.xa.XAException
JmsSessionStubIfcforget in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcxid - the xa transaction identityjavax.transaction.xa.XAException - if there is a problem completing the call
public java.lang.String getResourceManagerId()
throws javax.transaction.xa.XAException
JmsSessionStubIfcgetResourceManagerId in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcjavax.transaction.xa.XAException - if there is a problem completing the call
public int getTransactionTimeout()
throws javax.transaction.xa.XAException
JmsSessionStubIfcgetTransactionTimeout in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcjavax.transaction.xa.XAException - if there is a problem completing the call
public int prepare(javax.transaction.xa.Xid xid)
throws javax.transaction.xa.XAException
JmsSessionStubIfcprepare in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcxid - the xa transaction identityjavax.transaction.xa.XAException - if there is a problem completing the call
public javax.transaction.xa.Xid[] recover(int flag)
throws javax.transaction.xa.XAException
JmsSessionStubIfcrecover in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcflag - One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGSjavax.transaction.xa.XAException - - if there is a problem completing the call
public void rollback(javax.transaction.xa.Xid xid)
throws javax.transaction.xa.XAException
JmsSessionStubIfcrollback in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcxid - the xa transaction identityjavax.transaction.xa.XAException - if there is a problem completing the call
public boolean setTransactionTimeout(int seconds)
throws javax.transaction.xa.XAException
JmsSessionStubIfcsetTransactionTimeout in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcseconds - timeout in secondsjavax.transaction.xa.XAException - if there is a problem completing the call
public void start(javax.transaction.xa.Xid xid,
int flags)
throws javax.transaction.xa.XAException
JmsSessionStubIfcstart in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcxid - the xa transaction identityflags - One of TMNOFLAGS, TMJOIN, or TMRESUMEjavax.transaction.xa.XAException - if there is a problem completing the callpublic void setMessageListener(JmsMessageListener listener)
setMessageListener in interface JmsSessionStubIfclistener - A reference to the client listener.
public void enableAsynchronousDelivery(long clientId,
java.lang.String id,
boolean enable)
throws javax.jms.JMSException
JmsSessionStubIfcenableAsynchronousDelivery in interface JmsSessionStubIfcorg.exolab.jms.client.JmsSessionStubIfcclientId - 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 error
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||