17#ifndef _CMS_SESSION_H_
18#define _CMS_SESSION_H_
A BytesMessage object is used to send a message containing a stream of unsigned bytes.
Definition BytesMessage.h:66
Interface for a class that implements the close method.
Definition Closeable.h:35
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
virtual void setMessageTransformer(cms::MessageTransformer *transformer)=0
Set an MessageTransformer instance that is passed on to all MessageProducer and MessageConsumer objec...
virtual cms::MessageTransformer * getMessageTransformer() const =0
Gets the currently configured MessageTransformer for this Session.
virtual void rollback()=0
Rolls back all messages done in this transaction and releases any locks currently held.
virtual MessageConsumer * createConsumer(const Destination *destination, const std::string &selector)=0
Creates a MessageConsumer for the specified destination, using a message selector.
virtual AcknowledgeMode getAcknowledgeMode() const =0
Returns the acknowledgment mode of the session.
virtual Queue * createQueue(const std::string &queueName)=0
Creates a queue identity given a Queue name.
virtual bool isTransacted() const =0
Gets if the Sessions is a Transacted Session.
virtual TextMessage * createTextMessage()=0
Creates a new TextMessage.
virtual MessageConsumer * createDurableConsumer(const Topic *destination, const std::string &name, const std::string &selector, bool noLocal=false)=0
Creates a durable subscriber to the specified topic, using a Message selector.
virtual void commit()=0
Commits all messages done in this transaction and releases any locks currently held.
virtual Message * createMessage()=0
Creates a new Message.
virtual void recover()=0
Stops message delivery in this session, and restarts message delivery with the oldest unacknowledged ...
virtual TemporaryTopic * createTemporaryTopic()=0
Creates a TemporaryTopic object.
virtual void unsubscribe(const std::string &name)=0
Unsubscribes a durable subscription that has been created by a client.
virtual Topic * createTopic(const std::string &topicName)=0
Creates a topic identity given a Queue name.
virtual MapMessage * createMapMessage()=0
Creates a new MapMessage.
virtual StreamMessage * createStreamMessage()=0
Creates a new StreamMessage.
virtual TextMessage * createTextMessage(const std::string &text)=0
Creates a new TextMessage and set the text to the value given.
virtual MessageConsumer * createConsumer(const Destination *destination, const std::string &selector, bool noLocal)=0
Creates a MessageConsumer for the specified destination, using a message selector.
virtual void close()=0
Closes this session as well as any active child consumers or producers.
virtual BytesMessage * createBytesMessage()=0
Creates a BytesMessage.
virtual TemporaryQueue * createTemporaryQueue()=0
Creates a TemporaryQueue object.
virtual QueueBrowser * createBrowser(const cms::Queue *queue)=0
Creates a new QueueBrowser to peek at Messages on the given Queue.
virtual MessageProducer * createProducer(const Destination *destination=NULL)=0
Creates a MessageProducer to send messages to the specified destination.
AcknowledgeMode
Definition Session.h:108
@ SESSION_TRANSACTED
Messages will be consumed when the transaction commits.
Definition Session.h:139
@ INDIVIDUAL_ACKNOWLEDGE
Message will be acknowledged individually.
Definition Session.h:146
@ AUTO_ACKNOWLEDGE
With this acknowledgment mode, the session automatically acknowledges a client's receipt of a message...
Definition Session.h:117
@ DUPS_OK_ACKNOWLEDGE
With this acknowledgment mode, the session automatically acknowledges a client's receipt of a message...
Definition Session.h:128
@ CLIENT_ACKNOWLEDGE
With this acknowledgment mode, the client acknowledges a consumed message by calling the message's ac...
Definition Session.h:134
virtual BytesMessage * createBytesMessage(const unsigned char *bytes, int bytesSize)=0
Creates a BytesMessage and sets the payload to the passed value.
virtual QueueBrowser * createBrowser(const cms::Queue *queue, const std::string &selector)=0
Creates a new QueueBrowser to peek at Messages on the given Queue.
virtual MessageConsumer * createConsumer(const Destination *destination)=0
Creates a MessageConsumer for the specified destination.
Interface for a class that implements the start method.
Definition Startable.h:36
Interface for a class that implements the stop method.
Definition Stoppable.h:36
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
#define CMS_API
Definition Config.h:31
#define NULL
Definition Config.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition DestinationResolver.h:23