net.sf.dropboxmq.sessions
Class TopicSessionImpl

java.lang.Object
  extended by net.sf.dropboxmq.sessions.SessionImpl
      extended by net.sf.dropboxmq.sessions.TopicSessionImpl
All Implemented Interfaces:
Runnable, Session, TopicSession

public class TopicSessionImpl
extends SessionImpl
implements TopicSession

Created: 10 Mar 2006

Version:
$Revision: 211 $, $Date: 2010-11-14 14:21:24 -0700 (Sun, 14 Nov 2010) $
Author:
Dwayne Schultz

Field Summary
 
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
 
Constructor Summary
TopicSessionImpl(DropboxTransaction dropboxTransaction, ConnectionImpl connection, Configuration configuration)
           
TopicSessionImpl(SessionImpl realSession)
           
 
Method Summary
 QueueBrowser createBrowser(Queue queue)
          Creates a QueueBrowser object to peek at the messages on the specified queue.
 QueueBrowser createBrowser(Queue queue, String messageSelector)
          Creates a QueueBrowser object to peek at the messages on the specified queue using a message selector.
 TopicPublisher createPublisher(Topic topic)
          Creates a publisher for the specified topic.
 Queue createQueue(String queueName)
          Creates a queue identity given a Queue name.
 TopicSubscriber createSubscriber(Topic topic)
          Creates a nondurable subscriber to the specified topic.
 TopicSubscriber createSubscriber(Topic topic, String messageSelector, boolean noLocal)
          Creates a nondurable subscriber to the specified topic, using a message selector or specifying whether messages published by its own connection should be delivered to it.
 TemporaryQueue createTemporaryQueue()
          Creates a TemporaryQueue object.
 
Methods inherited from class net.sf.dropboxmq.sessions.SessionImpl
acknowledge, addMessageConsumer, checkClosed, close, commit, createBytesMessage, createConsumer, createConsumer, createConsumer, createDurableSubscriber, createDurableSubscriber, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createProducer, createStreamMessage, createTemporaryTopic, createTextMessage, createTextMessage, createTopic, getAcknowledgeMode, getAcknowledgeModeString, getConfiguration, getConnection, getDropboxTransaction, getMessageListener, getNewID, getTransacted, newDropbox, recover, removeMessageConsumer, rollback, rollbackReparentingFromChild, run, setEndpointConsumer, setMessageListener, start, startReparentingMessageToChild, stop, toObjectString, toString, unsubscribe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.jms.TopicSession
createDurableSubscriber, createDurableSubscriber, createTemporaryTopic, createTopic, unsubscribe
 
Methods inherited from interface javax.jms.Session
close, commit, createBytesMessage, createConsumer, createConsumer, createConsumer, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createProducer, createStreamMessage, createTextMessage, createTextMessage, getAcknowledgeMode, getMessageListener, getTransacted, recover, rollback, run, setMessageListener
 

Constructor Detail

TopicSessionImpl

public TopicSessionImpl(SessionImpl realSession)

TopicSessionImpl

public TopicSessionImpl(DropboxTransaction dropboxTransaction,
                        ConnectionImpl connection,
                        Configuration configuration)
Method Detail

createSubscriber

public TopicSubscriber createSubscriber(Topic topic)
                                 throws JMSException
Description copied from interface: javax.jms.TopicSession
Creates a nondurable subscriber to the specified topic.

A client uses a TopicSubscriber object to receive messages that have been published to a topic.

Regular TopicSubscriber objects are not durable. They receive only messages that are published while they are active.

In some cases, a connection may both publish and subscribe to a topic. The subscriber NoLocal attribute allows a subscriber to inhibit the delivery of messages published by its own connection. The default value for this attribute is false.

Specified by:
createSubscriber in interface TopicSession
Parameters:
topic - the Topic to subscribe to
Throws:
JMSException - if the session fails to create a subscriber due to some internal error.

createSubscriber

public TopicSubscriber createSubscriber(Topic topic,
                                        String messageSelector,
                                        boolean noLocal)
                                 throws JMSException
Description copied from interface: javax.jms.TopicSession
Creates a nondurable subscriber to the specified topic, using a message selector or specifying whether messages published by its own connection should be delivered to it.

A client uses a TopicSubscriber object to receive messages that have been published to a topic.

Regular TopicSubscriber objects are not durable. They receive only messages that are published while they are active.

Messages filtered out by a subscriber's message selector will never be delivered to the subscriber. From the subscriber's perspective, they do not exist.

In some cases, a connection may both publish and subscribe to a topic. The subscriber NoLocal attribute allows a subscriber to inhibit the delivery of messages published by its own connection. The default value for this attribute is false.

Specified by:
createSubscriber in interface TopicSession
Parameters:
topic - the Topic to subscribe to
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
noLocal - if set, inhibits the delivery of messages published by its own connection
Throws:
JMSException - if the session fails to create a subscriber due to some internal error.
InvalidSelectorException - if the message selector is invalid.

createPublisher

public TopicPublisher createPublisher(Topic topic)
                               throws JMSException
Description copied from interface: javax.jms.TopicSession
Creates a publisher for the specified topic.

A client uses a TopicPublisher object to publish messages on a topic. Each time a client creates a TopicPublisher on a topic, it defines a new sequence of messages that have no ordering relationship with the messages it has previously sent.

Specified by:
createPublisher in interface TopicSession
Parameters:
topic - the Topic to publish to, or null if this is an unidentified producer
Throws:
JMSException - if the session fails to create a publisher due to some internal error.

createQueue

public Queue createQueue(String queueName)
                  throws JMSException
Description copied from interface: javax.jms.Session
Creates a queue identity given a Queue name.

This facility is provided for the rare cases where clients need to dynamically manipulate queue identity. It allows the creation of a queue identity with a provider-specific name. Clients that depend on this ability are not portable.

Note that this method is not for creating the physical queue. The physical creation of queues is an administrative task and is not to be initiated by the JMS API. The one exception is the creation of temporary queues, which is accomplished with the createTemporaryQueue method.

Specified by:
createQueue in interface Session
Overrides:
createQueue in class SessionImpl
Parameters:
queueName - the name of this Queue
Returns:
a Queue with the given name
Throws:
JMSException - if the session fails to create a queue due to some internal error.

createBrowser

public QueueBrowser createBrowser(Queue queue)
                           throws JMSException
Description copied from interface: javax.jms.Session
Creates a QueueBrowser object to peek at the messages on the specified queue.

Specified by:
createBrowser in interface Session
Overrides:
createBrowser in class SessionImpl
Parameters:
queue - the queue to access
Throws:
JMSException - if the session fails to create a browser due to some internal error.

createBrowser

public QueueBrowser createBrowser(Queue queue,
                                  String messageSelector)
                           throws JMSException
Description copied from interface: javax.jms.Session
Creates a QueueBrowser object to peek at the messages on the specified queue using a message selector.

Specified by:
createBrowser in interface Session
Overrides:
createBrowser in class SessionImpl
Parameters:
queue - the queue to access
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
Throws:
JMSException - if the session fails to create a browser due to some internal error.
InvalidSelectorException - if the message selector is invalid.

createTemporaryQueue

public TemporaryQueue createTemporaryQueue()
                                    throws JMSException
Description copied from interface: javax.jms.Session
Creates a TemporaryQueue object. Its lifetime will be that of the Connection unless it is deleted earlier.

Specified by:
createTemporaryQueue in interface Session
Overrides:
createTemporaryQueue in class SessionImpl
Returns:
a temporary queue identity
Throws:
JMSException - if the session fails to create a temporary queue due to some internal error.