Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

javax::jms::TopicSession Class Reference

A TopicSession object provides methods for creating TopicPublisher, TopicSubscriber, and TemporaryTopic objects. More...

#include <javax_jms_TopicSession.h>

Inheritance diagram for javax::jms::TopicSession:

Inheritance graph
[legend]
Collaboration diagram for javax::jms::TopicSession:

Collaboration graph
[legend]
List of all members.

Public Types

enum  {
  xmogDefaultFlags = xmog_base::GLOBAL, xmogMajorVersion = 3, xmogMinorVersion = 2, xmogPatchVersion = 9,
  xmogBuildNumber = 2047
}
typedef ::xmog_java_array_template<
::javax::jms::TopicSession
array1D
typedef ::xmog_java_array_template<
::xmog_java_array_template<
::javax::jms::TopicSession > > 
array2D

Public Member Functions

virtual ::javax::jms::TopicSubscriber createDurableSubscriber (const ::javax::jms::Topic &topic, const ::java::lang::String &name, const ::java::lang::String &messageSelector, bool noLocal,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Creates a durable subscriber to the specified topic, using a message selector or specifying whether messages published by its own connection should be delivered to it.
virtual ::javax::jms::TopicSubscriber createDurableSubscriber (const ::javax::jms::Topic &topic, const ::java::lang::String &name,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Creates a durable subscriber to the specified topic.
virtual ::javax::jms::TopicPublisher createPublisher (const ::javax::jms::Topic &topic,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Creates a publisher for the specified topic.
virtual ::javax::jms::TopicSubscriber createSubscriber (const ::javax::jms::Topic &topic, const ::java::lang::String &messageSelector, bool noLocal,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 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.
virtual ::javax::jms::TopicSubscriber createSubscriber (const ::javax::jms::Topic &topic,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Creates a nondurable subscriber to the specified topic.
virtual ::javax::jms::TemporaryTopic createTemporaryTopic (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Creates a TemporaryTopic object.
virtual ::javax::jms::Topic createTopic (const ::java::lang::String &topicName,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Creates a topic identity given a Topic name.
virtual void unsubscribe (const ::java::lang::String &name,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Unsubscribes a durable subscription that has been created by a client.

Detailed Description

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:

Author:
Mark Hapner

Rich Burridge

Kate Stout


Member Function Documentation

virtual ::javax::jms::TopicSubscriber javax::jms::TopicSession::createDurableSubscriber const ::javax::jms::Topic topic,
const ::java::lang::String name,
const ::java::lang::String messageSelector,
bool  noLocal,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Creates a durable subscriber to the specified topic, using a message selector or specifying whether messages published by its own connection should be delivered to it.

If a client needs to receive all the messages published on a topic, including the ones published while the subscriber is inactive, it uses a durable TopicSubscriber. The JMS provider retains a record of this durable subscription and insures that all messages from the topic's publishers are retained until they are acknowledged by this durable subscriber or they have expired.

Sessions with durable subscribers must always provide the same client identifier. In addition, each client must specify a name which uniquely identifies (within client identifier) each durable subscription it creates. Only one session at a time can have a TopicSubscriber for a particular durable subscription. An inactive durable subscriber is one that exists but does not currently have a message consumer associated with it.

A client can change an existing durable subscription by creating a durable TopicSubscriber with the same name and a new topic and/or message selector. Changing a durable subscriber is equivalent to unsubscribing (deleting) the old one and creating a new one.

Parameters:
topic the non-temporary Topic to subscribe to
name the name used to identify this subscription
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
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

Reimplemented from javax::jms::Session.

virtual ::javax::jms::TopicSubscriber javax::jms::TopicSession::createDurableSubscriber const ::javax::jms::Topic topic,
const ::java::lang::String name,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Creates a durable subscriber to the specified topic.

If a client needs to receive all the messages published on a topic, including the ones published while the subscriber is inactive, it uses a durable TopicSubscriber. The JMS provider retains a record of this durable subscription and insures that all messages from the topic's publishers are retained until they are acknowledged by this durable subscriber or they have expired.

Sessions with durable subscribers must always provide the same client identifier. In addition, each client must specify a name that uniquely identifies (within client identifier) each durable subscription it creates. Only one session at a time can have a TopicSubscriber for a particular durable subscription.

A client can change an existing durable subscription by creating a durable TopicSubscriber with the same name and a new topic and/or message selector. Changing a durable subscriber is equivalent to unsubscribing (deleting) the old one and creating a new one.

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.

Parameters:
topic the non-temporary Topic to subscribe to
name the name used to identify this subscription
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

Reimplemented from javax::jms::Session.

virtual ::javax::jms::TopicPublisher javax::jms::TopicSession::createPublisher const ::javax::jms::Topic topic,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

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.

Parameters:
topic the Topic to publish to, or null if this is an unidentified producer
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual ::javax::jms::TopicSubscriber javax::jms::TopicSession::createSubscriber const ::javax::jms::Topic topic,
const ::java::lang::String messageSelector,
bool  noLocal,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

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.

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
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual ::javax::jms::TopicSubscriber javax::jms::TopicSession::createSubscriber const ::javax::jms::Topic topic,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

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.

Parameters:
topic the Topic to subscribe to
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual ::javax::jms::TemporaryTopic javax::jms::TopicSession::createTemporaryTopic ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Creates a TemporaryTopic object.

Its lifetime will be that of the TopicConnection unless it is deleted earlier.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a temporary topic identity

Reimplemented from javax::jms::Session.

virtual ::javax::jms::Topic javax::jms::TopicSession::createTopic const ::java::lang::String topicName,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Creates a topic identity given a Topic name.

This facility is provided for the rare cases where clients need to dynamically manipulate topic identity. This allows the creation of a topic 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 topic. The physical creation of topics is an administrative task and is not to be initiated by the JMS API. The one exception is the creation of temporary topics, which is accomplished with the createTemporaryTopic method.

Parameters:
topicName the name of this Topic
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a Topic with the given name

Reimplemented from javax::jms::Session.

virtual void javax::jms::TopicSession::unsubscribe const ::java::lang::String name,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Unsubscribes a durable subscription that has been created by a client.

This method deletes the state being maintained on behalf of the subscriber by its provider.

It is erroneous for a client to delete a durable subscription while there is an active TopicSubscriber for the subscription, or while a consumed message is part of a pending transaction or has not been acknowledged in the session.

Parameters:
name the name used to identify this subscription
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

Reimplemented from javax::jms::Session.


The documentation for this class was generated from the following file:
Generated on Fri Jun 16 10:20:03 2006 for JMS Courier for C++ by  doxygen 1.4.1