cms::Session Class Reference

#include <Session.h>

Inheritance diagram for cms::Session:

cms::Closeable List of all members.

Public Types

enum  AcknowledgeMode { AUTO_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, SESSION_TRANSACTED }

Public Member Functions

virtual ~Session (void)
virtual void commit (void)=0 throw ( CMSException )
virtual void rollback (void)=0 throw ( CMSException )
virtual MessageConsumercreateConsumer (const Destination *destination)=0 throw ( CMSException )
virtual MessageConsumercreateConsumer (const Destination *destination, const std::string &selector)=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 (void)=0 throw ( CMSException )
virtual TemporaryTopiccreateTemporaryTopic (void)=0 throw ( CMSException )
virtual MessagecreateMessage (void)=0 throw ( CMSException )
virtual BytesMessagecreateBytesMessage (void)=0 throw ( CMSException)
virtual BytesMessagecreateBytesMessage (const unsigned char *bytes, unsigned long bytesSize)=0 throw ( CMSException)
virtual TextMessagecreateTextMessage (void)=0 throw ( CMSException )
virtual TextMessagecreateTextMessage (const std::string &text)=0 throw ( CMSException )
virtual MapMessagecreateMapMessage (void)=0 throw ( CMSException )
virtual AcknowledgeMode getAcknowledgeMode (void) const =0
virtual bool isTransacted (void) const =0

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 void   )  [inline, virtual]
 


Member Function Documentation

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

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

Exceptions:
CMSException 

virtual BytesMessage* cms::Session::createBytesMessage const unsigned char *  bytes,
unsigned long  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 BytesMessage* cms::Session::createBytesMessage void   )  throw ( CMSException) [pure virtual]
 

Creates a BytesMessage

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.
Returns:
pointer to a new MessageConsumer that is owned by the caller ( caller deletes )
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::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 MapMessage* cms::Session::createMapMessage void   )  throw ( CMSException ) [pure virtual]
 

Creates a new MapMessage

Exceptions:
CMSException 

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

Creates a new Message

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 TemporaryQueue* cms::Session::createTemporaryQueue void   )  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 void   )  throw ( CMSException ) [pure virtual]
 

Creates a TemporaryTopic object.

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 TextMessage* cms::Session::createTextMessage void   )  throw ( CMSException ) [pure virtual]
 

Creates a new TextMessage

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 AcknowledgeMode cms::Session::getAcknowledgeMode void   )  const [pure virtual]
 

Returns the acknowledgement mode of the session.

Returns:
the Sessions Acknowledge Mode

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

Gets if the Sessions is a Transacted Session

Returns:
transacted true - false.

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

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

Exceptions:
CMSException 


The documentation for this class was generated from the following file:
Generated on Thu Aug 3 16:39:15 2006 for cms by  doxygen 1.4.5