set the eol style to native

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@419370 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-07-05 22:33:50 +00:00
parent 9f7dcf7139
commit 1c0d2eb886
20 changed files with 1376 additions and 1376 deletions

View File

@ -1,62 +1,62 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef _CMS_BYTESMESSAGE_H_ #ifndef _CMS_BYTESMESSAGE_H_
#define _CMS_BYTESMESSAGE_H_ #define _CMS_BYTESMESSAGE_H_
#include <cms/Message.h> #include <cms/Message.h>
namespace cms{ namespace cms{
class BytesMessage : public Message{ class BytesMessage : public Message{
public: public:
/** /**
* Destructor * Destructor
*/ */
virtual ~BytesMessage(){} virtual ~BytesMessage(){}
/** /**
* sets the bytes given to the message body. * sets the bytes given to the message body.
* @param Byte Buffer to copy * @param Byte Buffer to copy
* @param Number of bytes in Buffer to copy * @param Number of bytes in Buffer to copy
* @throws CMSException * @throws CMSException
*/ */
virtual void setBodyBytes( virtual void setBodyBytes(
const unsigned char* buffer, const unsigned long numBytes ) const unsigned char* buffer, const unsigned long numBytes )
throw( CMSException ) = 0; throw( CMSException ) = 0;
/** /**
* Gets the bytes that are contained in this message, user should * Gets the bytes that are contained in this message, user should
* copy this data into a user allocated buffer. Call * copy this data into a user allocated buffer. Call
* <code>getBodyLength</code> to determine the number of bytes * <code>getBodyLength</code> to determine the number of bytes
* to expect. * to expect.
* @return const pointer to a byte buffer * @return const pointer to a byte buffer
*/ */
virtual const unsigned char* getBodyBytes(void) const = 0; virtual const unsigned char* getBodyBytes(void) const = 0;
/** /**
* Returns the number of bytes contained in the body of this message. * Returns the number of bytes contained in the body of this message.
* @return number of bytes. * @return number of bytes.
*/ */
virtual unsigned long getBodyLength(void) const = 0; virtual unsigned long getBodyLength(void) const = 0;
}; };
} }
#endif /*_CMS_BYTESMESSAGE_H_*/ #endif /*_CMS_BYTESMESSAGE_H_*/

View File

@ -1,76 +1,76 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef _CMS_CONNECTION_H_ #ifndef _CMS_CONNECTION_H_
#define _CMS_CONNECTION_H_ #define _CMS_CONNECTION_H_
#include <cms/Startable.h> #include <cms/Startable.h>
#include <cms/Stoppable.h> #include <cms/Stoppable.h>
#include <cms/Closeable.h> #include <cms/Closeable.h>
#include <cms/Session.h> #include <cms/Session.h>
namespace cms namespace cms
{ {
class ExceptionListener; class ExceptionListener;
class Connection : class Connection :
public Startable, public Startable,
public Stoppable, public Stoppable,
public Closeable public Closeable
{ {
public: public:
/** /**
* Destructor * Destructor
*/ */
virtual ~Connection(void) {} virtual ~Connection(void) {}
/** /**
* Creates a new Session to work for this Connection * Creates a new Session to work for this Connection
*/ */
virtual Session* createSession(void) throw ( CMSException ) = 0; virtual Session* createSession(void) throw ( CMSException ) = 0;
/** /**
* Creates a new Session to work for this Connection using the * Creates a new Session to work for this Connection using the
* specified acknowledgment mode * specified acknowledgment mode
* @param the Acknowledgement Mode to use. * @param the Acknowledgement Mode to use.
*/ */
virtual Session* createSession(Session::AcknowledgeMode ackMode) virtual Session* createSession(Session::AcknowledgeMode ackMode)
throw ( CMSException ) = 0; throw ( CMSException ) = 0;
/** /**
* Get the Client Id for this session * Get the Client Id for this session
*/ */
virtual std::string getClientId(void) const = 0; virtual std::string getClientId(void) const = 0;
/** /**
* Gets the registered Exception Listener for this connection * Gets the registered Exception Listener for this connection
* @return pointer to an exception listnener or NULL * @return pointer to an exception listnener or NULL
*/ */
virtual ExceptionListener* getExceptionListener(void) const = 0; virtual ExceptionListener* getExceptionListener(void) const = 0;
/** /**
* Sets the registed Exception Listener for this connection * Sets the registed Exception Listener for this connection
* @param pointer to and <code>ExceptionListener</code> * @param pointer to and <code>ExceptionListener</code>
*/ */
virtual void setExceptionListener(ExceptionListener* listener) = 0; virtual void setExceptionListener(ExceptionListener* listener) = 0;
}; };
} }
#endif /*_CMS_CONNECTION_H_*/ #endif /*_CMS_CONNECTION_H_*/

View File

@ -1,61 +1,61 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef _CMS_CONNECTIONFACTORY_H_ #ifndef _CMS_CONNECTIONFACTORY_H_
#define _CMS_CONNECTIONFACTORY_H_ #define _CMS_CONNECTIONFACTORY_H_
#include <cms/Connection.h> #include <cms/Connection.h>
#include <cms/CMSException.h> #include <cms/CMSException.h>
#include <string> #include <string>
namespace cms namespace cms
{ {
class ConnectionFactory class ConnectionFactory
{ {
public: public:
/** /**
* Destructor * Destructor
*/ */
virtual ~ConnectionFactory(void) {} virtual ~ConnectionFactory(void) {}
/** /**
* Creates a connection with the default user identity. The * Creates a connection with the default user identity. The
* connection is created in stopped mode. No messages will be * connection is created in stopped mode. No messages will be
* delivered until the Connection.start method is explicitly * delivered until the Connection.start method is explicitly
* called. * called.
* @throws CMSException * @throws CMSException
*/ */
virtual Connection* createConnection(void) throw ( CMSException ) = 0; virtual Connection* createConnection(void) throw ( CMSException ) = 0;
/** /**
* Creates a connection with the specified user identity. The * Creates a connection with the specified user identity. The
* connection is created in stopped mode. No messages will be * connection is created in stopped mode. No messages will be
* delivered until the Connection.start method is explicitly called. * delivered until the Connection.start method is explicitly called.
* @throw CMSException. * @throw CMSException.
*/ */
virtual Connection* createConnection(const std::string& username, virtual Connection* createConnection(const std::string& username,
const std::string& password, const std::string& password,
const std::string& clientId) const std::string& clientId)
throw ( CMSException ) = 0; throw ( CMSException ) = 0;
}; };
} }
#endif /*_CMS_CONNECTIONFACTORY_H_*/ #endif /*_CMS_CONNECTIONFACTORY_H_*/

