cms::Session Class Reference

Inheritance diagram for cms::Session:

Inheritance graph
[legend]
Collaboration diagram for cms::Session:

Collaboration graph
[legend]
List of all members.

Public Types

enum  AcknowledgeMode { AUTO_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, SESSION_TRANSACTED }

Public Member Functions

virtual ~Session ()
virtual void close ()=0 throw ( CMSException )
virtual void commit ()=0 throw ( CMSException )
virtual void rollback ()=0 throw ( CMSException )
virtual MessageConsumercreateConsumer (const Destination *destination)=0 throw ( CMSException )
virtual MessageConsumercreateConsumer (const Destination *destination, const std::string &selector)=0 throw ( CMSException )
virtual MessageConsumercreateConsumer (const Destination *destination, const std::string &selector, bool noLocal)=0 throw ( CMSException )
virtual MessageConsumercreateDurableConsumer (const Topic *destination, const std::string &name, const std::string &selector, bool noLocal=false)=0 throw ( CMSException )
virtual MessageProducercreateProducer (const Destination *destination)=0 throw ( CMSException )
virtual QueuecreateQueue (const std::string &queueName)=0 throw ( CMSException )
virtual TopiccreateTopic (const std::string &topicName)=0 throw ( CMSException )
virtual TemporaryQueuecreateTemporaryQueue ()=0 throw ( CMSException )
virtual TemporaryTopiccreateTemporaryTopic ()=0 throw ( CMSException )
virtual MessagecreateMessage ()=0 throw ( CMSException )
virtual BytesMessagecreateBytesMessage ()=0 throw ( CMSException)
virtual BytesMessagecreateBytesMessage (const unsigned char *bytes, std::size_t bytesSize)=0 throw ( CMSException)
virtual TextMessagecreateTextMessage ()=0 throw ( CMSException )
virtual TextMessagecreateTextMessage (const std::string &text)=0 throw ( CMSException )
virtual MapMessagecreateMapMessage ()=0 throw ( CMSException )
virtual AcknowledgeMode getAcknowledgeMode () const=0
virtual bool isTransacted () const=0
virtual void unsubscribe (const std::string &name)=0 throw ( CMSException )

Member Enumeration Documentation

enum cms::Session::AcknowledgeMode

Enumerator:
AUTO_ACKNOWLEDGE  With this acknowledgment mode, the session automatically acknowledges a client's receipt of a message either when the session has successfully returned from a call to receive or when the message listener the session has called to process the message successfully returns.
DUPS_OK_ACKNOWLEDGE  With this acknowledgment mode, the session automatically acknowledges a client's receipt of a message either when the session has successfully returned from a call to receive or when the message listener the session has called to process the message successfully returns. Acknowlegements may be delayed in this mode to increase performance at the cost of the message being redelivered this client fails.
CLIENT_ACKNOWLEDGE  With this acknowledgment mode, the client acknowledges a consumed message by calling the message's acknowledge method.
SESSION_TRANSACTED  Messages will be consumed when the transaction commits.


Constructor & Destructor Documentation

virtual cms::Session::~Session (  )  [inline, virtual]


Member Function Documentation

virtual void cms::Session::close (  )  throw ( CMSException ) [pure virtual]

Closes this session as well as any active child consumers or producers.

Exceptions:
CMSException 

Implements cms::Closeable.

virtual void cms::Session::commit (  )  throw ( CMSException ) [pure virtual]

Commits all messages done in this transaction and releases any locks currently held.

Exceptions:
CMSException 

virtual void cms::Session::rollback (  )  throw ( CMSException ) [pure virtual]

Rollsback all messages done in this transaction and releases any locks currently held.

Exceptions:
CMSException 

virtual MessageConsumer* cms::Session::createConsumer ( const Destination destination  )  throw ( CMSException ) [pure virtual]

Creates a MessageConsumer for the specified destination.

Parameters:
the Destination that this consumer receiving messages for.
Returns:
pointer to a new MessageConsumer that is owned by the caller ( caller deletes )
Exceptions:
CMSException 

virtual MessageConsumer* cms::Session::createConsumer ( const Destination destination,
const std::string &  selector 
) throw ( CMSException ) [pure virtual]

Creates a MessageConsumer for the specified destination, using a message selector.

Parameters:
the Destination that this consumer receiving messages for.
the Message Selector to use
Returns:
pointer to a new MessageConsumer that is owned by the caller ( caller deletes )
Exceptions:
CMSException 

