public class GSQueueSessionImpl extends GSSessionImpl
javax.jms.QueueSession interface.
A QueueSession object provides methods for creating QueueReceiver,
QueueSender, TBD -- QueueBrowser, and TemporaryQueue
objects.
If there are messages that have been received but not acknowledged when a
QueueSession terminates, these messages will be retained and redelivered when a
consumer next accesses the queue.
A QueueSession is used for creating Point-to-Point specific objects. In general,
use the Session object. The QueueSession is used to support existing
code. Using the Session object simplifies the programming model, and allows
transactions to be used across the two messaging domains.
A QueueSession cannot be used to create objects specific to the publish/subscribe
domain. The following methods inherit from Session, but must throw an
IllegalStateException if they are used from QueueSession:
createDurableSubscriber createTemporaryTopic
createTopic unsubscribe Session,
QueueConnection.createQueueSession(boolean, int),
XAQueueSession.getQueueSession()_tx, m_browsers, m_closed, m_closing, m_consumers, m_isQueue, m_producers, m_stopped, sentMessages, txLeaseTime, unackedMessages| Constructor and Description |
|---|
GSQueueSessionImpl(com.j_spaces.jms.GSConnectionImpl connection,
boolean transacted,
int acknowledgeMode)
Constructs a queue session.
|
| Modifier and Type | Method and Description |
|---|---|
javax.jms.TopicSubscriber |
createDurableSubscriber(javax.jms.Topic topic,
String name)
API method.
|
javax.jms.TopicSubscriber |
createDurableSubscriber(javax.jms.Topic topic,
String name,
String selector,
boolean noLocal)
API method.
|
javax.jms.TemporaryTopic |
createTemporaryTopic()
Creates a
TemporaryTopic object. |
javax.jms.Topic |
createTopic(String topicName)
API method.
|
void |
unsubscribe(String name)
API method.
|
addBrowser, addConsumer, addProducer, close, commit, createBrowser, createBrowser, createBytesMessage, createBytesMessage, createConsumer, createConsumer, createConsumer, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createProducer, createPublisher, createQueue, createReceiver, createReceiver, createSender, createStreamMessage, createSubscriber, createSubscriber, createTemporaryQueue, createTextMessage, createTextMessage, ensureTX, getAcknowledgeMode, getConn, getConsumersC, getJMSProviderName, getMessageListener, getMessagesC, getNumOfConsumedMsg, getNumOfProducedMsg, getProducersC, getRandomInt, getSessionID, getTransacted, getTransaction, isClosed, recover, removeBrower, removeConsumer, removeProducer, rollback, run, setConsumersC, setMessageListener, setMessagesC, setProducersC, setSessionID, toStringpublic GSQueueSessionImpl(com.j_spaces.jms.GSConnectionImpl connection,
boolean transacted,
int acknowledgeMode)
throws javax.jms.JMSException
connection - The connection the session belongs to.transacted - true for a transacted session.acknowledgeMode - 1 (auto), 2 (client) or 3 (dups ok).javax.jms.JMSException - In case of an invalid acknowledge mode.public javax.jms.TemporaryTopic createTemporaryTopic()
throws javax.jms.JMSException
GSSessionImplTemporaryTopic object. Its lifetime will be that of the
TopicConnection unless it is deleted earlier.
We use the same space proxy we obtained in the session and we write another External Entry,
which will have a class name of 'TempQueue_ < >.
The only message m_consumers that can consume from a temporary destination are those created
by the same connection that created the destination. Any message producer can send to the
temporary destination. If you close the connection that a temporary destination belongs to,
the destination is closed and its contents lost. You can use temporary destinations to
implement a simple request/reply mechanism. If you create a temporary destination and specify
it as the value of the JMSReplyTo message header field when you send a message, the consumer
of the message can use the value of the JMSReplyTo field as the destination to which it sends
a reply and can also reference the original request by setting the JMSCorrelationID header
field of the reply message to the value of the JMSMessageID header field of the request.createTemporaryTopic in interface javax.jms.SessioncreateTemporaryTopic in interface javax.jms.TopicSessioncreateTemporaryTopic in class GSSessionImpljavax.jms.JMSExceptionSession.createTemporaryQueue()public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic,
String name,
String selector,
boolean noLocal)
throws javax.jms.JMSException
createDurableSubscriber in interface javax.jms.SessioncreateDurableSubscriber in interface javax.jms.TopicSessioncreateDurableSubscriber in class GSSessionImpljavax.jms.IllegalStateException - Systematically.javax.jms.JMSExceptionSession.createDurableSubscriber(Topic, String, String, boolean)public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic,
String name)
throws javax.jms.JMSException
createDurableSubscriber in interface javax.jms.SessioncreateDurableSubscriber in interface javax.jms.TopicSessioncreateDurableSubscriber in class GSSessionImpljavax.jms.IllegalStateException - Systematically.javax.jms.JMSExceptionSession.createDurableSubscriber(Topic, String)public javax.jms.Topic createTopic(String topicName) throws javax.jms.JMSException
createTopic in interface javax.jms.SessioncreateTopic in interface javax.jms.TopicSessioncreateTopic in class GSSessionImpljavax.jms.IllegalStateException - Systematically.javax.jms.JMSExceptionSession.createTopic(String)public void unsubscribe(String name) throws javax.jms.JMSException
unsubscribe in interface javax.jms.Sessionunsubscribe in interface javax.jms.TopicSessionunsubscribe in class GSSessionImpljavax.jms.IllegalStateException - Systematically.javax.jms.JMSExceptionSession.unsubscribe(String)Copyright © GigaSpaces.