View File

@ -1,82 +1,82 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef _CMS_DESTINATION_H_ #ifndef _CMS_DESTINATION_H_
#define _CMS_DESTINATION_H_ #define _CMS_DESTINATION_H_
#include <string> #include <string>
namespace cms{ namespace cms{
/** /**
* A Destination object encapsulates a provider-specific address. * A Destination object encapsulates a provider-specific address.
*/ */
class Destination{ class Destination{
public: public:
enum DestinationType enum DestinationType
{ {
TOPIC, TOPIC,
QUEUE, QUEUE,
TEMPORARY_TOPIC, TEMPORARY_TOPIC,
TEMPORARY_QUEUE TEMPORARY_QUEUE
}; };
public: public:
/** /**
* Destructor * Destructor
*/ */
virtual ~Destination(void){} virtual ~Destination(void){}
/** /**
* Retrieve the Destination Type for this Destination * Retrieve the Destination Type for this Destination
* @return The Destination Type * @return The Destination Type
*/ */
virtual DestinationType getDestinationType(void) const = 0; virtual DestinationType getDestinationType(void) const = 0;
/** /**
* Converts the Destination Name into a String * Converts the Destination Name into a String
* @return string name * @return string name
*/ */
virtual std::string toString(void) const = 0; virtual std::string toString(void) const = 0;
/** /**
* Converts the Destination to a String value representing the * Converts the Destination to a String value representing the
* Provider specific name fot this destination, which is not * Provider specific name fot this destination, which is not
* necessarily equal to the User Supplied name of the Destination * necessarily equal to the User Supplied name of the Destination
* @return Provider specific Name * @return Provider specific Name
*/ */
virtual std::string toProviderString(void) const = 0; virtual std::string toProviderString(void) const = 0;
/** /**
* Creates a new instance of this destination type that is a * Creates a new instance of this destination type that is a
* copy of this one, and returns it. * copy of this one, and returns it.
* @returns cloned copy of this object * @returns cloned copy of this object
*/ */
virtual cms::Destination* clone(void) const = 0; virtual cms::Destination* clone(void) const = 0;
/** /**
* Copies the contents of the given Destinastion object to this one. * Copies the contents of the given Destinastion object to this one.
* @param source The source Destination object. * @param source The source Destination object.
*/ */
virtual void copy( const cms::Destination& source ) = 0; virtual void copy( const cms::Destination& source ) = 0;
}; };
} }
#endif /*_CMS_DESTINATION_H_*/ #endif /*_CMS_DESTINATION_H_*/

View File

@ -1,44 +1,44 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef _CMS_EXCEPTIONLISTENER_H_ #ifndef _CMS_EXCEPTIONLISTENER_H_
#define _CMS_EXCEPTIONLISTENER_H_ #define _CMS_EXCEPTIONLISTENER_H_
#include <cms/CMSException.h> #include <cms/CMSException.h>
namespace cms{ namespace cms{
class ExceptionListener class ExceptionListener
{ {
public: public:
/** /**
* Destructor * Destructor
*/ */
virtual ~ExceptionListener(void) {} virtual ~ExceptionListener(void) {}
/** /**
* Called when an exception occurs. * Called when an exception occurs.
* @param Exception Object that occurred. * @param Exception Object that occurred.
*/ */
virtual void onException(const cms::CMSException& ex) = 0; virtual void onException(const cms::CMSException& ex) = 0;
}; };
} }
#endif /*_CMS_EXCEPTIONLISTENER_H_*/ #endif /*_CMS_EXCEPTIONLISTENER_H_*/

View File

