diff --git a/activemq-cpp/src/main/cms/BytesMessage.h b/activemq-cpp/src/main/cms/BytesMessage.h index e9fab5677d..c2b940c258 100644 --- a/activemq-cpp/src/main/cms/BytesMessage.h +++ b/activemq-cpp/src/main/cms/BytesMessage.h @@ -1,62 +1,62 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _CMS_BYTESMESSAGE_H_ -#define _CMS_BYTESMESSAGE_H_ - -#include - -namespace cms{ - - class BytesMessage : public Message{ - - public: - - /** - * Destructor - */ - virtual ~BytesMessage(){} - - /** - * sets the bytes given to the message body. - * @param Byte Buffer to copy - * @param Number of bytes in Buffer to copy - * @throws CMSException - */ - virtual void setBodyBytes( - const unsigned char* buffer, const unsigned long numBytes ) - throw( CMSException ) = 0; - - /** - * Gets the bytes that are contained in this message, user should - * copy this data into a user allocated buffer. Call - * getBodyLength to determine the number of bytes - * to expect. - * @return const pointer to a byte buffer - */ - virtual const unsigned char* getBodyBytes(void) const = 0; - - /** - * Returns the number of bytes contained in the body of this message. - * @return number of bytes. - */ - virtual unsigned long getBodyLength(void) const = 0; - - }; -} - -#endif /*_CMS_BYTESMESSAGE_H_*/ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _CMS_BYTESMESSAGE_H_ +#define _CMS_BYTESMESSAGE_H_ + +#include + +namespace cms{ + + class BytesMessage : public Message{ + + public: + + /** + * Destructor + */ + virtual ~BytesMessage(){} + + /** + * sets the bytes given to the message body. + * @param Byte Buffer to copy + * @param Number of bytes in Buffer to copy + * @throws CMSException + */ + virtual void setBodyBytes( + const unsigned char* buffer, const unsigned long numBytes ) + throw( CMSException ) = 0; + + /** + * Gets the bytes that are contained in this message, user should + * copy this data into a user allocated buffer. Call + * getBodyLength to determine the number of bytes + * to expect. + * @return const pointer to a byte buffer + */ + virtual const unsigned char* getBodyBytes(void) const = 0; + + /** + * Returns the number of bytes contained in the body of this message. + * @return number of bytes. + */ + virtual unsigned long getBodyLength(void) const = 0; + + }; +} + +#endif /*_CMS_BYTESMESSAGE_H_*/ diff --git a/activemq-cpp/src/main/cms/Connection.h b/activemq-cpp/src/main/cms/Connection.h index 66fa7bd609..81d5070e88 100644 --- a/activemq-cpp/src/main/cms/Connection.h +++ b/activemq-cpp/src/main/cms/Connection.h @@ -1,76 +1,76 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _CMS_CONNECTION_H_ -#define _CMS_CONNECTION_H_ - -#include -#include -#include -#include - -namespace cms -{ - class ExceptionListener; - - class Connection : - public Startable, - public Stoppable, - public Closeable - { - public: - - /** - * Destructor - */ - virtual ~Connection(void) {} - - /** - * Creates a new Session to work for this Connection - */ - virtual Session* createSession(void) throw ( CMSException ) = 0; - - /** - * Creates a new Session to work for this Connection using the - * specified acknowledgment mode - * @param the Acknowledgement Mode to use. - */ - virtual Session* createSession(Session::AcknowledgeMode ackMode) - throw ( CMSException ) = 0; - - /** - * Get the Client Id for this session - */ - virtual std::string getClientId(void) const = 0; - - /** - * Gets the registered Exception Listener for this connection - * @return pointer to an exception listnener or NULL - */ - virtual ExceptionListener* getExceptionListener(void) const = 0; - - /** - * Sets the registed Exception Listener for this connection - * @param pointer to and ExceptionListener - */ - virtual void setExceptionListener(ExceptionListener* listener) = 0; - - }; - -} - -#endif /*_CMS_CONNECTION_H_*/ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _CMS_CONNECTION_H_ +#define _CMS_CONNECTION_H_ + +#include +#include +#include +#include + +namespace cms +{ + class ExceptionListener; + + class Connection : + public Startable, + public Stoppable, + public Closeable + { + public: + + /** + * Destructor + */ + virtual ~Connection(void) {} + + /** + * Creates a new Session to work for this Connection + */ + virtual Session* createSession(void) throw ( CMSException ) = 0; + + /** + * Creates a new Session to work for this Connection using the + * specified acknowledgment mode + * @param the Acknowledgement Mode to use. + */ + virtual Session* createSession(Session::AcknowledgeMode ackMode) + throw ( CMSException ) = 0; + + /** + * Get the Client Id for this session + */ + virtual std::string getClientId(void) const = 0; + + /** + * Gets the registered Exception Listener for this connection + * @return pointer to an exception listnener or NULL + */ + virtual ExceptionListener* getExceptionListener(void) const = 0; + + /** + * Sets the registed Exception Listener for this connection + * @param pointer to and ExceptionListener + */ + virtual void setExceptionListener(ExceptionListener* listener) = 0; + + }; + +} + +#endif /*_CMS_CONNECTION_H_*/ diff --git a/activemq-cpp/src/main/cms/ConnectionFactory.h b/activemq-cpp/src/main/cms/ConnectionFactory.h index 33361b7987..aeaeea0e4a 100644 --- a/activemq-cpp/src/main/cms/ConnectionFactory.h +++ b/activemq-cpp/src/main/cms/ConnectionFactory.h @@ -1,61 +1,61 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef _CMS_CONNECTIONFACTORY_H_ -#define _CMS_CONNECTIONFACTORY_H_ - -#include -#include - -#include - -namespace cms -{ - - class ConnectionFactory - { - public: - - /** - * Destructor - */ - virtual ~ConnectionFactory(void) {} - - /** - * Creates a connection with the default user identity. The - * connection is created in stopped mode. No messages will be - * delivered until the Connection.start method is explicitly - * called. - * @throws CMSException - */ - virtual Connection* createConnection(void) throw ( CMSException ) = 0; - - /** - * Creates a connection with the specified user identity. The - * connection is created in stopped mode. No messages will be - * delivered until the Connection.start method is explicitly called. - * @throw CMSException. - */ - virtual Connection* createConnection(const std::string& username, - const std::string& password, - const std::string& clientId) - throw ( CMSException ) = 0; - - }; - -} - -#endif /*_CMS_CONNECTIONFACTORY_H_*/ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef _CMS_CONNECTIONFACTORY_H_ +#define _CMS_CONNECTIONFACTORY_H_ + +#include +#include + +#include + +namespace cms +{ + + class ConnectionFactory + { + public: + + /** + * Destructor + */ + virtual ~ConnectionFactory(void) {} + + /** + * Creates a connection with the default user identity. The + * connection is created in stopped mode. No messages will be + * delivered until the Connection.start method is explicitly + * called. + * @throws CMSException + */ + virtual Connection* createConnection(void) throw ( CMSException ) = 0; + + /** + * Creates a connection with the specified user identity. The + * connection is created in stopped mode. No messages will be + * delivered until the Connection.start method is explicitly called. + * @throw CMSException. + */ + virtual Connection* createConnection(const std::string& username, + const std::string& password, + const std::string& clientId) + throw ( CMSException ) = 0; + + }; + +} + +#endif /*_CMS_CONNECTIONFACTORY_H_*/ diff --git a/activemq-cpp/src/main/cms/Destination.h b/activemq-cpp/src/main/cms/Destination.h index 5d2659436a..035f005cda 100644 --- a/activemq-cpp/src/main/cms/Destination.h +++ b/activemq-cpp/src/main/cms/Destination.h @@ -1,82 +1,82 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _CMS_DESTINATION_H_ -#define _CMS_DESTINATION_H_ - -#include - -namespace cms{ - - /** - * A Destination object encapsulates a provider-specific address. - */ - class Destination{ - public: - - enum DestinationType - { - TOPIC, - QUEUE, - TEMPORARY_TOPIC, - TEMPORARY_QUEUE - }; - - public: - - /** - * Destructor - */ - virtual ~Destination(void){} - - /** - * Retrieve the Destination Type for this Destination - * @return The Destination Type - */ - virtual DestinationType getDestinationType(void) const = 0; - - /** - * Converts the Destination Name into a String - * @return string name - */ - virtual std::string toString(void) const = 0; - - /** - * Converts the Destination to a String value representing the - * Provider specific name fot this destination, which is not - * necessarily equal to the User Supplied name of the Destination - * @return Provider specific Name - */ - virtual std::string toProviderString(void) const = 0; - - /** - * Creates a new instance of this destination type that is a - * copy of this one, and returns it. - * @returns cloned copy of this object - */ - virtual cms::Destination* clone(void) const = 0; - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _CMS_DESTINATION_H_ +#define _CMS_DESTINATION_H_ + +#include + +namespace cms{ + + /** + * A Destination object encapsulates a provider-specific address. + */ + class Destination{ + public: + + enum DestinationType + { + TOPIC, + QUEUE, + TEMPORARY_TOPIC, + TEMPORARY_QUEUE + }; + + public: + + /** + * Destructor + */ + virtual ~Destination(void){} + + /** + * Retrieve the Destination Type for this Destination + * @return The Destination Type + */ + virtual DestinationType getDestinationType(void) const = 0; + + /** + * Converts the Destination Name into a String + * @return string name + */ + virtual std::string toString(void) const = 0; + + /** + * Converts the Destination to a String value representing the + * Provider specific name fot this destination, which is not + * necessarily equal to the User Supplied name of the Destination + * @return Provider specific Name + */ + virtual std::string toProviderString(void) const = 0; + + /** + * Creates a new instance of this destination type that is a + * copy of this one, and returns it. + * @returns cloned copy of this object + */ + virtual cms::Destination* clone(void) const = 0; + /** * Copies the contents of the given Destinastion object to this one. * @param source The source Destination object. */ virtual void copy( const cms::Destination& source ) = 0; - - }; -} - -#endif /*_CMS_DESTINATION_H_*/ + + }; +} + +#endif /*_CMS_DESTINATION_H_*/ diff --git a/activemq-cpp/src/main/cms/ExceptionListener.h b/activemq-cpp/src/main/cms/ExceptionListener.h index 190c09df61..11dadfb9f3 100644 --- a/activemq-cpp/src/main/cms/ExceptionListener.h +++ b/activemq-cpp/src/main/cms/ExceptionListener.h @@ -1,44 +1,44 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _CMS_EXCEPTIONLISTENER_H_ -#define _CMS_EXCEPTIONLISTENER_H_ - -#include - -namespace cms{ - - class ExceptionListener - { - public: - - /** - * Destructor - */ - virtual ~ExceptionListener(void) {} - - /** - * Called when an exception occurs. - * @param Exception Object that occurred. - */ - virtual void onException(const cms::CMSException& ex) = 0; - - }; - -} - -#endif /*_CMS_EXCEPTIONLISTENER_H_*/ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _CMS_EXCEPTIONLISTENER_H_ +#define _CMS_EXCEPTIONLISTENER_H_ + +#include + +namespace cms{ + + class ExceptionListener + { + public: + + /** + * Destructor + */ + virtual ~ExceptionListener(void) {} + + /** + * Called when an exception occurs. + * @param Exception Object that occurred. + */ + virtual void onException(const cms::CMSException& ex) = 0; + + }; + +} + +#endif /*_CMS_EXCEPTIONLISTENER_H_*/ diff --git a/activemq-cpp/src/main/cms/Message.h b/activemq-cpp/src/main/cms/Message.h index caefcab96a..49f00f2fc8 100644 --- a/activemq-cpp/src/main/cms/Message.h +++ b/activemq-cpp/src/main/cms/Message.h @@ -1,190 +1,190 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _CMS_MESSAGE_H_ -#define _CMS_MESSAGE_H_ - -#include - -#include -#include - -namespace cms{ - - /** - * Root of all messages. - */ - class Message{ - public: - - /** - * Enumeration value for Message Delivery Mode - */ - enum DeliveryMode - { - PERSISTANT, - NONPERSISTANT - }; - - public: - - virtual ~Message(void){} - - /** - * Clonse this message exactly, returns a new instance that the - * caller is required to delete. - * @return new copy of this message - */ - virtual Message* clone(void) const = 0; - - /** - * Acknowledges all consumed messages of the session - * of this consumed message. - */ - virtual void acknowledge(void) const throw( CMSException ) = 0; - - /** - * Retrieves a reference to the properties object owned - * by this message - * @return A Properties Object reference - */ - virtual activemq::util::Properties& getProperties(void) = 0; - virtual const activemq::util::Properties& getProperties(void) const = 0; - - /** - * Get the Correlation Id for this message - * @return string representation of the correlation Id - */ - virtual const char* getCMSCorrelationId(void) const = 0; - - /** - * Sets the Correlation Id used by this message - * @param String representing the correlation id. - */ - virtual void setCMSCorrelationId(const std::string& correlationId) = 0; - - /** - * Sets the DeliveryMode for this message - * @return DeliveryMode enumerated value. - */ - virtual DeliveryMode getCMSDeliveryMode(void) const = 0; - - /** - * Sets the DeliveryMode for this message - * @param DeliveryMode enumerated value. - */ - virtual void setCMSDeliveryMode(DeliveryMode mode) = 0; - - /** - * Gets the Destination for this Message, returns a - * @return Destination object - */ - virtual const Destination& getCMSDestination(void) const = 0; - - /** - * Sets the Destination for this message - * @param Destination Object - */ - virtual void setCMSDestination(const Destination& destination) = 0; - - /** - * Gets the Expiration Time for this Message - * @return time value - */ - virtual long getCMSExpiration(void) const = 0; - - /** - * Sets the Expiration Time for this message - * @param time value - */ - virtual void setCMSExpiration(long expireTime) = 0; - - /** - * Gets the CMS Message Id for this Message - * @return time value - */ - virtual const char* getCMSMessageId(void) const = 0; - - /** - * Sets the CMS Message Id for this message - * @param time value - */ - virtual void setCMSMessageId(const std::string& id) = 0; - - /** - * Gets the Priority Value for this Message - * @return priority value - */ - virtual int getCMSPriority(void) const = 0; - - /** - * Sets the Priority Value for this message - * @param priority value - */ - virtual void setCMSPriority(int priority) = 0; - - /** - * Gets the Redelivered Flag for this Message - * @return redelivered value - */ - virtual bool getCMSRedelivered(void) const = 0; - - /** - * Sets the Redelivered Flag for this message - * @param redelivered value - */ - virtual void setCMSRedelivered(bool redelivered) = 0; - - /** - * Gets the CMS Reply To Address for this Message - * @return Reply To Value - */ - virtual const char* getCMSReplyTo(void) const = 0; - - /** - * Sets the CMS Reply To Address for this message - * @param Reply To value - */ - virtual void setCMSReplyTo(const std::string& id) = 0; - - /** - * Gets the Time Stamp for this Message - * @return time stamp value - */ - virtual long getCMSTimeStamp(void) const = 0; - - /** - * Sets the Time Stamp for this message - * @param time stamp value - */ - virtual void setCMSTimeStamp(long timeStamp) = 0; - - /** - * Gets the CMS Message Type for this Message - * @return type value - */ - virtual const char* getCMSMessageType(void) const = 0; - - /** - * Sets the CMS Message Type for this message - * @param type value - */ - virtual void setCMSMessageType(const std::string& type) = 0; - }; -} - -#endif /*_CMS_MESSAGE_H_*/ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _CMS_MESSAGE_H_ +#define _CMS_MESSAGE_H_ + +#include + +#include +#include + +namespace cms{ + + /** + * Root of all messages. + */ + class Message{ + public: + + /** + * Enumeration value for Message Delivery Mode + */ + enum DeliveryMode + { + PERSISTANT, + NONPERSISTANT + }; + + public: + + virtual ~Message(void){} + + /** + * Clonse this message exactly, returns a new instance that the + * caller is required to delete. + * @return new copy of this message + */ + virtual Message* clone(void) const = 0; + + /** + * Acknowledges all consumed messages of the session + * of this consumed message. + */ + virtual void acknowledge(void) const throw( CMSException ) = 0; + + /** + * Retrieves a reference to the properties object owned + * by this message + * @return A Properties Object reference + */ + virtual activemq::util::Properties& getProperties(void) = 0; + virtual const activemq::util::Properties& getProperties(void) const = 0; + + /** + * Get the Correlation Id for this message + * @return string representation of the correlation Id + */ + virtual const char* getCMSCorrelationId(void) const = 0; + + /** + * Sets the Correlation Id used by this message + * @param String representing the correlation id. + */ + virtual void setCMSCorrelationId(const std::string& correlationId) = 0; + + /** + * Sets the DeliveryMode for this message + * @return DeliveryMode enumerated value. + */ + virtual DeliveryMode getCMSDeliveryMode(void) const = 0; + + /** + * Sets the DeliveryMode for this message + * @param DeliveryMode enumerated value. + */ + virtual void setCMSDeliveryMode(DeliveryMode mode) = 0; + + /** + * Gets the Destination for this Message, returns a + * @return Destination object + */ + virtual const Destination& getCMSDestination(void) const = 0; + + /** + * Sets the Destination for this message + * @param Destination Object + */ + virtual void setCMSDestination(const Destination& destination) = 0; + + /** + * Gets the Expiration Time for this Message + * @return time value + */ + virtual long getCMSExpiration(void) const = 0; + + /** + * Sets the Expiration Time for this message + * @param time value + */ + virtual void setCMSExpiration(long expireTime) = 0; + + /** + * Gets the CMS Message Id for this Message + * @return time value + */ + virtual const char* getCMSMessageId(void) const = 0; + + /** + * Sets the CMS Message Id for this message + * @param time value + */ + virtual void setCMSMessageId(const std::string& id) = 0; + + /** + * Gets the Priority Value for this Message + * @return priority value + */ + virtual int getCMSPriority(void) const = 0; + + /** + * Sets the Priority Value for this message + * @param priority value + */ + virtual void setCMSPriority(int priority) = 0; + + /** + * Gets the Redelivered Flag for this Message + * @return redelivered value + */ + virtual bool getCMSRedelivered(void) const = 0; + + /** + * Sets the Redelivered Flag for this message + * @param redelivered value + */ + virtual void setCMSRedelivered(bool redelivered) = 0; + + /** + * Gets the CMS Reply To Address for this Message + * @return Reply To Value + */ + virtual const char* getCMSReplyTo(void) const = 0; + + /** + * Sets the CMS Reply To Address for this message + * @param Reply To value + */ + virtual void setCMSReplyTo(const std::string& id) = 0; + + /** + * Gets the Time Stamp for this Message + * @return time stamp value + */ + virtual long getCMSTimeStamp(void) const = 0; + + /** + * Sets the Time Stamp for this message + * @param time stamp value + */ + virtual void setCMSTimeStamp(long timeStamp) = 0; + + /** + * Gets the CMS Message Type for this Message + * @return type value + */ + virtual const char* getCMSMessageType(void) const = 0; + + /** + * Sets the CMS Message Type for this message + * @param type value + */ + virtual void setCMSMessageType(const std::string& type) = 0; + }; +} + +#endif /*_CMS_MESSAGE_H_*/ diff --git a/activemq-cpp/src/main/cms/MessageConsumer.h b/activemq-cpp/src/main/cms/MessageConsumer.h index 2e333ede48..ba69888d5a 100644 --- a/activemq-cpp/src/main/cms/MessageConsumer.h +++ b/activemq-cpp/src/main/cms/MessageConsumer.h @@ -1,83 +1,83 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _CMS_MESSAGECONSUMER_H_ -#define _CMS_MESSAGECONSUMER_H_ - -#include -#include - -namespace cms -{ - - class MessageConsumer - { - public: - - /** - * Destructor - */ - virtual ~MessageConsumer(void) {} - - /** - * Synchronously Receive a Message - * @return new message - * @throws CMSException - */ - virtual Message* receive(void) throw ( CMSException ) = 0; - - /** - * Synchronously Receive a Message, time out after defined interval. - * Returns null if nothing read. - * @return new message - * @throws CMSException - */ - virtual Message* receive(int millisecs) throw ( CMSException ) = 0; - - /** - * Receive a Message, does not wait if there isn't a new message - * to read, returns NULL if nothing read. - * @return new message - * @throws CMSException - */ - virtual Message* receiveNoWait(void) throw ( CMSException ) = 0; - - /** - * Sets the MessageListener that this class will send notifs on - * @param MessageListener interface pointer - */ - virtual void setMessageListener(MessageListener* listener) = 0; - - /** - * Gets the MessageListener that this class will send notifs on - * @param MessageListener interface pointer - */ - virtual MessageListener* getMessageListener(void) const = 0; - - /** - * Gets this message consumer's message selector expression. - * @return This Consumer's selector expression or "". - * @throws cms::CMSException - */ - virtual std::string getMessageSelector(void) const - throw ( cms::CMSException ) = 0; - - }; - -} - -#endif /*_CMS_MESSAGECONSUMER_H_*/ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _CMS_MESSAGECONSUMER_H_ +#define _CMS_MESSAGECONSUMER_H_ + +#include +#include + +namespace cms +{ + + class MessageConsumer + { + public: + + /** + * Destructor + */ + virtual ~MessageConsumer(void) {} + + /** + * Synchronously Receive a Message + * @return new message + * @throws CMSException + */ + virtual Message* receive(void) throw ( CMSException ) = 0; + + /** + * Synchronously Receive a Message, time out after defined interval. + * Returns null if nothing read. + * @return new message + * @throws CMSException + */ + virtual Message* receive(int millisecs) throw ( CMSException ) = 0; + + /** + * Receive a Message, does not wait if there isn't a new message + * to read, returns NULL if nothing read. + * @return new message + * @throws CMSException + */ + virtual Message* receiveNoWait(void) throw ( CMSException ) = 0; + + /** + * Sets the MessageListener that this class will send notifs on + * @param MessageListener interface pointer + */ + virtual void setMessageListener(MessageListener* listener) = 0; + + /** + * Gets the MessageListener that this class will send notifs on + * @param MessageListener interface pointer + */ + virtual MessageListener* getMessageListener(void) const = 0; + + /** + * Gets this message consumer's message selector expression. + * @return This Consumer's selector expression or "". + * @throws cms::CMSException + */ + virtual std::string getMessageSelector(void) const + throw ( cms::CMSException ) = 0; + + }; + +} + +#endif /*_CMS_MESSAGECONSUMER_H_*/ diff --git a/activemq-cpp/src/main/cms/MessageListener.h b/activemq-cpp/src/main/cms/MessageListener.h index dcbc5894c7..611ab5d674 100644 --- a/activemq-cpp/src/main/cms/MessageListener.h +++ b/activemq-cpp/src/main/cms/MessageListener.h @@ -1,52 +1,52 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _CMS_MESSAGELISTENER_H_ -#define _CMS_MESSAGELISTENER_H_ - -//#include - -namespace cms{ - - class Message; - - class MessageListener{ - public: - - virtual ~MessageListener(void){} - - /** - * Called asynchronously when a new message is received, the message - * reference can be to any othe Message types. a dynamic cast is used - * to find out what type of message this is. The lifetime of this - * object is only garunteed to be for life of the onMessage function - * after this returns the message may no longer exists. User should - * copy the data or clone the message if they wish to keep something - * around about this message. - * - * It is considered a programming error for this method to throw and - * exception. - * - * @param Message object reference - */ - virtual void onMessage( const Message& message ) = 0; - - }; - -} - -#endif /*_CMS_MESSAGELISTENER_H_*/ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _CMS_MESSAGELISTENER_H_ +#define _CMS_MESSAGELISTENER_H_ + +//#include + +namespace cms{ + + class Message; + + class MessageListener{ + public: + + virtual ~MessageListener(void){} + + /** + * Called asynchronously when a new message is received, the message + * reference can be to any othe Message types. a dynamic cast is used + * to find out what type of message this is. The lifetime of this + * object is only garunteed to be for life of the onMessage function + * after this returns the message may no longer exists. User should + * copy the data or clone the message if they wish to keep something + * around about this message. + * + * It is considered a programming error for this method to throw and + * exception. + * + * @param Message object reference + */ + virtual void onMessage( const Message& message ) = 0; + + }; + +} + +#endif /*_CMS_MESSAGELISTENER_H_*/ diff --git a/activemq-cpp/src/main/cms/MessageProducer.h b/activemq-cpp/src/main/cms/MessageProducer.h index 34452f0708..5fd9ea370a 100644 --- a/activemq-cpp/src/main/cms/MessageProducer.h +++ b/activemq-cpp/src/main/cms/MessageProducer.h @@ -1,120 +1,120 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _CMS_MESSAGEPRODUCER_H_ -#define _CMS_MESSAGEPRODUCER_H_ - -#include -#include -#include - -namespace cms -{ - /** - * defines the MEssageProducer interface that is used - * by all MessageProducer derivations. This class defines the JMS - * spec'd interface for a MessageProducer. - */ - class MessageProducer - { - public: - - /** - * Destructor - */ - virtual ~MessageProducer(void) {} - - /** - * Sends the message to the default producer destination. - * @param a Message Object Pointer - * @throws CMSException - */ - virtual void send(Message& message) throw ( CMSException ) = 0; - - /** - * Sends the message to the designated destination. - * @param a Message Object Pointer - * @throws CMSException - */ - virtual void send(const Destination& destination, - Message& message) throw ( CMSException ) = 0; - - /** - * Sets the delivery mode for this Producer - * @param The DeliveryMode - */ - virtual void setDeliveryMode(Message::DeliveryMode mode) = 0; - - /** - * Gets the delivery mode for this Producer - * @return The DeliveryMode - */ - virtual Message::DeliveryMode getDeliveryMode(void) const = 0; - - /** - * Sets if Message Ids are disbled for this Producer - * @param boolean indicating enable / disable (true / false) - */ - virtual void setDisableMessageId(bool value) = 0; - - /** - * Sets if Message Ids are disbled for this Producer - * @param boolean indicating enable / disable (true / false) - */ - virtual bool getDisableMessageId(void) const = 0; - - /** - * Sets if Message Time Stamps are disbled for this Producer - * @param boolean indicating enable / disable (true / false) - */ - virtual void setDisableMessageTimeStamp(bool value) = 0; - - /** - * Sets if Message Time Stamps are disbled for this Producer - * @param boolean indicating enable / disable (true / false) - */ - virtual bool getDisableMessageTimeStamp(void) const = 0; - - /** - * Sets the Priority that this Producers sends messages at - * @param int value for Priority level - */ - virtual void setPriority(int priority) = 0; - - /** - * Gets the Priority level that this producer sends messages at - * @return int based priority level - */ - virtual int getPriority(void) const = 0; - - /** - * Sets the Time to Live that this Producers sends messages with - * @param int value for time to live - */ - virtual void setTimeToLive(int time) = 0; - - /** - * Gets the Time to Live that this producer sends messages with - * @return int based Time to Live - */ - virtual int getTimeToLive(void) const = 0; - - }; - -} - -#endif /*_CMS_MESSAGEPRODUCER_H_*/ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _CMS_MESSAGEPRODUCER_H_ +#define _CMS_MESSAGEPRODUCER_H_ + +#include +#include +#include + +namespace cms +{ + /** + * defines the MEssageProducer interface that is used + * by all MessageProducer derivations. This class defines the JMS + * spec'd interface for a MessageProducer. + */ + class MessageProducer + { + public: + + /** + * Destructor + */ + virtual ~MessageProducer(void) {} + + /** + * Sends the message to the default producer destination. + * @param a Message Object Pointer + * @throws CMSException + */ + virtual void send(Message& message) throw ( CMSException ) = 0; + + /** + * Sends the message to the designated destination. + * @param a Message Object Pointer + * @throws CMSException + */ + virtual void send(const Destination& destination, + Message& message) throw ( CMSException ) = 0; + + /** + * Sets the delivery mode for this Producer + * @param The DeliveryMode + */ + virtual void setDeliveryMode(Message::DeliveryMode mode) = 0; + + /** + * Gets the delivery mode for this Producer + * @return The DeliveryMode + */ + virtual Message::DeliveryMode getDeliveryMode(void) const = 0; + + /** + * Sets if Message Ids are disbled for this Producer + * @param boolean indicating enable / disable (true / false) + */ + virtual void setDisableMessageId(bool value) = 0; + + /** + * Sets if Message Ids are disbled for this Producer + * @param boolean indicating enable / disable (true / false) + */ + virtual bool getDisableMessageId(void) const = 0; + + /** + * Sets if Message Time Stamps are disbled for this Producer + * @param boolean indicating enable / disable (true / false) + */ + virtual void setDisableMessageTimeStamp(bool value) = 0; + + /** + * Sets if Message Time Stamps are disbled for this Producer + * @param boolean indicating enable / disable (true / false) + */ + virtual bool getDisableMessageTimeStamp(void) const = 0; + + /** + * Sets the Priority that this Producers sends messages at + * @param int value for Priority level + */ + virtual void setPriority(int priority) = 0; + + /** + * Gets the Priority level that this producer sends messages at + * @return int based priority level + */ + virtual int getPriority(void) const = 0; + + /** + * Sets the Time to Live that this Producers sends messages with + * @param int value for time to live + */ + virtual void setTimeToLive(int time) = 0; + + /** + * Gets the Time to Live that this producer sends messages with + * @return int based Time to Live + */ + virtual int getTimeToLive(void) const = 0; + + }; + +} + +#endif /*_CMS_MESSAGEPRODUCER_H_*/ diff --git a/activemq-cpp/src/main/cms/Queue.h b/activemq-cpp/src/main/cms/Queue.h index 8bc86c7948..07f5774e7b 100644 --- a/activemq-cpp/src/main/cms/Queue.h +++ b/activemq-cpp/src/main/cms/Queue.h @@ -1,46 +1,46 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _CMS_QUEUE_H_ -#define _CMS_QUEUE_H_ - -#include -#include - -namespace cms{ - - /** - * An interface encapsulating a provider-specific queue name. - */ - class Queue : public Destination{ - - public: - - virtual ~Queue(void){} - - /** - * Gets the name of this queue. - * @return The queue name. - */ - virtual std::string getQueueName() const - throw( CMSException ) = 0; - - }; - -} - -#endif /*_CMS_QUEUE_H_*/ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _CMS_QUEUE_H_ +#define _CMS_QUEUE_H_ + +#include +#include + +namespace cms{ + + /** + * An interface encapsulating a provider-specific queue name. + */ + class Queue : public Destination{ + + public: + + virtual ~Queue(void){} + + /** + * Gets the name of this queue. + * @return The queue name. + */ + virtual std::string getQueueName() const + throw( CMSException ) = 0; + + }; + +} + +#endif /*_CMS_QUEUE_H_*/ diff --git a/activemq-cpp/src/main/cms/Session.h b/activemq-cpp/src/main/cms/Session.h index ce806d389c..5943c9a124 100644 --- a/activemq-cpp/src/main/cms/Session.h +++ b/activemq-cpp/src/main/cms/Session.h @@ -1,232 +1,232 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -#ifndef _CMS_SESSION_H_ -#define _CMS_SESSION_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace cms -{ - - class Session : public Closeable - { - public: - - enum AcknowledgeMode - { - /** - * 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. - */ - AutoAcknowledge, - - /** - * 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. - */ - DupsOkAcknowledge, - - /** - * With this acknowledgment mode, the client acknowledges a - * consumed message by calling the message's acknowledge method. - */ - ClientAcknowledge, - - /** - * Messages will be consumed when the transaction commits. - */ - Transactional - }; - - public: - - /** - * Destructor - */ - virtual ~Session(void) {} - - /** - * Commits all messages done in this transaction and releases any - * locks currently held. - * @throws CMSException - */ - virtual void commit(void) throw ( CMSException ) = 0; - - /** - * Rollsback all messages done in this transaction and releases any - * locks currently held. - * @throws CMSException - */ - virtual void rollback(void) throw ( CMSException ) = 0; - - /** - * Creates a MessageConsumer for the specified destination. - * @param the Destination that this consumer receiving messages for. - * @throws CMSException - */ - virtual MessageConsumer* createConsumer( - Destination& destination ) - throw ( CMSException ) = 0; - - /** - * Creates a MessageConsumer for the specified destination, using a - * message selector. - * @param the Destination that this consumer receiving messages for. - * @throws CMSException - */ - virtual MessageConsumer* createConsumer( - Destination& destination, - const std::string& selector ) - throw ( CMSException ) = 0; - - /** - * Creates a durable subscriber to the specified topic, using a - * message selector - * @param the topic to subscribe to - * @param name used to identify the subscription - * @param only messages matching the selector are received - * @throws CMSException - */ - virtual MessageConsumer* createDurableConsumer( - Topic& destination, - const std::string& name, - const std::string& selector, - bool noLocal = false ) - throw ( CMSException ) = 0; - - /** - * Creates a MessageProducer to send messages to the specified - * destination. - * @param the Destination to publish on - * @throws CMSException - */ - virtual MessageProducer* createProducer( Destination& destination ) - throw ( CMSException ) = 0; - - /** - * Creates a queue identity given a Queue name. - * @param the name of the new Queue - * @throws CMSException - */ - virtual Queue* createQueue( const std::string& queueName ) - throw ( CMSException ) = 0; - - /** - * Creates a topic identity given a Queue name. - * @param the name of the new Topic - * @throws CMSException - */ - virtual Topic* createTopic( const std::string& topicName ) - throw ( CMSException ) = 0; - - /** - * Creates a TemporaryQueue object. - * @throws CMSException - */ - virtual TemporaryQueue* createTemporaryQueue(void) - throw ( CMSException ) = 0; - - /** - * Creates a TemporaryTopic object. - * @throws CMSException - */ - virtual TemporaryTopic* createTemporaryTopic(void) - throw ( CMSException ) = 0; - - /** - * Creates a new Message - * @throws CMSException - */ - virtual Message* createMessage(void) - throw ( CMSException ) = 0; - - /** - * Creates a BytesMessage - * @throws CMSException - */ - virtual BytesMessage* createBytesMessage(void) - throw ( CMSException) = 0; - - /** - * Creates a BytesMessage and sets the paylod to the passed value - * @param an array of bytes to set in the message - * @param the size of the bytes array, or number of bytes to use - * @throws CMSException - */ - virtual BytesMessage* createBytesMessage( - const unsigned char* bytes, - unsigned long bytesSize ) - throw ( CMSException) = 0; - - /** - * Creates a new TextMessage - * @throws CMSException - */ - virtual TextMessage* createTextMessage(void) - throw ( CMSException ) = 0; - - /** - * Creates a new TextMessage and set the text to the value given - * @param the initial text for the message - * @throws CMSException - */ - virtual TextMessage* createTextMessage( const std::string& text ) - throw ( CMSException ) = 0; - - /** - * Creates a new MapMessage - * @throws CMSException - */ - virtual MapMessage* createMapMessage(void) - throw ( CMSException ) = 0; - - /** - * Returns the acknowledgement mode of the session. - * @return the Sessions Acknowledge Mode - */ - virtual AcknowledgeMode getAcknowledgeMode(void) const = 0; - - /** - * Gets if the Sessions is a Transacted Session - * @return transacted true - false. - */ - virtual bool isTransacted(void) const = 0; - - }; - -} - -#endif /*_CMS_SESSION_H_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +#ifndef _CMS_SESSION_H_ +#define _CMS_SESSION_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace cms +{ + + class Session : public Closeable + { + public: + + enum AcknowledgeMode + { + /** + * 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. + */ + AutoAcknowledge, + + /** + * 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. + */ + DupsOkAcknowledge, + + /** + * With this acknowledgment mode, the client acknowledges a + * consumed message by calling the message's acknowledge method. + */ + ClientAcknowledge, + + /** + * Messages will be consumed when the transaction commits. + */ + Transactional + }; + + public: + + /** + * Destructor + */ + virtual ~Session(void) {} + + /** + * Commits all messages done in this transaction and releases any + * locks currently held. + * @throws CMSException + */ + virtual void commit(void) throw ( CMSException ) = 0; + + /** + * Rollsback all messages done in this transaction and releases any + * locks currently held. + * @throws CMSException + */ + virtual void rollback(void) throw ( CMSException ) = 0; + + /** + * Creates a MessageConsumer for the specified destination. + * @param the Destination that this consumer receiving messages for. + * @throws CMSException + */ + virtual MessageConsumer* createConsumer( + Destination& destination ) + throw ( CMSException ) = 0; + + /** + * Creates a MessageConsumer for the specified destination, using a + * message selector. + * @param the Destination that this consumer receiving messages for. + * @throws CMSException + */ + virtual MessageConsumer* createConsumer( + Destination& destination, + const std::string& selector ) + throw ( CMSException ) = 0; + + /** + * Creates a durable subscriber to the specified topic, using a + * message selector + * @param the topic to subscribe to + * @param name used to identify the subscription + * @param only messages matching the selector are received + * @throws CMSException + */ + virtual MessageConsumer* createDurableConsumer( + Topic& destination, + const std::string& name, + const std::string& selector, + bool noLocal = false ) + throw ( CMSException ) = 0; + + /** + * Creates a MessageProducer to send messages to the specified + * destination. + * @param the Destination to publish on + * @throws CMSException + */ + virtual MessageProducer* createProducer( Destination& destination ) + throw ( CMSException ) = 0; + + /** + * Creates a queue identity given a Queue name. + * @param the name of the new Queue + * @throws CMSException + */ + virtual Queue* createQueue( const std::string& queueName ) + throw ( CMSException ) = 0; + + /** + * Creates a topic identity given a Queue name. + * @param the name of the new Topic + * @throws CMSException + */ + virtual Topic* createTopic( const std::string& topicName ) + throw ( CMSException ) = 0; + + /** + * Creates a TemporaryQueue object. + * @throws CMSException + */ + virtual TemporaryQueue* createTemporaryQueue(void) + throw ( CMSException ) = 0; + + /** + * Creates a TemporaryTopic object. + * @throws CMSException + */ + virtual TemporaryTopic* createTemporaryTopic(void) + throw ( CMSException ) = 0; + + /** + * Creates a new Message + * @throws CMSException + */ + virtual Message* createMessage(void) + throw ( CMSException ) = 0; + + /** + * Creates a BytesMessage + * @throws CMSException + */ + virtual BytesMessage* createBytesMessage(void) + throw ( CMSException) = 0; + + /** + * Creates a BytesMessage and sets the paylod to the passed value + * @param an array of bytes to set in the message + * @param the size of the bytes array, or number of bytes to use + * @throws CMSException + */ + virtual BytesMessage* createBytesMessage( + const unsigned char* bytes, + unsigned long bytesSize ) + throw ( CMSException) = 0; + + /** + * Creates a new TextMessage + * @throws CMSException + */ + virtual TextMessage* createTextMessage(void) + throw ( CMSException ) = 0; + + /** + * Creates a new TextMessage and set the text to the value given + * @param the initial text for the message + * @throws CMSException + */ + virtual TextMessage* createTextMessage( const std::string& text ) + throw ( CMSException ) = 0; + + /** + * Creates a new MapMessage + * @throws CMSException + */ + virtual MapMessage* createMapMessage(void) + throw ( CMSException ) = 0; + + /** + * Returns the acknowledgement mode of the session. + * @return the Sessions Acknowledge Mode + */ + virtual AcknowledgeMode getAcknowledgeMode(void) const = 0; + + /** + * Gets if the Sessions is a Transacted Session + * @return transacted true - false. + */ + virtual bool isTransacted(void) const = 0; + + }; + +} + +#endif /*_CMS_SESSION_H_*/ diff --git a/activemq-cpp/src/main/cms/TemporaryTopic.h b/activemq-cpp/src/main/cms/TemporaryTopic.h index 7c81215f37..af21a26ef2 100644 --- a/activemq-cpp/src/main/cms/TemporaryTopic.h +++ b/activemq-cpp/src/main/cms/TemporaryTopic.h @@ -1,46 +1,46 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _CMS_TEMPORARYTOPIC_H_ -#define _CMS_TEMPORARYTOPIC_H_ - -#include -#include - -namespace cms{ - - /** - * An interface encapsulating a provider-specific topic name. - */ - class TemporaryTopic : public Destination - { - public: - - virtual ~TemporaryTopic(void) {} - - /** - * Gets the name of this topic. - * @return The topic name. - */ - virtual const char* getTopicName(void) - const throw( CMSException ) = 0; - - }; - -} - -#endif /*_CMS_TEMPORARYTOPIC_H_*/ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _CMS_TEMPORARYTOPIC_H_ +#define _CMS_TEMPORARYTOPIC_H_ + +#include +#include + +namespace cms{ + + /** + * An interface encapsulating a provider-specific topic name. + */ + class TemporaryTopic : public Destination + { + public: + + virtual ~TemporaryTopic(void) {} + + /** + * Gets the name of this topic. + * @return The topic name. + */ + virtual const char* getTopicName(void) + const throw( CMSException ) = 0; + + }; + +} + +#endif /*_CMS_TEMPORARYTOPIC_H_*/ diff --git a/activemq-cpp/src/main/cms/TextMessage.h b/activemq-cpp/src/main/cms/TextMessage.h index 378cb7484d..5d163a19f4 100644 --- a/activemq-cpp/src/main/cms/TextMessage.h +++ b/activemq-cpp/src/main/cms/TextMessage.h @@ -1,49 +1,49 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _CMS_TEXTMESSAGE_H_ -#define _CMS_TEXTMESSAGE_H_ - -#include -#include - -namespace cms{ - - /** - * Interface for a text message. - */ - class TextMessage : public Message{ - - public: - - virtual ~TextMessage(){} - - /** - * Gets the message character buffer. - * @return The message character buffer. - */ - virtual const char* getText() const throw( CMSException ) = 0; - - /** - * Sets the message contents. - * @param msg The message buffer. - */ - virtual void setText( const char* msg ) throw( CMSException ) = 0; - }; -} - -#endif /*_CMS_TEXTMESSAGE_H_*/ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _CMS_TEXTMESSAGE_H_ +#define _CMS_TEXTMESSAGE_H_ + +#include +#include + +namespace cms{ + + /** + * Interface for a text message. + */ + class TextMessage : public Message{ + + public: + + virtual ~TextMessage(){} + + /** + * Gets the message character buffer. + * @return The message character buffer. + */ + virtual const char* getText() const throw( CMSException ) = 0; + + /** + * Sets the message contents. + * @param msg The message buffer. + */ + virtual void setText( const char* msg ) throw( CMSException ) = 0; + }; +} + +#endif /*_CMS_TEXTMESSAGE_H_*/ diff --git a/activemq-cpp/src/main/cms/Topic.h b/activemq-cpp/src/main/cms/Topic.h index 5a882eef6c..a9f1497184 100644 --- a/activemq-cpp/src/main/cms/Topic.h +++ b/activemq-cpp/src/main/cms/Topic.h @@ -1,46 +1,46 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _CMS_TOPIC_ -#define _CMS_TOPIC_ - -#include -#include - -namespace cms{ - - /** - * An interface encapsulating a provider-specific topic name. - */ - class Topic : public Destination{ - - public: - - virtual ~Topic(void) {} - - /** - * Gets the name of this topic. - * @return The topic name. - */ - virtual std::string getTopicName(void) - const throw( CMSException ) = 0; - - }; - -} - -#endif /*_CMS_TOPIC_*/ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _CMS_TOPIC_ +#define _CMS_TOPIC_ + +#include +#include + +namespace cms{ + + /** + * An interface encapsulating a provider-specific topic name. + */ + class Topic : public Destination{ + + public: + + virtual ~Topic(void) {} + + /** + * Gets the name of this topic. + * @return The topic name. + */ + virtual std::string getTopicName(void) + const throw( CMSException ) = 0; + + }; + +} + +#endif /*_CMS_TOPIC_*/ diff --git a/activemq-cpp/src/test-integration/integration/common/AbstractTester.h b/activemq-cpp/src/test-integration/integration/common/AbstractTester.h index 3183bdf6da..691164dc2a 100644 --- a/activemq-cpp/src/test-integration/integration/common/AbstractTester.h +++ b/activemq-cpp/src/test-integration/integration/common/AbstractTester.h @@ -1,51 +1,51 @@ -#ifndef _INTEGRATION_COMMON_ABSTRACTTESTER_H_ -#define _INTEGRATION_COMMON_ABSTRACTTESTER_H_ - -#include "Tester.h" - -#include - -#include -#include -#include -#include - -namespace integration{ -namespace common{ - - class AbstractTester : public Tester - { - public: - - AbstractTester( cms::Session::AcknowledgeMode ackMode = - cms::Session::AutoAcknowledge ); - virtual ~AbstractTester(); - - virtual void doSleep(void); - - virtual unsigned int produceTextMessages( - cms::MessageProducer& producer, - unsigned int count ); - virtual unsigned int produceBytesMessages( - cms::MessageProducer& producer, - unsigned int count ); - - virtual void waitForMessages( unsigned int count ); - - virtual void onException( const cms::CMSException& error ); - virtual void onMessage( const cms::Message& message ); - - public: - - cms::ConnectionFactory* connectionFactory; - cms::Connection* connection; - cms::Session* session; - - unsigned int numReceived; - activemq::concurrent::Mutex mutex; - - }; - -}} - -#endif /*_INTEGRATION_COMMON_ABSTRACTTESTER_H_*/ +#ifndef _INTEGRATION_COMMON_ABSTRACTTESTER_H_ +#define _INTEGRATION_COMMON_ABSTRACTTESTER_H_ + +#include "Tester.h" + +#include + +#include +#include +#include +#include + +namespace integration{ +namespace common{ + + class AbstractTester : public Tester + { + public: + + AbstractTester( cms::Session::AcknowledgeMode ackMode = + cms::Session::AutoAcknowledge ); + virtual ~AbstractTester(); + + virtual void doSleep(void); + + virtual unsigned int produceTextMessages( + cms::MessageProducer& producer, + unsigned int count ); + virtual unsigned int produceBytesMessages( + cms::MessageProducer& producer, + unsigned int count ); + + virtual void waitForMessages( unsigned int count ); + + virtual void onException( const cms::CMSException& error ); + virtual void onMessage( const cms::Message& message ); + + public: + + cms::ConnectionFactory* connectionFactory; + cms::Connection* connection; + cms::Session* session; + + unsigned int numReceived; + activemq::concurrent::Mutex mutex; + + }; + +}} + +#endif /*_INTEGRATION_COMMON_ABSTRACTTESTER_H_*/ diff --git a/activemq-cpp/src/test-integration/integration/common/IntegrationCommon.h b/activemq-cpp/src/test-integration/integration/common/IntegrationCommon.h index 1b07e4adc8..6d1e0a06c7 100644 --- a/activemq-cpp/src/test-integration/integration/common/IntegrationCommon.h +++ b/activemq-cpp/src/test-integration/integration/common/IntegrationCommon.h @@ -1,23 +1,23 @@ -#ifndef _INTEGRATION_COMMON_INTEGRATIONCOMMON_H_ -#define _INTEGRATION_COMMON_INTEGRATIONCOMMON_H_ - -#include - -namespace integration{ -namespace common{ - - class IntegrationCommon - { - public: - - virtual ~IntegrationCommon(); - - static const std::string defaultURL; - static const int defaultDelay; - static const unsigned int defaultMsgCount; - - }; - -}} - -#endif /*_INTEGRATION_COMMON_INTEGRATIONCOMMON_H_*/ +#ifndef _INTEGRATION_COMMON_INTEGRATIONCOMMON_H_ +#define _INTEGRATION_COMMON_INTEGRATIONCOMMON_H_ + +#include + +namespace integration{ +namespace common{ + + class IntegrationCommon + { + public: + + virtual ~IntegrationCommon(); + + static const std::string defaultURL; + static const int defaultDelay; + static const unsigned int defaultMsgCount; + + }; + +}} + +#endif /*_INTEGRATION_COMMON_INTEGRATIONCOMMON_H_*/ diff --git a/activemq-cpp/src/test-integration/integration/common/Tester.h b/activemq-cpp/src/test-integration/integration/common/Tester.h index f1371ef995..db895f1776 100644 --- a/activemq-cpp/src/test-integration/integration/common/Tester.h +++ b/activemq-cpp/src/test-integration/integration/common/Tester.h @@ -1,24 +1,24 @@ -#ifndef _INTEGRATION_COMMON_TESTER_H_ -#define _INTEGRATION_COMMON_TESTER_H_ - -#include -#include - - -namespace integration{ -namespace common{ - - class Tester : public cms::ExceptionListener, - public cms::MessageListener - { - public: - - virtual ~Tester() {} - - virtual void test(void) = 0; - - }; - -}} - -#endif /*_INTEGRATION_COMMON_TESTER_H_*/ +#ifndef _INTEGRATION_COMMON_TESTER_H_ +#define _INTEGRATION_COMMON_TESTER_H_ + +#include +#include + + +namespace integration{ +namespace common{ + + class Tester : public cms::ExceptionListener, + public cms::MessageListener + { + public: + + virtual ~Tester() {} + + virtual void test(void) = 0; + + }; + +}} + +#endif /*_INTEGRATION_COMMON_TESTER_H_*/ diff --git a/activemq-cpp/src/test-integration/integration/durable/DurableTester.h b/activemq-cpp/src/test-integration/integration/durable/DurableTester.h index 8b6a419f63..cfb2cfcc56 100644 --- a/activemq-cpp/src/test-integration/integration/durable/DurableTester.h +++ b/activemq-cpp/src/test-integration/integration/durable/DurableTester.h @@ -1,32 +1,32 @@ -#ifndef _INTEGRATION_TRANSACTIONAL_DURABLETESTER_H_ -#define _INTEGRATION_TRANSACTIONAL_DURABLETESTER_H_ - -#include - -#include -#include - -namespace integration{ -namespace durable{ - - class DurableTester : public CppUnit::TestFixture, - public common::AbstractTester - { - CPPUNIT_TEST_SUITE( DurableTester ); - CPPUNIT_TEST( test ); - CPPUNIT_TEST_SUITE_END(); - - public: - - DurableTester(); - virtual ~DurableTester(); - - virtual void test(void); - - private: - - }; - -}} - -#endif /*_INTEGRATION_TRANSACTIONAL_DURABLETESTER_H_*/ +#ifndef _INTEGRATION_TRANSACTIONAL_DURABLETESTER_H_ +#define _INTEGRATION_TRANSACTIONAL_DURABLETESTER_H_ + +#include + +#include +#include + +namespace integration{ +namespace durable{ + + class DurableTester : public CppUnit::TestFixture, + public common::AbstractTester + { + CPPUNIT_TEST_SUITE( DurableTester ); + CPPUNIT_TEST( test ); + CPPUNIT_TEST_SUITE_END(); + + public: + + DurableTester(); + virtual ~DurableTester(); + + virtual void test(void); + + private: + + }; + +}} + +#endif /*_INTEGRATION_TRANSACTIONAL_DURABLETESTER_H_*/ diff --git a/activemq-cpp/src/test-integration/integration/simple/SimpleTester.h b/activemq-cpp/src/test-integration/integration/simple/SimpleTester.h index 202ee1f4c0..5bb735f1ae 100644 --- a/activemq-cpp/src/test-integration/integration/simple/SimpleTester.h +++ b/activemq-cpp/src/test-integration/integration/simple/SimpleTester.h @@ -1,30 +1,30 @@ -#ifndef _INTEGRATION_SIMPLE_SIMPLETESTER_H_ -#define _INTEGRATION_SIMPLE_SIMPLETESTER_H_ - -#include -#include - -#include - -namespace integration{ -namespace simple{ - - class SimpleTester : public CppUnit::TestFixture, - public common::AbstractTester - { - CPPUNIT_TEST_SUITE( SimpleTester ); - CPPUNIT_TEST( test ); - CPPUNIT_TEST_SUITE_END(); - - public: - - SimpleTester(); - virtual ~SimpleTester(); - - virtual void test(void); - - }; - -}} - -#endif /*_INTEGRATION_SIMPLE_SIMPLETESTER_H_*/ +#ifndef _INTEGRATION_SIMPLE_SIMPLETESTER_H_ +#define _INTEGRATION_SIMPLE_SIMPLETESTER_H_ + +#include +#include + +#include + +namespace integration{ +namespace simple{ + + class SimpleTester : public CppUnit::TestFixture, + public common::AbstractTester + { + CPPUNIT_TEST_SUITE( SimpleTester ); + CPPUNIT_TEST( test ); + CPPUNIT_TEST_SUITE_END(); + + public: + + SimpleTester(); + virtual ~SimpleTester(); + + virtual void test(void); + + }; + +}} + +#endif /*_INTEGRATION_SIMPLE_SIMPLETESTER_H_*/ diff --git a/activemq-cpp/src/test-integration/integration/transactional/TransactionTester.h b/activemq-cpp/src/test-integration/integration/transactional/TransactionTester.h index e488290ae5..9f7a7b2fec 100644 --- a/activemq-cpp/src/test-integration/integration/transactional/TransactionTester.h +++ b/activemq-cpp/src/test-integration/integration/transactional/TransactionTester.h @@ -1,32 +1,32 @@ -#ifndef _INTEGRATION_TRANSACTIONAL_TRANSACTIONTESTER_H_ -#define _INTEGRATION_TRANSACTIONAL_TRANSACTIONTESTER_H_ - -#include - -#include -#include - -namespace integration{ -namespace transactional{ - - class TransactionTester : public CppUnit::TestFixture, - public common::AbstractTester - { - CPPUNIT_TEST_SUITE( TransactionTester ); - CPPUNIT_TEST( test ); - CPPUNIT_TEST_SUITE_END(); - - public: - - TransactionTester(); - virtual ~TransactionTester(); - - virtual void test(void); - - private: - - }; - -}} - -#endif /*_INTEGRATION_TRANSACTIONAL_TRANSACTIONTESTER_H_*/ +#ifndef _INTEGRATION_TRANSACTIONAL_TRANSACTIONTESTER_H_ +#define _INTEGRATION_TRANSACTIONAL_TRANSACTIONTESTER_H_ + +#include + +#include +#include + +namespace integration{ +namespace transactional{ + + class TransactionTester : public CppUnit::TestFixture, + public common::AbstractTester + { + CPPUNIT_TEST_SUITE( TransactionTester ); + CPPUNIT_TEST( test ); + CPPUNIT_TEST_SUITE_END(); + + public: + + TransactionTester(); + virtual ~TransactionTester(); + + virtual void test(void); + + private: + + }; + +}} + +#endif /*_INTEGRATION_TRANSACTIONAL_TRANSACTIONTESTER_H_*/