activemq-cpp-3.9.0
activemq::core::ActiveMQXAConnection Class Reference

#include <src/main/activemq/core/ActiveMQXAConnection.h>

Inheritance diagram for activemq::core::ActiveMQXAConnection:

Public Member Functions

 ActiveMQXAConnection (const Pointer< transport::Transport > &transport, const Pointer< decaf::util::Properties > &properties)
 
virtual ~ActiveMQXAConnection ()
 
virtual cms::XASessioncreateXASession ()
 Creates an XASession object. More...
 
virtual cms::SessioncreateSession (cms::Session::AcknowledgeMode ackMode)
 Creates a new Session to work for this Connection using the specified acknowledgment mode.
Parameters
ackModethe Acknowledgment Mode to use.
Exceptions
CMSException
More...
 
- Public Member Functions inherited from cms::XAConnection
virtual ~XAConnection ()
 
- Public Member Functions inherited from cms::Connection
virtual ~Connection ()
 
- Public Member Functions inherited from cms::Startable
virtual ~Startable ()
 
- Public Member Functions inherited from cms::Stoppable
virtual ~Stoppable ()
 
- Public Member Functions inherited from cms::Closeable
virtual ~Closeable ()
 
- Public Member Functions inherited from activemq::core::ActiveMQConnection
 ActiveMQConnection (const Pointer< transport::Transport > transport, const Pointer< decaf::util::Properties > properties)
 Constructor. More...
 
virtual ~ActiveMQConnection ()
 
virtual void addSession (Pointer< activemq::core::kernels::ActiveMQSessionKernel > session)
 Adds the session resources for the given session instance. More...
 
virtual void removeSession (Pointer< activemq::core::kernels::ActiveMQSessionKernel > session)
 Removes the session resources for the given session instance. More...
 
virtual void addProducer (Pointer< kernels::ActiveMQProducerKernel > producer)
 Adds an active Producer to the Set of known producers. More...
 
virtual void removeProducer (const Pointer< commands::ProducerId > &producerId)
 Removes an active Producer to the Set of known producers. More...
 
virtual void addDispatcher (const Pointer< commands::ConsumerId > &consumer, Dispatcher *dispatcher)
 Adds a dispatcher for a consumer. More...
 
virtual void removeDispatcher (const Pointer< commands::ConsumerId > &consumer)
 Removes the dispatcher for a consumer. More...
 
virtual void sendPullRequest (const commands::ConsumerInfo *consumer, long long timeout)
 If supported sends a message pull request to the service provider asking for the delivery of a new message. More...
 
bool isClosed () const
 Checks if this connection has been closed. More...
 
bool isStarted () const
 Check if this connection has been started. More...
 
bool isTransportFailed () const
 Checks if the Connection's Transport has failed. More...
 
virtual void destroyDestination (const commands::ActiveMQDestination *destination)
 Requests that the Broker removes the given Destination. More...
 
virtual void destroyDestination (const cms::Destination *destination)
 Requests that the Broker removes the given Destination. More...
 
bool isDuplicate (Dispatcher *dispatcher, Pointer< commands::Message > message)
 Allows Consumers to check if an incoming Message is a Duplicate. More...
 
void rollbackDuplicate (Dispatcher *dispatcher, Pointer< commands::Message > message)
 Mark message as received. More...
 
void removeAuditedDispatcher (Dispatcher *dispatcher)
 Removes the Audit information stored for a given MessageConsumer. More...
 
virtual const
cms::ConnectionMetaData
getMetaData () const
 Gets the metadata for this connection.
Returns
the connection MetaData pointer ( caller does not own it ).
Exceptions
CMSExceptionif the provider fails to get the connection metadata for this connection.
See also
ConnectionMetaData
Since
2.0
More...
 
virtual cms::SessioncreateSession ()
 Creates an AUTO_ACKNOWLEDGE Session.
Exceptions
CMSException
More...
 
virtual std::string getClientID () const
 Get the Client Id for this session, the client Id is provider specific and is either assigned by the connection factory or set using the setClientID method.