virtual MessageConsumer* cms::Session::createConsumer ( const Destination destination,
const std::string &  selector,
bool  noLocal 
) throw ( CMSException ) [pure virtual]

Creates a MessageConsumer for the specified destination, using a message selector.

Parameters:
the Destination that this consumer receiving messages for.
the Message Selector to use
if true, and the destination is a topic, inhibits the delivery of messages published by its own connection. The behavior for NoLocal is not specified if the destination is a queue.
Returns:
pointer to a new MessageConsumer that is owned by the caller ( caller deletes )
Exceptions:
CMSException 

virtual MessageConsumer* cms::Session::createDurableConsumer ( const Topic destination,
const std::string &  name,
const std::string &  selector,
bool  noLocal = false 
) throw ( CMSException ) [pure virtual]

Creates a durable subscriber to the specified topic, using a message selector

Parameters:
the topic to subscribe to
name used to identify the subscription
only messages matching the selector are received
Returns:
pointer to a new durable MessageConsumer that is owned by the caller ( caller deletes )
Exceptions:
CMSException 

virtual MessageProducer* cms::Session::createProducer ( const Destination destination  )  throw ( CMSException ) [pure virtual]

Creates a MessageProducer to send messages to the specified destination.

Parameters:
the Destination to publish on
Returns:
New MessageProducer that is owned by the caller.
Exceptions:
CMSException 

virtual Queue* cms::Session::createQueue ( const std::string &  queueName  )  throw ( CMSException ) [pure virtual]

Creates a queue identity given a Queue name.

Parameters:
the name of the new Queue
Returns:
new Queue pointer that is owned by the caller.
Exceptions:
CMSException 

virtual Topic* cms::Session::createTopic ( const std::string &  topicName  )  throw ( CMSException ) [pure virtual]

Creates a topic identity given a Queue name.

Parameters:
the name of the new Topic
Returns:
new Topic pointer that is owned by the caller.
Exceptions:
CMSException 

virtual TemporaryQueue* cms::Session::createTemporaryQueue (  )  throw ( CMSException ) [pure virtual]

Creates a TemporaryQueue object.

Returns:
new TemporaryQueue pointer that is owned by the caller.
Exceptions:
CMSException 

virtual TemporaryTopic* cms::Session::createTemporaryTopic (  )  throw ( CMSException ) [pure virtual]

Creates a TemporaryTopic object.

Exceptions:
CMSException 

virtual Message* cms::Session::createMessage (  )  throw ( CMSException ) [pure virtual]

Creates a new Message

Exceptions:
CMSException 

virtual BytesMessage* cms::Session::createBytesMessage (  )  throw ( CMSException) [pure virtual]

Creates a BytesMessage

Exceptions:
CMSException 

virtual BytesMessage* cms::Session::createBytesMessage ( const unsigned char *  bytes,
std::size_t  bytesSize 
) throw ( CMSException) [pure virtual]

Creates a BytesMessage and sets the paylod to the passed value

Parameters:
an array of bytes to set in the message
the size of the bytes array, or number of bytes to use
Exceptions:
CMSException 

virtual TextMessage* cms::Session::createTextMessage (  )  throw ( CMSException ) [pure virtual]

Creates a new TextMessage

Exceptions:
CMSException 

virtual TextMessage* cms::Session::createTextMessage ( const std::string &  text  )  throw ( CMSException ) [pure virtual]

Creates a new TextMessage and set the text to the value given

Parameters:
the initial text for the message
Exceptions:
CMSException 

virtual MapMessage* cms::Session::createMapMessage (  )  throw ( CMSException ) [pure virtual]

Creates a new MapMessage

Exceptions:
CMSException 

virtual AcknowledgeMode cms::Session::getAcknowledgeMode (  )  const [pure virtual]

Returns the acknowledgement mode of the session.

Returns:
the Sessions Acknowledge Mode

virtual bool cms::Session::isTransacted (  )  const [pure virtual]

Gets if the Sessions is a Transacted Session

Returns:
transacted true - false.

virtual void cms::Session::unsubscribe ( const std::string &  name  )  throw ( CMSException ) [pure 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 MessageConsumer or Subscriber 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
Exceptions:
CMSException 


Generated on Fri Jun 1 07:20:18 2007 for CMS by  doxygen 1.5.1-p1