18#ifndef _ACTIVEMQ_CMSUTIL_POOLEDSESSION_H_
19#define _ACTIVEMQ_CMSUTIL_POOLEDSESSION_H_
50 PooledSession(
const PooledSession&);
51 PooledSession& operator=(
const PooledSession&);
109 return session->createConsumer(destination);
113 const std::string& selector) {
114 return session->createConsumer(destination, selector);
118 const std::string& selector,
120 return session->createConsumer(destination, selector, noLocal);
124 const std::string& name,
125 const std::string& selector,
126 bool noLocal =
false) {
127 return session->createDurableConsumer(destination, name, selector, noLocal);
147 const std::string& selector,
bool noLocal);
150 return session->createProducer(destination);
172 return session->createQueue(queueName);
176 return session->createTopic(topicName);
180 return session->createTemporaryQueue();
184 return session->createTemporaryTopic();
188 return session->createMessage();
192 return session->createBytesMessage();
196 return session->createBytesMessage(bytes, bytesSize);
200 return session->createStreamMessage();
204 return session->createTextMessage();
208 return session->createTextMessage(text);
212 return session->createMapMessage();
216 return session->getAcknowledgeMode();
220 return session->isTransacted();
224 session->unsubscribe(name);
228 session->setMessageTransformer(transformer);
232 return session->getMessageTransformer();
#define AMQCPP_API
Definition Config.h:30
virtual cms::MessageConsumer * createDurableConsumer(const cms::Topic *destination, const std::string &name, const std::string &selector, bool noLocal=false)
Creates a durable subscriber to the specified topic, using a Message selector.
Definition PooledSession.h:123
virtual cms::MessageConsumer * createCachedConsumer(const cms::Destination *destination, const std::string &selector, bool noLocal)
First checks the internal consumer cache and creates on if none exist for the given destination,...
virtual void setMessageTransformer(cms::MessageTransformer *transformer)
Set an MessageTransformer instance that is passed on to all MessageProducer and MessageConsumer objec...
Definition PooledSession.h:227
virtual cms::Queue * createQueue(const std::string &queueName)
Creates a queue identity given a Queue name.
Definition PooledSession.h:171
virtual cms::Message * createMessage()
Creates a new Message.
Definition PooledSession.h:187
virtual cms::StreamMessage * createStreamMessage()
Creates a new StreamMessage.
Definition PooledSession.h:199
virtual cms::MessageConsumer * createConsumer(const cms::Destination *destination, const std::string &selector)
Creates a MessageConsumer for the specified destination, using a message selector.
Definition PooledSession.h:112
virtual void rollback()
Rolls back all messages done in this transaction and releases any locks currently held.
Definition PooledSession.h:100
virtual cms::QueueBrowser * createBrowser(const cms::Queue *queue)
Creates a new QueueBrowser to peek at Messages on the given Queue.
virtual cms::MapMessage * createMapMessage()
Creates a new MapMessage.
Definition PooledSession.h:211
virtual cms::Session * getSession()
Returns a non-constant reference to the internal session object.
Definition PooledSession.h:67
virtual const cms::Session * getSession() const
Returns a constant reference to the internal session object.
Definition PooledSession.h:76
virtual ~PooledSession()
Does nothing.
virtual cms::MessageConsumer * createConsumer(const cms::Destination *destination, const std::string &selector, bool noLocal)
Creates a MessageConsumer for the specified destination, using a message selector.
Definition PooledSession.h:117
virtual cms::TemporaryQueue * createTemporaryQueue()
Creates a TemporaryQueue object.
Definition PooledSession.h:179
virtual cms::QueueBrowser * createBrowser(const cms::Queue *queue, const std::string &selector)
Creates a new QueueBrowser to peek at Messages on the given Queue.
virtual void recover()
Stops message delivery in this session, and restarts message delivery with the oldest unacknowledged ...
Definition PooledSession.h:104
virtual void unsubscribe(const std::string &name)
Unsubscribes a durable subscription that has been created by a client.
Definition PooledSession.h:223
virtual void commit()
Commits all messages done in this transaction and releases any locks currently held.
Definition PooledSession.h:96
virtual cms::MessageConsumer * createConsumer(const cms::Destination *destination)
Creates a MessageConsumer for the specified destination.
Definition PooledSession.h:108
virtual void close()
Returns this session back to the pool, but does not close or destroy the internal session object.
virtual cms::TextMessage * createTextMessage(const std::string &text)
Creates a new TextMessage and set the text to the value given.
Definition PooledSession.h:207
virtual void stop()
Stops this service.
Definition PooledSession.h:92
virtual cms::BytesMessage * createBytesMessage(const unsigned char *bytes, int bytesSize)
Creates a BytesMessage and sets the payload to the passed value.
Definition PooledSession.h:195
virtual cms::TemporaryTopic * createTemporaryTopic()
Creates a TemporaryTopic object.
Definition PooledSession.h:183
virtual cms::Session::AcknowledgeMode getAcknowledgeMode() const
Returns the acknowledgment mode of the session.
Definition PooledSession.h:215
PooledSession(SessionPool *pool, cms::Session *session)
virtual cms::TextMessage * createTextMessage()
Creates a new TextMessage.
Definition PooledSession.h:203
virtual bool isTransacted() const
Gets if the Sessions is a Transacted Session.
Definition PooledSession.h:219
virtual cms::Topic * createTopic(const std::string &topicName)
Creates a topic identity given a Queue name.
Definition PooledSession.h:175
virtual cms::MessageProducer * createCachedProducer(const cms::Destination *destination)
First checks the internal producer cache and creates one if none exist for the given destination.
virtual cms::BytesMessage * createBytesMessage()
Creates a BytesMessage.
Definition PooledSession.h:191
virtual void start()
Starts the service.
Definition PooledSession.h:88
virtual cms::MessageProducer * createProducer(const cms::Destination *destination)
Creates a MessageProducer to send messages to the specified destination.
Definition PooledSession.h:149
virtual cms::MessageTransformer * getMessageTransformer() const
Gets the currently configured MessageTransformer for this Session.
Definition PooledSession.h:231
A pool of CMS sessions from the same connection and with the same acknowledge mode.
Definition SessionPool.h:39
A BytesMessage object is used to send a message containing a stream of unsigned bytes.
Definition BytesMessage.h:66
A Destination object encapsulates a provider-specific address.
Definition Destination.h:39
A MapMessage object is used to send a set of name-value pairs.
Definition MapMessage.h:71
A client uses a MessageConsumer to received messages from a destination.
Definition MessageConsumer.h:63
Root of all messages.
Definition Message.h:88
A client uses a MessageProducer object to send messages to a Destination.
Definition MessageProducer.h:60
This class implements in interface for browsing the messages in a Queue without removing them.
Definition QueueBrowser.h:53
An interface encapsulating a provider-specific queue name.
Definition Queue.h:37
A Session object is a single-threaded context for producing and consuming messages.
Definition Session.h:105
AcknowledgeMode
Definition Session.h:108
Interface for a StreamMessage.
Definition StreamMessage.h:61
Defines a Temporary Queue based Destination.
Definition TemporaryQueue.h:39
Defines a Temporary Topic based Destination.
Definition TemporaryTopic.h:39
Interface for a text message.
Definition TextMessage.h:41
An interface encapsulating a provider-specific topic name.
Definition Topic.h:36
Map template that wraps around a std::map to provide a more user-friendly interface and to provide co...
Definition StlMap.h:48
Definition CachedConsumer.h:25
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition CachedConsumer.h:24