Returns
Client Id String for this Connection.
Exceptions
CMSExceptionif the provider fails to return the client id or an internal error occurs.
More...
 
virtual void setClientID (const std::string &clientID)
 Sets the client identifier for this connection.The preferred way to assign a CMS client's client identifier is for it to be configured in a client-specific ConnectionFactory object and transparently assigned to the Connection object it creates.If a client sets the client identifier explicitly, it must do so immediately after it creates the connection and before any other action on the connection is taken. After this point, setting the client identifier is a programming error that should throw an IllegalStateException.
Parameters
clientIDThe unique client identifier to assign to the Connection.
Exceptions
CMSExceptionif the provider fails to set the client id due to some internal error.
InvalidClientIDExceptionif the id given is somehow invalid or is a duplicate.
IllegalStateExceptionif the client tries to set the id after a Connection method has been called.
More...
 
virtual void close ()
 Closes this connection as well as any Sessions created from it (and those Sessions' consumers and producers).
Exceptions
CMSException
More...
 
virtual void start ()
 Starts the service.
Exceptions
CMSExceptionif an internal error occurs while starting.
More...
 
virtual void stop ()
 Stops this service.
Exceptions
CMSException- if an internal error occurs while stopping the Service.
More...
 
virtual cms::ExceptionListenergetExceptionListener () const
 Gets the registered Exception Listener for this connection.
Returns
pointer to an exception listener or NULL
More...
 
virtual void setExceptionListener (cms::ExceptionListener *listener)
 Sets the registered Exception Listener for this connection.
Parameters
listenerpointer to and ExceptionListener
More...
 
virtual void setMessageTransformer (cms::MessageTransformer *transformer)
 Set an MessageTransformer instance that is passed on to all Session objects created from this Connection.The CMS code never takes ownership of the MessageTransformer pointer which implies that the client code must ensure that the object remains valid for the lifetime of the CMS object to which the MessageTransformer has been assigned.
Parameters
transformerPointer to the cms::MessageTransformer to set on all newly created Session objects.
More...
 
virtual cms::MessageTransformergetMessageTransformer () const
 Gets the currently configured MessageTransformer for this Connection.
Returns
the pointer to the currently set cms::MessageTransformer.
More...
 
virtual cms::DestinationSourcegetDestinationSource ()
 Returns the DestinationSource} object which can be used to listen to destinations being created or destroyed or to enquire about the current destinations available on the message Provider.
Returns
a new instance of a DestinationSource that is owned by the caller.
Exceptions
CMSExceptionif an error occurs while creating the destination source.
More...
 
void setUsername (const std::string &username)
 Sets the username that should be used when creating a new connection. More...
 
const std::string & getUsername () const
 Gets the username that this factory will use when creating a new connection instance. More...
 
void setPassword (const std::string &password)
 Sets the password that should be used when creating a new connection. More...
 
const std::string & getPassword () const
 Gets the password that this factory will use when creating a new connection instance. More...
 
void setDefaultClientId (const std::string &clientId)
 Sets the Client Id. More...
 
void setBrokerURL (const std::string &brokerURL)
 Sets the Broker URL that should be used when creating a new connection instance. More...
 
const std::string & getBrokerURL () const
 Gets the Broker URL that this factory will use when creating a new connection instance. More...
 
void setPrefetchPolicy (PrefetchPolicy *policy)
 Sets the PrefetchPolicy instance that this factory should use when it creates new Connection instances. More...
 
PrefetchPolicygetPrefetchPolicy () const
 Gets the pointer to the current PrefetchPolicy that is in use by this ConnectionFactory. More...
 
void setRedeliveryPolicy (RedeliveryPolicy *policy)
 Sets the RedeliveryPolicy instance that this factory should use when it creates new Connection instances. More...
 
RedeliveryPolicygetRedeliveryPolicy () const
 Gets the pointer to the current RedeliveryPolicy that is in use by this ConnectionFactory. More...
 
bool isDispatchAsync () const
 
void setDispatchAsync (bool value)
 Should messages be dispatched synchronously or asynchronously from the producer thread for non-durable topics in the broker? For fast consumers set this to false. More...
 
