activemq::core::ActiveMQSession Class Reference

#include <ActiveMQSession.h>

List of all members.

Public Member Functions

 ActiveMQSession (connector::SessionInfo *sessionInfo, const util::Properties &properties, ActiveMQConnection *connection)
virtual ~ActiveMQSession (void)
virtual void close (void) throw ( cms::CMSException )
virtual void commit (void) throw ( cms::CMSException )
virtual void rollback (void) throw ( cms::CMSException )
virtual cms::MessageConsumer * createConsumer (const cms::Destination *destination) throw ( cms::CMSException )
virtual cms::MessageConsumer * createConsumer (const cms::Destination *destination, const std::string &selector) throw ( cms::CMSException )
virtual cms::MessageConsumer * createDurableConsumer (const cms::Topic *destination, const std::string &name, const std::string &selector, bool noLocal=false) throw ( cms::CMSException )
virtual cms::MessageProducer * createProducer (const cms::Destination *destination) throw ( cms::CMSException )
virtual cms::Queue * createQueue (const std::string &queueName) throw ( cms::CMSException )
virtual cms::Topic * createTopic (const std::string &topicName) throw ( cms::CMSException )
virtual cms::TemporaryQueue * createTemporaryQueue (void) throw ( cms::CMSException )
virtual cms::TemporaryTopic * createTemporaryTopic (void) throw ( cms::CMSException )
virtual cms::Message * createMessage (void) throw ( cms::CMSException )
virtual cms::BytesMessage * createBytesMessage (void) throw ( cms::CMSException )
virtual cms::BytesMessage * createBytesMessage (const unsigned char *bytes, unsigned long bytesSize) throw ( cms::CMSException )
virtual cms::TextMessage * createTextMessage (void) throw ( cms::CMSException )
virtual cms::TextMessage * createTextMessage (const std::string &text) throw ( cms::CMSException )
virtual cms::MapMessage * createMapMessage (void) throw ( cms::CMSException )
virtual cms::Session::AcknowledgeMode getAcknowledgeMode (void) const
virtual bool isTransacted (void) const
virtual void send (cms::Message *message, ActiveMQProducer *producer) throw ( cms::CMSException )
virtual void onDestroySessionResource (ActiveMQSessionResource *resource) throw ( cms::CMSException )
virtual void acknowledge (ActiveMQConsumer *consumer, ActiveMQMessage *message) throw ( cms::CMSException )
virtual cms::ExceptionListener * getExceptionListener (void)
virtual connector::SessionInfo * getSessionInfo (void)

Private Attributes

connector::SessionInfo * sessionInfo
ActiveMQTransaction * transaction
ActiveMQConnection * connection
bool closed


Constructor & Destructor Documentation

ActiveMQSession::ActiveMQSession (  connector::SessionInfo *  sessionInfo,
const util::Properties &  properties,
ActiveMQConnection *  connection
) 
 

ActiveMQSession::~ActiveMQSession (  void   )  [virtual]
 


Member Function Documentation

void ActiveMQSession::acknowledge (  ActiveMQConsumer *  consumer,
ActiveMQMessage *  message
)  throw ( cms::CMSException ) [virtual]
 

Called to acknowledge the receipt of a message.

Parameters:
The consumer that received the message
The Message to acknowledge.
Exceptions:
CMSException 

void ActiveMQSession::close (  void   )  throw ( cms::CMSException ) [virtual]
 

Closes the Session

Exceptions:
CMSException 

void ActiveMQSession::commit (  void   )  throw ( cms::CMSException ) [virtual]
 

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

Exceptions:
CMSException 