@ -1,190 +1,190 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef _CMS_MESSAGE_H_ #ifndef _CMS_MESSAGE_H_
#define _CMS_MESSAGE_H_ #define _CMS_MESSAGE_H_
#include <activemq/util/Properties.h> #include <activemq/util/Properties.h>
#include <cms/Destination.h> #include <cms/Destination.h>
#include <cms/CMSException.h> #include <cms/CMSException.h>
namespace cms{ namespace cms{
/** /**
* Root of all messages. * Root of all messages.
*/ */
class Message{ class Message{
public: public:
/** /**
* Enumeration value for Message Delivery Mode * Enumeration value for Message Delivery Mode
*/ */
enum DeliveryMode enum DeliveryMode
{ {
PERSISTANT, PERSISTANT,
NONPERSISTANT NONPERSISTANT
}; };
public: public:
virtual ~Message(void){} virtual ~Message(void){}
/** /**
* Clonse this message exactly, returns a new instance that the * Clonse this message exactly, returns a new instance that the
* caller is required to delete. * caller is required to delete.
* @return new copy of this message * @return new copy of this message
*/ */
virtual Message* clone(void) const = 0; virtual Message* clone(void) const = 0;
/** /**
* Acknowledges all consumed messages of the session * Acknowledges all consumed messages of the session
* of this consumed message. * of this consumed message.
*/ */
virtual void acknowledge(void) const throw( CMSException ) = 0; virtual void acknowledge(void) const throw( CMSException ) = 0;
/** /**
* Retrieves a reference to the properties object owned * Retrieves a reference to the properties object owned
* by this message * by this message
* @return A Properties Object reference * @return A Properties Object reference
*/ */
virtual activemq::util::Properties& getProperties(void) = 0; virtual activemq::util::Properties& getProperties(void) = 0;
virtual const activemq::util::Properties& getProperties(void) const = 0; virtual const activemq::util::Properties& getProperties(void) const = 0;
/** /**
* Get the Correlation Id for this message * Get the Correlation Id for this message
* @return string representation of the correlation Id * @return string representation of the correlation Id
*/ */
virtual const char* getCMSCorrelationId(void) const = 0; virtual const char* getCMSCorrelationId(void) const = 0;
/** /**
* Sets the Correlation Id used by this message * Sets the Correlation Id used by this message
* @param String representing the correlation id. * @param String representing the correlation id.
*/ */
virtual void setCMSCorrelationId(const std::string& correlationId) = 0; virtual void setCMSCorrelationId(const std::string& correlationId) = 0;
/** /**
* Sets the DeliveryMode for this message * Sets the DeliveryMode for this message
* @return DeliveryMode enumerated value. * @return DeliveryMode enumerated value.
*/ */
virtual DeliveryMode getCMSDeliveryMode(void) const = 0; virtual DeliveryMode getCMSDeliveryMode(void) const = 0;
/** /**
* Sets the DeliveryMode for this message * Sets the DeliveryMode for this message
* @param DeliveryMode enumerated value. * @param DeliveryMode enumerated value.
*/ */
virtual void setCMSDeliveryMode(DeliveryMode mode) = 0; virtual void setCMSDeliveryMode(DeliveryMode mode) = 0;
/** /**
* Gets the Destination for this Message, returns a * Gets the Destination for this Message, returns a
* @return Destination object * @return Destination object
*/ */
virtual const Destination& getCMSDestination(void) const = 0; virtual const Destination& getCMSDestination(void) const = 0;
/** /**
* Sets the Destination for this message * Sets the Destination for this message
* @param Destination Object * @param Destination Object
*/ */
virtual void setCMSDestination(const Destination& destination) = 0; virtual void setCMSDestination(const Destination& destination) = 0;
/** /**
* Gets the Expiration Time for this Message * Gets the Expiration Time for this Message
* @return time value * @return time value
*/ */
virtual long getCMSExpiration(void) const = 0; virtual long getCMSExpiration(void) const = 0;
/** /**
* Sets the Expiration Time for this message * Sets the Expiration Time for this message
* @param time value * @param time value
*/ */
virtual void setCMSExpiration(long expireTime) = 0; virtual void setCMSExpiration(long expireTime) = 0;
/** /**
* Gets the CMS Message Id for this Message * Gets the CMS Message Id for this Message
* @return time value * @return time value
*/ */
virtual const char* getCMSMessageId(void) const = 0; virtual const char* getCMSMessageId(void) const = 0;
/** /**
* Sets the CMS Message Id for this message * Sets the CMS Message Id for this message
* @param time value * @param time value
*/ */
virtual void setCMSMessageId(const std::string& id) = 0; virtual void setCMSMessageId(const std::string& id) = 0;
/** /**
* Gets the Priority Value for this Message * Gets the Priority Value for this Message
* @return priority value * @return priority value
*/ */
virtual int getCMSPriority(void) const = 0; virtual int getCMSPriority(void) const = 0;
/** /**
* Sets the Priority Value for this message * Sets the Priority Value for this message
* @param priority value * @param priority value
*/ */
virtual void setCMSPriority(int priority) = 0; virtual void setCMSPriority(int priority) = 0;
/** /**
* Gets the Redelivered Flag for this Message * Gets the Redelivered Flag for this Message
* @return redelivered value * @return redelivered value
*/ */
virtual bool getCMSRedelivered(void) const = 0; virtual bool getCMSRedelivered(void) const = 0;
/** /**
* Sets the Redelivered Flag for this message * Sets the Redelivered Flag for this message
* @param redelivered value * @param redelivered value
*/ */
virtual void setCMSRedelivered(bool redelivered) = 0; virtual void setCMSRedelivered(bool redelivered) = 0;
/** /**
* Gets the CMS Reply To Address for this Message * Gets the CMS Reply To Address for this Message
* @return Reply To Value * @return Reply To Value
*/ */
virtual const char* getCMSReplyTo(void) const = 0; virtual const char* getCMSReplyTo(void) const = 0;
/** /**
* Sets the CMS Reply To Address for this message * Sets the CMS Reply To Address for this message
* @param Reply To value * @param Reply To value
*/ */
virtual void setCMSReplyTo(const std::string& id) = 0; virtual void setCMSReplyTo(const std::string& id) = 0;
/** /**
* Gets the Time Stamp for this Message * Gets the Time Stamp for this Message
* @return time stamp value * @return time stamp value
*/ */
virtual long getCMSTimeStamp(void) const = 0; virtual long getCMSTimeStamp(void) const = 0;
/** /**
* Sets the Time Stamp for this message * Sets the Time Stamp for this message
* @param time stamp value * @param time stamp value
*/ */
virtual void setCMSTimeStamp(long timeStamp) = 0; virtual void setCMSTimeStamp(long timeStamp) = 0;
/** /**
* Gets the CMS Message Type for this Message * Gets the CMS Message Type for this Message
* @return type value * @return type value
*/ */
virtual const char* getCMSMessageType(void) const = 0; virtual const char* getCMSMessageType(void) const = 0;
/** /**
* Sets the CMS Message Type for this message * Sets the CMS Message Type for this message
* @param type value * @param type value
*/ */
virtual void setCMSMessageType(const std::string& type) = 0; virtual void setCMSMessageType(const std::string& type) = 0;
}; };
} }
#endif /*_CMS_MESSAGE_H_*/ #endif /*_CMS_MESSAGE_H_*/

View File