bool isAlwaysSyncSend () const
 Gets if the Connection should always send things Synchronously. More...
 
void setAlwaysSyncSend (bool value)
 Sets if the Connection should always send things Synchronously. More...
 
bool isUseAsyncSend () const
 Gets if the useAsyncSend option is set. More...
 
void setUseAsyncSend (bool value)
 Sets the useAsyncSend option. More...
 
bool isUseCompression () const
 Gets if the Connection is configured for Message body compression. More...
 
void setUseCompression (bool value)
 Sets whether Message body compression is enabled. More...
 
void setCompressionLevel (int value)
 Sets the Compression level used when Message body compression is enabled, a value of -1 causes the Compression Library to use the default setting which is a balance of speed and compression. More...
 
int getCompressionLevel () const
 Gets the currently configured Compression level for Message bodies. More...
 
unsigned int getSendTimeout () const
 Gets the assigned send timeout for this Connector. More...
 
void setSendTimeout (unsigned int timeout)
 Sets the send timeout to use when sending Message objects, this will cause all messages to be sent using a Synchronous request is non-zero. More...
 
unsigned int getCloseTimeout () const
 Gets the assigned close timeout for this Connector. More...
 
void setCloseTimeout (unsigned int timeout)
 Sets the close timeout to use when sending the disconnect request. More...
 
unsigned int getProducerWindowSize () const
 Gets the configured producer window size for Producers that are created from this connector. More...
 
void setProducerWindowSize (unsigned int windowSize)
 Sets the size in Bytes of messages that a producer can send before it is blocked to await a ProducerAck from the broker that frees enough memory to allow another message to be sent. More...
 
bool isMessagePrioritySupported () const
 
void setMessagePrioritySupported (bool value)
 Set whether or not this factory should create Connection objects with the Message priority support function enabled. More...
 
long long getNextTempDestinationId ()
 Get the Next Temporary Destination Id. More...
 
long long getNextLocalTransactionId ()
 Get the Next Temporary Destination Id. More...
 
bool isWatchTopicAdvisories () const
 Is the Connection configured to watch for advisory messages to maintain state of temporary destination create and destroy. More...
 
void setWatchTopicAdvisories (bool value)
 Sets whether this Connection is listening for advisory messages regarding temporary destination creation and deletion. More...
 
int getAuditDepth () const
 Get the audit depth for Messages for consumers when using a fault tolerant transport. More...
 
void setAuditDepth (int auditDepth)
 Set the audit depth for Messages for consumers when using a fault tolerant transport. More...
 
int getAuditMaximumProducerNumber () const
 The number of Producers that will be audited. More...
 
void setAuditMaximumProducerNumber (int auditMaximumProducerNumber)
 The number of Producers that will be audited. More...
 
bool isCheckForDuplicates () const
 Gets the value of the configured Duplicate Message detection feature. More...
 
void setCheckForDuplicates (bool checkForDuplicates)
 Gets the value of the configured Duplicate Message detection feature. More...
 
bool isTransactedIndividualAck () const
 when true, submit individual transacted acks immediately rather than with transaction completion. More...
 
void setTransactedIndividualAck (bool transactedIndividualAck)
 when true, submit individual transacted acks immediately rather than with transaction completion. More...
 
bool isNonBlockingRedelivery () const
 Returns true if non-blocking redelivery of Messages is configured for Consumers that are rolled back or recovered. More...
 
void setNonBlockingRedelivery (bool nonBlockingRedelivery)
 When true a MessageConsumer will not stop Message delivery before re-delivering Messages from a rolled back transaction. More...
 
long long getConsumerFailoverRedeliveryWaitPeriod () const
 Gets the delay period for a consumer redelivery. More...
 
void setConsumerFailoverRedeliveryWaitPeriod (long long value)
 Sets the delay period for a consumer redelivery. More...
 
bool isOptimizeAcknowledge () const
 
void setOptimizeAcknowledge (bool optimizeAcknowledge)
 Sets if Consumers are configured to use Optimized Acknowledge by default. More...
 
