com.j_spaces.jms
Class GSTopicSessionImpl

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

public class GSTopicSessionImpl
extends GSSessionImpl

GigaSpaces implementation of the javax.jms.TopicSession interface. A TopicSession object provides methods for creating TopicPublisher,TopicSubscriber( and TemporaryTopic) objects. It also provides a method for deleting its client's durable subscribers.

A TopicSession is used for creating Pub/Sub specific objects. In general, use the Session object, and use TopicSession only to support existing code. Using the Session object simplifies the programming model, and allows transactions to be used across the two messaging domains.

A TopicSession cannot be used to create objects specific to the point-to-point domain. The following methods inherit from Session , but must throw an IllegalStateException if used from TopicSession:


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
GSTopicSessionImpl(com.j_spaces.jms.GSConnectionImpl connection, boolean transacted, int acknowledgeMode)
          Constructs a topic session.
 
Method Summary
 QueueBrowser createBrowser(Queue arg0)
           
 QueueBrowser createBrowser(Queue arg0, String arg1)
           
 Queue createQueue(String arg0)
           
 TemporaryQueue createTemporaryQueue()
          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'.
 
Methods inherited from class com.j_spaces.jms.GSSessionImpl
close, commit, createBytesMessage, createBytesMessage, createConsumer, createConsumer, createConsumer, createDurableSubscriber, createDurableSubscriber, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createProducer, createPublisher, createReceiver, createReceiver, createSender, createStreamMessage, createSubscriber, createSubscriber, createTemporaryTopic, createTextMessage, createTextMessage, createTopic, getAcknowledgeMode, getConsumersC, getJMSProviderName, getMessageListener, getMessagesC, getNumOfConsumedMsg, getNumOfProducedMsg, getProducersC, getSessionID, getTransacted, recover, rollback, run, setConsumersC, setMessageListener, setMessagesC, setProducersC, setSessionID, toString, unsubscribe
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GSTopicSessionImpl

public GSTopicSessionImpl(com.j_spaces.jms.GSConnectionImpl connection,
                          boolean transacted,
                          int acknowledgeMode)
                   throws JMSException
Constructs a topic 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 -
Throws:
JMSException - In case of an invalid acknowledge mode.
Method Detail

createQueue

public Queue createQueue(String arg0)
                  throws JMSException
Specified by:
createQueue in interface QueueSession
Specified by:
createQueue in interface Session
Overrides:
createQueue in class GSSessionImpl
Throws:
JMSException
See Also:
Session.createQueue(java.lang.String)

createBrowser

public QueueBrowser createBrowser(Queue arg0)
                           throws JMSException
Specified by:
createBrowser in interface QueueSession
Specified by:
createBrowser in interface Session
Overrides:
createBrowser in class GSSessionImpl
Throws:
JMSException
See Also:
Session.createBrowser(javax.jms.Queue)

createBrowser

public QueueBrowser createBrowser(Queue arg0,
                                  String arg1)
                           throws JMSException
Specified by:
createBrowser in interface QueueSession
Specified by:
createBrowser in interface Session
Overrides:
createBrowser in class GSSessionImpl
Throws:
JMSException
See Also:
Session.createBrowser(javax.jms.Queue, java.lang.String)

createTemporaryQueue

public TemporaryQueue createTemporaryQueue()
                                    throws JMSException
Description copied from class: GSSessionImpl
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 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:
createTemporaryQueue in interface QueueSession
Specified by:
createTemporaryQueue in interface Session
Overrides:
createTemporaryQueue in class GSSessionImpl
Throws:
JMSException
See Also:
Session.createTemporaryQueue()