@ -1,83 +1,83 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef _CMS_MESSAGECONSUMER_H_ #ifndef _CMS_MESSAGECONSUMER_H_
#define _CMS_MESSAGECONSUMER_H_ #define _CMS_MESSAGECONSUMER_H_
#include <cms/MessageListener.h> #include <cms/MessageListener.h>
#include <cms/Message.h> #include <cms/Message.h>
namespace cms namespace cms
{ {
class MessageConsumer class MessageConsumer
{ {
public: public:
/** /**
* Destructor * Destructor
*/ */
virtual ~MessageConsumer(void) {} virtual ~MessageConsumer(void) {}
/** /**
* Synchronously Receive a Message * Synchronously Receive a Message
* @return new message * @return new message
* @throws CMSException * @throws CMSException
*/ */
virtual Message* receive(void) throw ( CMSException ) = 0; virtual Message* receive(void) throw ( CMSException ) = 0;
/** /**
* Synchronously Receive a Message, time out after defined interval. * Synchronously Receive a Message, time out after defined interval.
* Returns null if nothing read. * Returns null if nothing read.
* @return new message * @return new message
* @throws CMSException * @throws CMSException
*/ */
virtual Message* receive(int millisecs) throw ( CMSException ) = 0; virtual Message* receive(int millisecs) throw ( CMSException ) = 0;
/** /**
* Receive a Message, does not wait if there isn't a new message * Receive a Message, does not wait if there isn't a new message
* to read, returns NULL if nothing read. * to read, returns NULL if nothing read.
* @return new message * @return new message
* @throws CMSException * @throws CMSException
*/ */
virtual Message* receiveNoWait(void) throw ( CMSException ) = 0; virtual Message* receiveNoWait(void) throw ( CMSException ) = 0;
/** /**
* Sets the MessageListener that this class will send notifs on * Sets the MessageListener that this class will send notifs on
* @param MessageListener interface pointer * @param MessageListener interface pointer
*/ */
virtual void setMessageListener(MessageListener* listener) = 0; virtual void setMessageListener(MessageListener* listener) = 0;
/** /**
* Gets the MessageListener that this class will send notifs on * Gets the MessageListener that this class will send notifs on
* @param MessageListener interface pointer * @param MessageListener interface pointer
*/ */
virtual MessageListener* getMessageListener(void) const = 0; virtual MessageListener* getMessageListener(void) const = 0;
/** /**
* Gets this message consumer's message selector expression. * Gets this message consumer's message selector expression.
* @return This Consumer's selector expression or "". * @return This Consumer's selector expression or "".
* @throws cms::CMSException * @throws cms::CMSException
*/ */
virtual std::string getMessageSelector(void) const virtual std::string getMessageSelector(void) const
throw ( cms::CMSException ) = 0; throw ( cms::CMSException ) = 0;
}; };
} }
#endif /*_CMS_MESSAGECONSUMER_H_*/ #endif /*_CMS_MESSAGECONSUMER_H_*/

View File

@ -1,52 +1,52 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef _CMS_MESSAGELISTENER_H_ #ifndef _CMS_MESSAGELISTENER_H_
#define _CMS_MESSAGELISTENER_H_ #define _CMS_MESSAGELISTENER_H_
//#include <cms/Message.h> //#include <cms/Message.h>
namespace cms{ namespace cms{
class Message; class Message;
class MessageListener{ class MessageListener{
public: public:
virtual ~MessageListener(void){} virtual ~MessageListener(void){}
/** /**
* Called asynchronously when a new message is received, the message * Called asynchronously when a new message is received, the message
* reference can be to any othe Message types. a dynamic cast is used * 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 * 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 * object is only garunteed to be for life of the onMessage function
* after this returns the message may no longer exists. User should * after this returns the message may no longer exists. User should
* copy the data or clone the message if they wish to keep something * copy the data or clone the message if they wish to keep something
* around about this message. * around about this message.
* *
* It is considered a programming error for this method to throw and * It is considered a programming error for this method to throw and
* exception. * exception.
* *
* @param Message object reference * @param Message object reference
*/ */
virtual void onMessage( const Message& message ) = 0; virtual void onMessage( const Message& message ) = 0;
}; };
} }
#endif /*_CMS_MESSAGELISTENER_H_*/ #endif /*_CMS_MESSAGELISTENER_H_*/

View File

@ -1,120 +1,120 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef _CMS_MESSAGEPRODUCER_H_ #ifndef _CMS_MESSAGEPRODUCER_H_
#define _CMS_MESSAGEPRODUCER_H_ #define _CMS_MESSAGEPRODUCER_H_
#include <cms/Message.h> #include <cms/Message.h>
#include <cms/Destination.h> #include <cms/Destination.h>
#include <cms/CMSException.h> #include <cms/CMSException.h>
namespace cms namespace cms
{ {
/** /**
* defines the <code>MEssageProducer</code> interface that is used * defines the <code>MEssageProducer</code> interface that is used
* by all MessageProducer derivations. This class defines the JMS * by all MessageProducer derivations. This class defines the JMS
* spec'd interface for a MessageProducer. * spec'd interface for a MessageProducer.
*/ */
class MessageProducer class MessageProducer
{ {
public: public:
/** /**
* Destructor * Destructor
*/ */
virtual ~MessageProducer(void) {} virtual ~MessageProducer(void) {}
/** /**
* Sends the message to the default producer destination. * Sends the message to the default producer destination.
* @param a Message Object Pointer * @param a Message Object Pointer
* @throws CMSException * @throws CMSException
*/ */
virtual void send(Message& message) throw ( CMSException ) = 0; virtual void send(Message& message) throw ( CMSException ) = 0;
/** /**
* Sends the message to the designated destination. * Sends the message to the designated destination.
* @param a Message Object Pointer * @param a Message Object Pointer
* @throws CMSException * @throws CMSException
*/ */
virtual void send(const Destination& destination, virtual void send(const Destination& destination,
Message& message) throw ( CMSException ) = 0; Message& message) throw ( CMSException ) = 0;
/** /**
* Sets the delivery mode for this Producer * Sets the delivery mode for this Producer
* @param The DeliveryMode * @param The DeliveryMode
*/ */
virtual void setDeliveryMode(Message::DeliveryMode mode) = 0; virtual void setDeliveryMode(Message::DeliveryMode mode) = 0;
/** /**
* Gets the delivery mode for this Producer * Gets the delivery mode for this Producer
* @return The DeliveryMode * @return The DeliveryMode
*/ */
virtual Message::DeliveryMode getDeliveryMode(void) const = 0; virtual Message::DeliveryMode getDeliveryMode(void) const = 0;
/** /**
* Sets if Message Ids are disbled for this Producer * Sets if Message Ids are disbled for this Producer
* @param boolean indicating enable / disable (true / false) * @param boolean indicating enable / disable (true / false)
*/ */
virtual void setDisableMessageId(bool value) = 0; virtual void setDisableMessageId(bool value) = 0;
/** /**
* Sets if Message Ids are disbled for this Producer * Sets if Message Ids are disbled for this Producer
* @param boolean indicating enable / disable (true / false) * @param boolean indicating enable / disable (true / false)
*/ */
virtual bool getDisableMessageId(void) const = 0; virtual bool getDisableMessageId(void) const = 0;
/** /**
* Sets if Message Time Stamps are disbled for this Producer * Sets if Message Time Stamps are disbled for this Producer
* @param boolean indicating enable / disable (true / false) * @param boolean indicating enable / disable (true / false)
*/ */
virtual void setDisableMessageTimeStamp(bool value) = 0; virtual void setDisableMessageTimeStamp(bool value) = 0;
/** /**
* Sets if Message Time Stamps are disbled for this Producer * Sets if Message Time Stamps are disbled for this Producer
* @param boolean indicating enable / disable (true / false) * @param boolean indicating enable / disable (true / false)
*/ */
virtual bool getDisableMessageTimeStamp(void) const = 0; virtual bool getDisableMessageTimeStamp(void) const = 0;
/** /**
* Sets the Priority that this Producers sends messages at * Sets the Priority that this Producers sends messages at
* @param int value for Priority level * @param int value for Priority level
*/ */
virtual void setPriority(int priority) = 0; virtual void setPriority(int priority) = 0;
/** /**
* Gets the Priority level that this producer sends messages at * Gets the Priority level that this producer sends messages at
* @return int based priority level * @return int based priority level
*/ */
virtual int getPriority(void) const = 0; virtual int getPriority(void) const = 0;
/** /**
* Sets the Time to Live that this Producers sends messages with * Sets the Time to Live that this Producers sends messages with
* @param int value for time to live * @param int value for time to live
*/ */
virtual void setTimeToLive(int time) = 0; virtual void setTimeToLive(int time) = 0;
/** /**
* Gets the Time to Live that this producer sends messages with * Gets the Time to Live that this producer sends messages with
* @return int based Time to Live * @return int based Time to Live
*/ */
virtual int getTimeToLive(void) const = 0; virtual int getTimeToLive(void) const = 0;
}; };
} }
#endif /*_CMS_MESSAGEPRODUCER_H_*/ #endif /*_CMS_MESSAGEPRODUCER_H_*/