long long getOptimizeAcknowledgeTimeOut () const
 Gets the time between optimized ack batches in milliseconds. More...
 
void setOptimizeAcknowledgeTimeOut (long long optimizeAcknowledgeTimeOut)
 The max time in milliseconds between optimized ack batches. More...
 
long long getOptimizedAckScheduledAckInterval () const
 Gets the configured time interval that is used to force all MessageConsumers that have optimizedAcknowledge enabled to send an ack for any outstanding Message Acks. More...
 
void setOptimizedAckScheduledAckInterval (long long optimizedAckScheduledAckInterval)
 Sets the amount of time between scheduled sends of any outstanding Message Acks for consumers that have been configured with optimizeAcknowledge enabled. More...
 
bool isUseRetroactiveConsumer () const
 Should all created consumers be retroactive. More...
 
void setUseRetroactiveConsumer (bool useRetroactiveConsumer)
 Sets whether or not retroactive consumers are enabled. More...
 
bool isExclusiveConsumer () const
 Should all created consumers be exclusive. More...
 
void setExclusiveConsumer (bool exclusiveConsumer)
 Enables or disables whether or not queue consumers should be exclusive or not for example to preserve ordering when not using Message Groups. More...
 
bool isSendAcksAsync () const
 Returns whether Message acknowledgments are sent asynchronously meaning no response is required from the broker before the ack completes. More...
 
void setSendAcksAsync (bool sendAcksAsync)
 Sets whether Message acknowledgments are sent asynchronously meaning no response is required from the broker before the ack completes. More...
 
bool isAlwaysSessionAsync () const
 
void setAlwaysSessionAsync (bool alwaysSessionAsync)
 If this flag is not set then a separate thread is not used for dispatching messages for each Session in the Connection. More...
 
bool isConsumerExpiryCheckEnabled ()
 
void setConsumerExpiryCheckEnabled (bool consumerExpiryCheckEnabled)
 Configures whether this consumer will perform message expiration processing on all incoming messages. More...
 
int getProtocolVersion () const
 
void addTransportListener (transport::TransportListener *transportListener)
 Adds a transport listener so that a client can be notified of events in the underlying transport, client's are always notified after the event has been processed by the Connection class. More...
 
void removeTransportListener (transport::TransportListener *transportListener)
 Removes a registered TransportListener from the Connection's set of Transport listeners, this listener will no longer receive any Transport related events. More...
 
virtual void onCommand (const Pointer< commands::Command > command)
 Event handler for the receipt of a non-response command from the transport. More...
 
virtual void onException (const decaf::lang::Exception &ex)
 Event handler for an exception from a command transport. More...
 
virtual void transportInterrupted ()
 The transport has suffered an interruption from which it hopes to recover. More...
 
virtual void transportResumed ()
 The transport has resumed after an interruption. More...
 
const commands::ConnectionInfogetConnectionInfo () const
 Gets the ConnectionInfo for this Object, if the Connection is not open than this method throws an exception. More...
 
const commands::ConnectionIdgetConnectionId () const
 Gets the ConnectionId for this Object, if the Connection is not open than this method throws an exception. More...
 
transport::TransportgetTransport () const
 Gets a reference to this object's Transport instance. More...
 
Pointer< threads::SchedulergetScheduler () const
 Gets a reference to the Connection objects built in Scheduler instance. More...
 
std::string getResourceManagerId () const
 Returns the Id of the Resource Manager that this client will use should it be entered into an XA Transaction. More...
 
void cleanup ()
 Clean up this connection object, reseting it back to a state that mirrors what a newly created ActiveMQConnection object has. More...
 
void oneway (Pointer< commands::Command > command)
 Sends a message without request that the broker send a response to indicate that it was received. More...
 
Pointer< commands::ResponsesyncRequest (Pointer< commands::Command > command, unsigned int timeout=0)
 Sends a synchronous request and returns the response from the broker. More...
 
void asyncRequest (Pointer< commands::Command > command, cms::AsyncCallback *onComplete)
 Sends a synchronous request and returns the response from the broker. More...
 
virtual void fire (const exceptions::ActiveMQException &ex)
 Notify the exception listener. More...
 