cms::BytesMessage * ActiveMQSession::createBytesMessage (  const unsigned char *  bytes,
unsigned long  bytesSize
)  throw ( cms::CMSException ) [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 

cms::BytesMessage * ActiveMQSession::createBytesMessage (  void   )  throw ( cms::CMSException ) [virtual]
 

Creates a BytesMessage

Exceptions:
CMSException 

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

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

Parameters:
the Destination that this consumer receiving messages for.
Exceptions:
CMSException 

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

Creates a MessageConsumer for the specified destination.

Parameters:
the Destination that this consumer receiving messages for.
Exceptions:
CMSException 

cms::MessageConsumer * ActiveMQSession::createDurableConsumer (  const cms::Topic *  destination,
const std::string &  name,
const std::string &  selector,
bool  noLocal = false
)  throw ( cms::CMSException ) [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
Exceptions:
CMSException 

cms::MapMessage * ActiveMQSession::createMapMessage (  void   )  throw ( cms::CMSException ) [virtual]
 

Creates a new TextMessage

Exceptions:
CMSException 

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

Creates a new Message

Exceptions:
CMSException 

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

Creates a MessageProducer to send messages to the specified destination.

Parameters:
the Destination to publish on
Exceptions:
CMSException 

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

Creates a queue identity given a Queue name.

Parameters:
the name of the new Queue
Exceptions:
CMSException 

cms::TemporaryQueue * ActiveMQSession::createTemporaryQueue (  void   )  throw ( cms::CMSException ) [virtual]
 

Creates a TemporaryQueue object.

Exceptions:
CMSException 

cms::TemporaryTopic * ActiveMQSession::createTemporaryTopic (  void   )  throw ( cms::CMSException ) [virtual]
 

Creates a TemporaryTopic object.

Exceptions:
CMSException 

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

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

Parameters:
the initial text for the message
Exceptions:
CMSException 

cms::TextMessage * ActiveMQSession::createTextMessage (  void   )  throw ( cms::CMSException ) [virtual]
 

Creates a new TextMessage

Exceptions:
CMSException 

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

Creates a topic identity given a Queue name.

Parameters:
the name of the new Topic
Exceptions:
CMSException 

cms::Session::AcknowledgeMode ActiveMQSession::getAcknowledgeMode (  void   )  const [virtual]
 

Returns the acknowledgement mode of the session.

Returns:
the Sessions Acknowledge Mode

cms::ExceptionListener * ActiveMQSession::getExceptionListener (  void   )  [virtual]
 

This method gets any registered exception listener of this sessions connection and returns it. Mainly intended for use by the objects that this session creates so that they can notify the client of exceptions that occur in the context of another thread.

Returns:
cms::ExceptionListener pointer or NULL

virtual connector::SessionInfo* activemq::core::ActiveMQSession::getSessionInfo (  void   )  [inline, virtual]
 

Gets the Session Information object for this session, if the session is closed than this returns null

Returns:
SessionInfo Pointer

bool ActiveMQSession::isTransacted (  void   )  const [virtual]
 

Gets if the Sessions is a Transacted Session

Returns:
transacted true - false.

void ActiveMQSession::onDestroySessionResource (  ActiveMQSessionResource *  resource  )  throw ( cms::CMSException ) [virtual]
 

When a ActiveMQ core object is closed or destroyed it should call back and let the session know that it is going away, this allows the session to clean up any associated resources. This method destroy's the data that is associated with a Producer object

Parameters:
The Producer that is being destoryed
Exceptions:
CMSException 

void ActiveMQSession::rollback (  void   )  throw ( cms::CMSException ) [virtual]
 

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

Exceptions:
CMSException 

void ActiveMQSession::send (  cms::Message *  message,
ActiveMQProducer *  producer
)  throw ( cms::CMSException ) [virtual]
 

Sends a message from the Producer specified

Parameters:
cms::Message pointer
Producer Information
Exceptions:
CMSException 


Member Data Documentation

bool activemq::core::ActiveMQSession::closed [private]
 

ActiveMQConnection* activemq::core::ActiveMQSession::connection [private]
 

connector::SessionInfo* activemq::core::ActiveMQSession::sessionInfo [private]
 

ActiveMQTransaction* activemq::core::ActiveMQSession::transaction [private]
 


The documentation for this class was generated from the following files:
Generated on Thu Aug 3 18:03:32 2006 for activemq-cpp by  doxygen 1.4.5