View File

@ -1,46 +1,46 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef _CMS_QUEUE_H_ #ifndef _CMS_QUEUE_H_
#define _CMS_QUEUE_H_ #define _CMS_QUEUE_H_
#include <cms/Destination.h> #include <cms/Destination.h>
#include <cms/CMSException.h> #include <cms/CMSException.h>
namespace cms{ namespace cms{
/** /**
* An interface encapsulating a provider-specific queue name. * An interface encapsulating a provider-specific queue name.
*/ */
class Queue : public Destination{ class Queue : public Destination{
public: public:
virtual ~Queue(void){} virtual ~Queue(void){}
/** /**
* Gets the name of this queue. * Gets the name of this queue.
* @return The queue name. * @return The queue name.
*/ */
virtual std::string getQueueName() const virtual std::string getQueueName() const
throw( CMSException ) = 0; throw( CMSException ) = 0;
}; };
} }
#endif /*_CMS_QUEUE_H_*/ #endif /*_CMS_QUEUE_H_*/

View File

@ -1,232 +1,232 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef _CMS_SESSION_H_ #ifndef _CMS_SESSION_H_
#define _CMS_SESSION_H_ #define _CMS_SESSION_H_
#include <cms/Closeable.h> #include <cms/Closeable.h>
#include <cms/Message.h> #include <cms/Message.h>
#include <cms/TextMessage.h> #include <cms/TextMessage.h>
#include <cms/BytesMessage.h> #include <cms/BytesMessage.h>
#include <cms/MapMessage.h> #include <cms/MapMessage.h>
#include <cms/MessageProducer.h> #include <cms/MessageProducer.h>
#include <cms/MessageConsumer.h> #include <cms/MessageConsumer.h>
#include <cms/Topic.h> #include <cms/Topic.h>
#include <cms/Queue.h> #include <cms/Queue.h>
#include <cms/TemporaryTopic.h> #include <cms/TemporaryTopic.h>
#include <cms/TemporaryQueue.h> #include <cms/TemporaryQueue.h>
#include <cms/CMSException.h> #include <cms/CMSException.h>
namespace cms namespace cms
{ {
class Session : public Closeable class Session : public Closeable
{ {
public: public:
enum AcknowledgeMode enum AcknowledgeMode
{ {
/** /**
* With this acknowledgment mode, the session automatically * With this acknowledgment mode, the session automatically
* acknowledges a client's receipt of a message either when * acknowledges a client's receipt of a message either when
* the session has successfully returned from a call to receive * the session has successfully returned from a call to receive
* or when the message listener the session has called to * or when the message listener the session has called to
* process the message successfully returns. * process the message successfully returns.
*/ */
AutoAcknowledge, AutoAcknowledge,
/** /**
* With this acknowledgment mode, the session automatically * With this acknowledgment mode, the session automatically
* acknowledges a client's receipt of a message either when * acknowledges a client's receipt of a message either when
* the session has successfully returned from a call to receive * the session has successfully returned from a call to receive
* or when the message listener the session has called to * or when the message listener the session has called to
* process the message successfully returns. Acknowlegements * process the message successfully returns. Acknowlegements
* may be delayed in this mode to increase performance at * may be delayed in this mode to increase performance at
* the cost of the message being redelivered this client fails. * the cost of the message being redelivered this client fails.
*/ */
DupsOkAcknowledge, DupsOkAcknowledge,
/** /**
* With this acknowledgment mode, the client acknowledges a * With this acknowledgment mode, the client acknowledges a
* consumed message by calling the message's acknowledge method. * consumed message by calling the message's acknowledge method.
*/ */
ClientAcknowledge, ClientAcknowledge,
/** /**
* Messages will be consumed when the transaction commits. * Messages will be consumed when the transaction commits.
*/ */
Transactional Transactional
}; };
public: public:
/** /**
* Destructor * Destructor
*/ */
virtual ~Session(void) {} virtual ~Session(void) {}
/** /**
* Commits all messages done in this transaction and releases any * Commits all messages done in this transaction and releases any
* locks currently held. * locks currently held.
* @throws CMSException * @throws CMSException
*/ */
virtual void commit(void) throw ( CMSException ) = 0; virtual void commit(void) throw ( CMSException ) = 0;
/** /**
* Rollsback all messages done in this transaction and releases any * Rollsback all messages done in this transaction and releases any
* locks currently held. * locks currently held.
* @throws CMSException * @throws CMSException
*/ */
virtual void rollback(void) throw ( CMSException ) = 0; virtual void rollback(void) throw ( CMSException ) = 0;
/** /**
* Creates a MessageConsumer for the specified destination. * Creates a MessageConsumer for the specified destination.
* @param the Destination that this consumer receiving messages for. * @param the Destination that this consumer receiving messages for.
* @throws CMSException * @throws CMSException
*/ */
virtual MessageConsumer* createConsumer( virtual MessageConsumer* createConsumer(
Destination& destination ) Destination& destination )
throw ( CMSException ) = 0; throw ( CMSException ) = 0;
/** /**
* Creates a MessageConsumer for the specified destination, using a * Creates a MessageConsumer for the specified destination, using a
* message selector. * message selector.
* @param the Destination that this consumer receiving messages for. * @param the Destination that this consumer receiving messages for.
* @throws CMSException * @throws CMSException
*/ */
virtual MessageConsumer* createConsumer( virtual MessageConsumer* createConsumer(
Destination& destination, Destination& destination,
const std::string& selector ) const std::string& selector )
throw ( CMSException ) = 0; throw ( CMSException ) = 0;
/** /**
* Creates a durable subscriber to the specified topic, using a * Creates a durable subscriber to the specified topic, using a
* message selector * message selector
* @param the topic to subscribe to * @param the topic to subscribe to
* @param name used to identify the subscription * @param name used to identify the subscription
* @param only messages matching the selector are received * @param only messages matching the selector are received
* @throws CMSException * @throws CMSException
*/ */
virtual MessageConsumer* createDurableConsumer( virtual MessageConsumer* createDurableConsumer(
Topic& destination, Topic& destination,
const std::string& name, const std::string& name,
const std::string& selector, const std::string& selector,
bool noLocal = false ) bool noLocal = false )
throw ( CMSException ) = 0; throw ( CMSException ) = 0;
/** /**
* Creates a MessageProducer to send messages to the specified * Creates a MessageProducer to send messages to the specified
* destination. * destination.
* @param the Destination to publish on * @param the Destination to publish on
* @throws CMSException * @throws CMSException
*/ */
virtual MessageProducer* createProducer( Destination& destination ) virtual MessageProducer* createProducer( Destination& destination )
throw ( CMSException ) = 0; throw ( CMSException ) = 0;
/** /**
* Creates a queue identity given a Queue name. * Creates a queue identity given a Queue name.
* @param the name of the new Queue * @param the name of the new Queue
* @throws CMSException * @throws CMSException
*/ */
virtual Queue* createQueue( const std::string& queueName ) virtual Queue* createQueue( const std::string& queueName )
throw ( CMSException ) = 0; throw ( CMSException ) = 0;
/** /**
* Creates a topic identity given a Queue name. * Creates a topic identity given a Queue name.
* @param the name of the new Topic * @param the name of the new Topic
* @throws CMSException * @throws CMSException
*/ */
virtual Topic* createTopic( const std::string& topicName ) virtual Topic* createTopic( const std::string& topicName )
throw ( CMSException ) = 0; throw ( CMSException ) = 0;
/** /**
* Creates a TemporaryQueue object. * Creates a TemporaryQueue object.
* @throws CMSException * @throws CMSException
*/ */
virtual TemporaryQueue* createTemporaryQueue(void) virtual TemporaryQueue* createTemporaryQueue(void)
throw ( CMSException ) = 0; throw ( CMSException ) = 0;
/** /**
* Creates a TemporaryTopic object. * Creates a TemporaryTopic object.
* @throws CMSException * @throws CMSException
*/ */
virtual TemporaryTopic* createTemporaryTopic(void) virtual TemporaryTopic* createTemporaryTopic(void)
throw ( CMSException ) = 0; throw ( CMSException ) = 0;
/** /**
* Creates a new Message * Creates a new Message
* @throws CMSException * @throws CMSException
*/ */
virtual Message* createMessage(void) virtual Message* createMessage(void)
throw ( CMSException ) = 0; throw ( CMSException ) = 0;
/** /**
* Creates a BytesMessage * Creates a BytesMessage
* @throws CMSException * @throws CMSException
*/ */
virtual BytesMessage* createBytesMessage(void) virtual BytesMessage* createBytesMessage(void)
throw ( CMSException) = 0; throw ( CMSException) = 0;
/** /**
* Creates a BytesMessage and sets the paylod to the passed value * Creates a BytesMessage and sets the paylod to the passed value
* @param an array of bytes to set in the message * @param an array of bytes to set in the message
* @param the size of the bytes array, or number of bytes to use * @param the size of the bytes array, or number of bytes to use
* @throws CMSException * @throws CMSException
*/ */
virtual BytesMessage* createBytesMessage( virtual BytesMessage* createBytesMessage(
const unsigned char* bytes, const unsigned char* bytes,
unsigned long bytesSize ) unsigned long bytesSize )
throw ( CMSException) = 0; throw ( CMSException) = 0;
/** /**
* Creates a new TextMessage * Creates a new TextMessage
* @throws CMSException * @throws CMSException
*/ */
virtual TextMessage* createTextMessage(void) virtual TextMessage* createTextMessage(void)
throw ( CMSException ) = 0; throw ( CMSException ) = 0;
/** /**
* Creates a new TextMessage and set the text to the value given * Creates a new TextMessage and set the text to the value given
* @param the initial text for the message * @param the initial text for the message
* @throws CMSException * @throws CMSException
*/ */
virtual TextMessage* createTextMessage( const std::string& text ) virtual TextMessage* createTextMessage( const std::string& text )
throw ( CMSException ) = 0; throw ( CMSException ) = 0;
/** /**
* Creates a new MapMessage * Creates a new MapMessage
* @throws CMSException * @throws CMSException
*/ */
virtual MapMessage* createMapMessage(void) virtual MapMessage* createMapMessage(void)
throw ( CMSException ) = 0; throw ( CMSException ) = 0;
/** /**
* Returns the acknowledgement mode of the session. * Returns the acknowledgement mode of the session.
* @return the Sessions Acknowledge Mode * @return the Sessions Acknowledge Mode
*/ */
virtual AcknowledgeMode getAcknowledgeMode(void) const = 0; virtual AcknowledgeMode getAcknowledgeMode(void) const = 0;
/** /**
* Gets if the Sessions is a Transacted Session * Gets if the Sessions is a Transacted Session
* @return transacted true - false. * @return transacted true - false.
*/ */
virtual bool isTransacted(void) const = 0; virtual bool isTransacted(void) const = 0;
}; };
} }
#endif /*_CMS_SESSION_H_*/ #endif /*_CMS_SESSION_H_*/

View File

@ -1,46 +1,46 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef _CMS_TEMPORARYTOPIC_H_ #ifndef _CMS_TEMPORARYTOPIC_H_
#define _CMS_TEMPORARYTOPIC_H_ #define _CMS_TEMPORARYTOPIC_H_
#include <cms/Destination.h> #include <cms/Destination.h>
#include <cms/CMSException.h> #include <cms/CMSException.h>
namespace cms{ namespace cms{
/** /**
* An interface encapsulating a provider-specific topic name. * An interface encapsulating a provider-specific topic name.
*/ */
class TemporaryTopic : public Destination class TemporaryTopic : public Destination
{ {
public: public:
virtual ~TemporaryTopic(void) {} virtual ~TemporaryTopic(void) {}
/** /**
* Gets the name of this topic. * Gets the name of this topic.
* @return The topic name. * @return The topic name.
*/ */
virtual const char* getTopicName(void) virtual const char* getTopicName(void)
const throw( CMSException ) = 0; const throw( CMSException ) = 0;
}; };
} }
#endif /*_CMS_TEMPORARYTOPIC_H_*/ #endif /*_CMS_TEMPORARYTOPIC_H_*/

View File

@ -1,49 +1,49 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef _CMS_TEXTMESSAGE_H_ #ifndef _CMS_TEXTMESSAGE_H_
#define _CMS_TEXTMESSAGE_H_ #define _CMS_TEXTMESSAGE_H_
#include <cms/Message.h> #include <cms/Message.h>
#include <cms/CMSException.h> #include <cms/CMSException.h>
namespace cms{ namespace cms{
/** /**
* Interface for a text message. * Interface for a text message.
*/ */
class TextMessage : public Message{ class TextMessage : public Message{
public: public:
virtual ~TextMessage(){} virtual ~TextMessage(){}
/** /**
* Gets the message character buffer. * Gets the message character buffer.
* @return The message character buffer. * @return The message character buffer.
*/ */
virtual const char* getText() const throw( CMSException ) = 0; virtual const char* getText() const throw( CMSException ) = 0;
/** /**
* Sets the message contents. * Sets the message contents.
* @param msg The message buffer. * @param msg The message buffer.
*/ */
virtual void setText( const char* msg ) throw( CMSException ) = 0; virtual void setText( const char* msg ) throw( CMSException ) = 0;
}; };
} }
#endif /*_CMS_TEXTMESSAGE_H_*/ #endif /*_CMS_TEXTMESSAGE_H_*/

View File

@ -1,46 +1,46 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef _CMS_TOPIC_ #ifndef _CMS_TOPIC_
#define _CMS_TOPIC_ #define _CMS_TOPIC_
#include <cms/Destination.h> #include <cms/Destination.h>
#include <cms/CMSException.h> #include <cms/CMSException.h>
namespace cms{ namespace cms{
/** /**
* An interface encapsulating a provider-specific topic name. * An interface encapsulating a provider-specific topic name.
*/ */
class Topic : public Destination{ class Topic : public Destination{
public: public:
virtual ~Topic(void) {} virtual ~Topic(void) {}
/** /**
* Gets the name of this topic. * Gets the name of this topic.
* @return The topic name. * @return The topic name.
*/ */
virtual std::string getTopicName(void) virtual std::string getTopicName(void)
const throw( CMSException ) = 0; const throw( CMSException ) = 0;
}; };
} }
#endif /*_CMS_TOPIC_*/ #endif /*_CMS_TOPIC_*/

View File

@ -1,51 +1,51 @@
#ifndef _INTEGRATION_COMMON_ABSTRACTTESTER_H_ #ifndef _INTEGRATION_COMMON_ABSTRACTTESTER_H_
#define _INTEGRATION_COMMON_ABSTRACTTESTER_H_ #define _INTEGRATION_COMMON_ABSTRACTTESTER_H_
#include "Tester.h" #include "Tester.h"
#include <activemq/concurrent/Mutex.h> #include <activemq/concurrent/Mutex.h>
#include <cms/ConnectionFactory.h> #include <cms/ConnectionFactory.h>
#include <cms/Connection.h> #include <cms/Connection.h>
#include <cms/Session.h> #include <cms/Session.h>
#include <cms/MessageProducer.h> #include <cms/MessageProducer.h>
namespace integration{ namespace integration{
namespace common{ namespace common{
class AbstractTester : public Tester class AbstractTester : public Tester
{ {
public: public:
AbstractTester( cms::Session::AcknowledgeMode ackMode = AbstractTester( cms::Session::AcknowledgeMode ackMode =
cms::Session::AutoAcknowledge ); cms::Session::AutoAcknowledge );
virtual ~AbstractTester(); virtual ~AbstractTester();
virtual void doSleep(void); virtual void doSleep(void);
virtual unsigned int produceTextMessages( virtual unsigned int produceTextMessages(
cms::MessageProducer& producer, cms::MessageProducer& producer,
unsigned int count ); unsigned int count );
virtual unsigned int produceBytesMessages( virtual unsigned int produceBytesMessages(
cms::MessageProducer& producer, cms::MessageProducer& producer,
unsigned int count ); unsigned int count );
virtual void waitForMessages( unsigned int count ); virtual void waitForMessages( unsigned int count );
virtual void onException( const cms::CMSException& error ); virtual void onException( const cms::CMSException& error );
virtual void onMessage( const cms::Message& message ); virtual void onMessage( const cms::Message& message );
public: public:
cms::ConnectionFactory* connectionFactory; cms::ConnectionFactory* connectionFactory;
cms::Connection* connection; cms::Connection* connection;
cms::Session* session; cms::Session* session;
unsigned int numReceived; unsigned int numReceived;
activemq::concurrent::Mutex mutex; activemq::concurrent::Mutex mutex;
}; };
}} }}
#endif /*_INTEGRATION_COMMON_ABSTRACTTESTER_H_*/ #endif /*_INTEGRATION_COMMON_ABSTRACTTESTER_H_*/