void setTransportInterruptionProcessingComplete ()
 Indicates that a Connection resource that is processing the transportInterrupted event has completed. More...
 
void setFirstFailureError (decaf::lang::Exception *error)
 Sets the pointer to the first exception that caused the Connection to become failed. More...
 
decaf::lang::ExceptiongetFirstFailureError () const
 Gets the pointer to the first exception that caused the Connection to become failed. More...
 
void onAsyncException (const decaf::lang::Exception &ex)
 Event handler for dealing with async exceptions. More...
 
void onClientInternalException (const decaf::lang::Exception &ex)
 Handles async client internal exceptions which don't usually affect the connection itself. More...
 
void checkClosed () const
 Check for Closed State and Throw an exception if true. More...
 
void checkClosedOrFailed () const
 Check for Closed State and Failed State and Throw an exception if either is true. More...
 
void ensureConnectionInfoSent ()
 If its not been sent, then send the ConnectionInfo to the Broker. More...
 
decaf::util::concurrent::ExecutorServicegetExecutor () const
 
void addTempDestination (Pointer< commands::ActiveMQTempDestination > destination)
 Adds the given Temporary Destination to this Connections collection of known Temporary Destinations. More...
 
void removeTempDestination (Pointer< commands::ActiveMQTempDestination > destination)
 Removes the given Temporary Destination to this Connections collection of known Temporary Destinations. More...
 
void deleteTempDestination (Pointer< commands::ActiveMQTempDestination > destination)
 Removes the given Temporary Destination to this Connections collection of known Temporary Destinations. More...
 
void cleanUpTempDestinations ()
 Removes any TempDestinations that this connection has cached, ignoring any exceptions generated because the destination is in use as they should not be removed. More...
 
bool isDeleted (Pointer< commands::ActiveMQTempDestination > destination) const
 Determines whether the supplied Temporary Destination has already been deleted from the Broker. More...
 
decaf::util::ArrayList
< Pointer
< activemq::core::kernels::ActiveMQSessionKernel > > 
getSessions () const
 Returns an ArrayList that contains a copy of all Sessions that are currently active in the Connection. More...
 
- Public Member Functions inherited from cms::EnhancedConnection
virtual ~EnhancedConnection ()
 
- Public Member Functions inherited from activemq::transport::TransportListener
virtual ~TransportListener ()
 

Additional Inherited Members

- Protected Member Functions inherited from activemq::core::ActiveMQConnection
virtual Pointer
< commands::SessionId
getNextSessionId ()
 
void disconnect (long long lastDeliveredSequenceId)
 
void waitForTransportInterruptionProcessingToComplete ()
 
void signalInterruptionProcessingComplete ()
 
const decaf::util::PropertiesgetProperties () const
 
void onWireFormatInfo (Pointer< commands::Command > command)
 
void onControlCommand (Pointer< commands::Command > command)
 
void onConnectionControl (Pointer< commands::Command > command)
 
void onConsumerControl (Pointer< commands::Command > command)
 

Constructor & Destructor Documentation

activemq::core::ActiveMQXAConnection::ActiveMQXAConnection ( const Pointer< transport::Transport > &  transport,
const Pointer< decaf::util::Properties > &  properties 
)
virtual activemq::core::ActiveMQXAConnection::~ActiveMQXAConnection ( )
virtual

Member Function Documentation

virtual cms::Session* activemq::core::ActiveMQXAConnection::createSession ( cms::Session::AcknowledgeMode  ackMode)
virtual

Creates a new Session to work for this Connection using the specified acknowledgment mode.

Parameters
ackModethe Acknowledgment Mode to use.
Exceptions
CMSException

Reimplemented from activemq::core::ActiveMQConnection.

virtual cms::XASession* activemq::core::ActiveMQXAConnection::createXASession ( )
virtual

Creates an XASession object.

Returns
a newly created XASession instance, caller owns the pointer.
Exceptions
CMSExceptionIf the XAConnection object fails to create the XASession instance due to an internal error.

Implements cms::XAConnection.


The documentation for this class was generated from the following file: