com.j_spaces.jms
Class GSQueueSessionImpl

java.lang.Object
  extended by com.j_spaces.jms.GSSessionImpl
      extended by com.j_spaces.jms.GSQueueSessionImpl
All Implemented Interfaces:
Runnable, QueueSession, Session, TopicSession

public class GSQueueSessionImpl
extends GSSessionImpl

GigaSpaces implementation of the 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:

See Also:
Session, QueueConnection.createQueueSession(boolean, int), XAQueueSession.getQueueSession()

Field Summary
 
Fields inherited from class com.j_spaces.jms.GSSessionImpl
txLeaseTime
 
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
 
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
 
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
 
Constructor Summary
GSQueueSessionImpl(com.j_spaces.jms.GSConnectionImpl connection, boolean transacted, int acknowledgeMode)
          Constructs a queue session.
 
Method Summary
 TopicSubscriber createDurableSubscriber(Topic topic, String name)
          API method.
 TopicSubscriber createDurableSubscriber(Topic topic, String name, String selector, boolean noLocal)
          API method.
 TemporaryTopic createTemporaryTopic()
          Creates a TemporaryTopic object.
 Topic createTopic(String topicName)
          API method.
 void unsubscribe(String name)
          API method.
 
Methods inherited from class com.j_spaces.jms.GSSessionImpl
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, getAcknowledgeMode, getConsumersC, getJMSProviderName, getMessageListener, getMessagesC, getNumOfConsumedMsg, getNumOfProducedMsg, getProducersC, getSessionID, getTransacted, recover, rollback, run, setConsumersC, setMessageListener, setMessagesC, setProducersC, setSessionID, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GSQueueSessionImpl

public GSQueueSessionImpl(com.j_spaces.jms.GSConnectionImpl connection,
                          boolean transacted,
                          int acknowledgeMode)
                   throws JMSException
Constructs a queue session.

Parameters:
connection - The connection the session belongs to.
transacted - true for a transacted session.
acknowledgeMode - 1 (auto), 2 (client) or 3 (dups ok).
transaction - transaction
Throws:
JMSException - In case of an invalid acknowledge mode.
Method Detail

createTemporaryTopic

public TemporaryTopic createTemporaryTopic()
                                    throws JMSException
Description copied from class: GSSessionImpl
Creates a TemporaryTopic 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.

Specified by:
createTemporaryTopic in interface Session
Specified by:
createTemporaryTopic in interface TopicSession
Overrides:
createTemporaryTopic in class GSSessionImpl
Throws:
JMSException
See Also:
Session.createTemporaryQueue()

createDurableSubscriber

public TopicSubscriber createDurableSubscriber(Topic topic,
                                               String name,
                                               String selector,
                                               boolean noLocal)
                                        throws JMSException
API method.

Specified by:
createDurableSubscriber in interface Session
Specified by:
createDurableSubscriber in interface TopicSession
Overrides:
createDurableSubscriber in class GSSessionImpl
Throws:
IllegalStateException - Systematically.
JMSException
See Also:
Session.createDurableSubscriber(Topic, String, String, boolean)

createDurableSubscriber

public TopicSubscriber createDurableSubscriber(Topic topic,
                                               String name)
                                        throws JMSException
API method.

Specified by:
createDurableSubscriber in interface Session
Specified by:
createDurableSubscriber in interface TopicSession
Overrides:
createDurableSubscriber in class GSSessionImpl
Throws:
IllegalStateException - Systematically.
JMSException
See Also:
Session.createDurableSubscriber(Topic, String)

createTopic

public Topic createTopic(String topicName)
                  throws JMSException
API method.

Specified by:
createTopic in interface Session
Specified by:
createTopic in interface TopicSession
Overrides:
createTopic in class GSSessionImpl
Throws:
IllegalStateException - Systematically.
JMSException
See Also:
Session.createTopic(java.lang.String)

unsubscribe

public void unsubscribe(String name)
                 throws JMSException
API method.

Specified by:
unsubscribe in interface Session
Specified by:
unsubscribe in interface TopicSession
Overrides:
unsubscribe in class GSSessionImpl
Throws:
IllegalStateException - Systematically.
JMSException
See Also:
Session.unsubscribe(String)