|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jrun.jms.core.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.
org.exolab.jms.server.mipc.IpcJmsSessionConnection,
org.exolab.core.ipc.Server| Constructor Summary | |
IpcJmsSessionStub(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)
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(java.lang.String[] ids)
Commit messages on the session which will send all specified published messages and acknowledge all specified received messages |
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,
long id,
boolean enable)
Enable or disable asynchronous message delivery for a particular consumer |
java.lang.String |
getClientId()
Get the client Id |
protected Logger |
getLogger()
Return a reference to the logger |
java.lang.String |
getSessionId()
Get the sessionId |
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. |
void |
rollback()
Rollback the session, which will not acknowledge any of the sent messages |
void |
rollback(java.lang.String[] ids)
Rollback messages on the session, which will not acknowledge any of the specified sent messages |
void |
run()
This is called when we start up an inbound message pump in a a separate thread. |
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. |
void |
startMessageDelivery()
Start message delivery for this session. |
void |
stopMessageDelivery()
Stop message delivery for this session. |
static 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 IpcJmsSessionStub(IpcIfc connection,
java.lang.String clientId,
java.lang.String connectionId,
java.lang.String sessionId)
connection - The ipc 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()
throws javax.jms.JMSException
getClientId in interface JmsSessionStubIfcJMSException - On error
public java.lang.String getSessionId()
throws javax.jms.JMSException
getSessionId in interface JmsSessionStubIfcJMSException - On error
public void beforeClose()
throws javax.jms.JMSException
JmsSessionStubIfcclose, so that the
stub can do some local clean upbeforeClose in interface JmsSessionStubIfcjrun.jms.core.client.JmsSessionStubIfcJMSException -
public void close()
throws javax.jms.JMSException
close in interface JmsSessionStubIfcJMSException - 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 ackJMSException -
public void sendMessage(javax.jms.Message message)
throws javax.jms.JMSException
JmsSessionStubIfcsendMessage in interface JmsSessionStubIfcjrun.jms.core.client.JmsSessionStubIfcmessage - message to sendJMSException -
public void sendMessages(java.util.Vector messages)
throws javax.jms.JMSException
JmsSessionStubIfcsendMessages in interface JmsSessionStubIfcjrun.jms.core.client.JmsSessionStubIfcmessages - - messages to sendJMSException -
public javax.jms.Message receiveMessage(long clientId,
long wait)
throws javax.jms.JMSException
JmsSessionStubIfcreceiveMessage in interface JmsSessionStubIfcjrun.jms.core.client.JmsSessionStubIfcclient - the client identitywait - the number of ms to wait. -1
means wait indefinitely.
public java.util.Vector receiveMessages(long clientId,
int count)
throws javax.jms.JMSException
JmsSessionStubIfcreceiveMessages in interface JmsSessionStubIfcjrun.jms.core.client.JmsSessionStubIfcclient - the client identitycount - max messages to returnJMSException -
public void createQueue(JmsQueue queue)
throws javax.jms.JMSException
createQueue in interface JmsSessionStubIfcqueue - The queue to create.JMSException - On error
public void createTopic(JmsTopic topic)
throws javax.jms.JMSException
createTopic in interface JmsSessionStubIfctopic - The topic to create.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)JMSException - On error
public void createSender(JmsQueue queue)
throws javax.jms.JMSException
createSender in interface JmsSessionStubIfcqueue - The queue to send messages toJMSException - 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 nullJMSException -
public void deleteReceiver(long clientId)
throws javax.jms.JMSException
deleteReceiver in interface JmsSessionStubIfcclientId - The id of the client to deleteJMSException - On error
public void deleteBrowser(long clientId)
throws javax.jms.JMSException
deleteBrowser in interface JmsSessionStubIfcclientId - identity of the browserJMSException -
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)JMSException - On error
public void createPublisher(JmsTopic topic)
throws javax.jms.JMSException
createPublisher in interface JmsSessionStubIfctopic - The topic to publish toJMSException - On error
public void unsubscribe(java.lang.String name)
throws javax.jms.JMSException
unsubscribe in interface JmsSessionStubIfcname - the name used to identify the
subscriptionJMSException - if the subscription cannot be removed
public void deleteSubscriber(long clientId)
throws javax.jms.JMSException
deleteSubscriber in interface JmsSessionStubIfcclientId - - the client identityJMSException - On error
public void stopMessageDelivery()
throws javax.jms.JMSException
stopMessageDelivery in interface JmsSessionStubIfcJMSException - On error
public void startMessageDelivery()
throws javax.jms.JMSException
startMessageDelivery in interface JmsSessionStubIfcJMSException - On error
public void recover()
throws javax.jms.JMSException
JmsSessionStubIfcrecover in interface JmsSessionStubIfcjrun.jms.core.client.JmsSessionStubIfcJMSException - - if we are unable to recover
public void commit(java.lang.String[] ids)
throws javax.jms.JMSException
JmsSessionStubIfccommit in interface JmsSessionStubIfcjrun.jms.core.client.JmsSessionStubIfcJMSException - - if we cannot commit the session
public void commit()
throws javax.jms.JMSException
JmsSessionStubIfccommit in interface JmsSessionStubIfcjrun.jms.core.client.JmsSessionStubIfcJMSException - - if we cannot commit the session
public void rollback(java.lang.String[] ids)
throws javax.jms.JMSException
JmsSessionStubIfcrollback in interface JmsSessionStubIfcjrun.jms.core.client.JmsSessionStubIfcJMSException - - if there is an error with this operation
public void rollback()
throws javax.jms.JMSException
JmsSessionStubIfcrollback in interface JmsSessionStubIfcjrun.jms.core.client.JmsSessionStubIfcJMSException - - if there is an error with this operationpublic void setMessageListener(JmsMessageListener listener)
setMessageListener in interface JmsSessionStubIfclistener - A reference to the client listener.JMSException - On error
public void enableAsynchronousDelivery(long clientId,
long id,
boolean enable)
throws javax.jms.JMSException
JmsSessionStubIfcenableAsynchronousDelivery in interface JmsSessionStubIfcjrun.jms.core.client.JmsSessionStubIfcclientId - - the id of the client to checkid - - the message id of the last delivered messageenable - - true to enable; false to disable
public static void stopReceiver()
throws javax.jms.JMSException
JMSException - If the IpcConnection cannot be createdpublic void run()
run in interface java.lang.Runnableprotected Logger getLogger()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||