View File

@ -1,23 +1,23 @@
#ifndef _INTEGRATION_COMMON_INTEGRATIONCOMMON_H_ #ifndef _INTEGRATION_COMMON_INTEGRATIONCOMMON_H_
#define _INTEGRATION_COMMON_INTEGRATIONCOMMON_H_ #define _INTEGRATION_COMMON_INTEGRATIONCOMMON_H_
#include <string> #include <string>
namespace integration{ namespace integration{
namespace common{ namespace common{
class IntegrationCommon class IntegrationCommon
{ {
public: public:
virtual ~IntegrationCommon(); virtual ~IntegrationCommon();
static const std::string defaultURL; static const std::string defaultURL;
static const int defaultDelay; static const int defaultDelay;
static const unsigned int defaultMsgCount; static const unsigned int defaultMsgCount;
}; };
}} }}
#endif /*_INTEGRATION_COMMON_INTEGRATIONCOMMON_H_*/ #endif /*_INTEGRATION_COMMON_INTEGRATIONCOMMON_H_*/

View File

@ -1,24 +1,24 @@
#ifndef _INTEGRATION_COMMON_TESTER_H_ #ifndef _INTEGRATION_COMMON_TESTER_H_
#define _INTEGRATION_COMMON_TESTER_H_ #define _INTEGRATION_COMMON_TESTER_H_
#include <cms/MessageListener.h> #include <cms/MessageListener.h>
#include <cms/ExceptionListener.h> #include <cms/ExceptionListener.h>
namespace integration{ namespace integration{
namespace common{ namespace common{
class Tester : public cms::ExceptionListener, class Tester : public cms::ExceptionListener,
public cms::MessageListener public cms::MessageListener
{ {
public: public:
virtual ~Tester() {} virtual ~Tester() {}
virtual void test(void) = 0; virtual void test(void) = 0;
}; };
}} }}
#endif /*_INTEGRATION_COMMON_TESTER_H_*/ #endif /*_INTEGRATION_COMMON_TESTER_H_*/

View File

@ -1,32 +1,32 @@
#ifndef _INTEGRATION_TRANSACTIONAL_DURABLETESTER_H_ #ifndef _INTEGRATION_TRANSACTIONAL_DURABLETESTER_H_
#define _INTEGRATION_TRANSACTIONAL_DURABLETESTER_H_ #define _INTEGRATION_TRANSACTIONAL_DURABLETESTER_H_
#include <integration/common/AbstractTester.h> #include <integration/common/AbstractTester.h>
#include <cppunit/TestFixture.h> #include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
namespace integration{ namespace integration{
namespace durable{ namespace durable{
class DurableTester : public CppUnit::TestFixture, class DurableTester : public CppUnit::TestFixture,
public common::AbstractTester public common::AbstractTester
{ {
CPPUNIT_TEST_SUITE( DurableTester ); CPPUNIT_TEST_SUITE( DurableTester );
CPPUNIT_TEST( test ); CPPUNIT_TEST( test );
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
public: public:
DurableTester(); DurableTester();
virtual ~DurableTester(); virtual ~DurableTester();
virtual void test(void); virtual void test(void);
private: private:
}; };
}} }}
#endif /*_INTEGRATION_TRANSACTIONAL_DURABLETESTER_H_*/ #endif /*_INTEGRATION_TRANSACTIONAL_DURABLETESTER_H_*/

View File

@ -1,30 +1,30 @@
#ifndef _INTEGRATION_SIMPLE_SIMPLETESTER_H_ #ifndef _INTEGRATION_SIMPLE_SIMPLETESTER_H_
#define _INTEGRATION_SIMPLE_SIMPLETESTER_H_ #define _INTEGRATION_SIMPLE_SIMPLETESTER_H_
#include <cppunit/TestFixture.h> #include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
#include <integration/common/AbstractTester.h> #include <integration/common/AbstractTester.h>
namespace integration{ namespace integration{
namespace simple{ namespace simple{
class SimpleTester : public CppUnit::TestFixture, class SimpleTester : public CppUnit::TestFixture,
public common::AbstractTester public common::AbstractTester
{ {
CPPUNIT_TEST_SUITE( SimpleTester ); CPPUNIT_TEST_SUITE( SimpleTester );
CPPUNIT_TEST( test ); CPPUNIT_TEST( test );
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
public: public:
SimpleTester(); SimpleTester();
virtual ~SimpleTester(); virtual ~SimpleTester();
virtual void test(void); virtual void test(void);
}; };
}} }}
#endif /*_INTEGRATION_SIMPLE_SIMPLETESTER_H_*/ #endif /*_INTEGRATION_SIMPLE_SIMPLETESTER_H_*/

View File

@ -1,32 +1,32 @@
#ifndef _INTEGRATION_TRANSACTIONAL_TRANSACTIONTESTER_H_ #ifndef _INTEGRATION_TRANSACTIONAL_TRANSACTIONTESTER_H_
#define _INTEGRATION_TRANSACTIONAL_TRANSACTIONTESTER_H_ #define _INTEGRATION_TRANSACTIONAL_TRANSACTIONTESTER_H_
#include <integration/common/AbstractTester.h> #include <integration/common/AbstractTester.h>
#include <cppunit/TestFixture.h> #include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
namespace integration{ namespace integration{
namespace transactional{ namespace transactional{
class TransactionTester : public CppUnit::TestFixture, class TransactionTester : public CppUnit::TestFixture,
public common::AbstractTester public common::AbstractTester
{ {
CPPUNIT_TEST_SUITE( TransactionTester ); CPPUNIT_TEST_SUITE( TransactionTester );
CPPUNIT_TEST( test ); CPPUNIT_TEST( test );
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
public: public:
TransactionTester(); TransactionTester();
virtual ~TransactionTester(); virtual ~TransactionTester();
virtual void test(void); virtual void test(void);
private: private:
}; };
}} }}
#endif /*_INTEGRATION_TRANSACTIONAL_TRANSACTIONTESTER_H_*/ #endif /*_INTEGRATION_TRANSACTIONAL_TRANSACTIONTESTER_H_*/