You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2007/11/08 22:02:22 UTC
svn commit: r593309 [3/8] - in /activemq/activemq-cpp/trunk/src: examples/
examples/consumers/ examples/producers/ main/ main/activemq/concurrent/
main/activemq/connector/ main/activemq/connector/openwire/
main/activemq/connector/openwire/marshal/ main...
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompCommandWriter.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompCommandWriter.cpp?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompCommandWriter.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompCommandWriter.cpp Thu Nov 8 13:02:02 2007
@@ -25,7 +25,7 @@
using namespace activemq::connector::stomp;
using namespace activemq::connector::stomp::commands;
using namespace activemq::transport;
-using namespace activemq::io;
+using namespace decaf::io;
using namespace activemq::exceptions;
////////////////////////////////////////////////////////////////////////////////
@@ -41,15 +41,15 @@
}
////////////////////////////////////////////////////////////////////////////////
-void StompCommandWriter::writeCommand( Command* command )
+void StompCommandWriter::writeCommand( Command* command )
throw ( transport::CommandIOException )
{
try
{
if( outputStream == NULL )
{
- throw CommandIOException(
- __FILE__, __LINE__,
+ throw CommandIOException(
+ __FILE__, __LINE__,
"StompCommandWriter::writeCommand - "
"output stream is NULL" );
}
@@ -62,7 +62,7 @@
writeByte( '\n' );
// Write all the headers.
- vector< pair<string,string> > headers = frame.getProperties().toArray();
+ vector< pair<string,string> > headers = frame.getProperties().toArray();
for( std::size_t ix=0; ix < headers.size(); ++ix )
{
string& name = headers[ix].first;
@@ -71,7 +71,7 @@
write( name.c_str(), name.length() );
writeByte( ':' );
write( value.c_str(), value.length() );
- writeByte( '\n' );
+ writeByte( '\n' );
}
// Finish the header section with a form feed.
@@ -79,14 +79,14 @@
// Write the body.
const std::vector<unsigned char>& body = frame.getBody();
- if( body.size() > 0 )
+ if( body.size() > 0 )
{
write( &body[0], body.size() );
}
if( ( frame.getBodyLength() == 0 ) ||
- ( frame.getProperties().getProperty(
- CommandConstants::toString(
+ ( frame.getProperties().getProperty(
+ CommandConstants::toString(
CommandConstants::HEADER_CONTENTLENGTH ), "" ) != "" ) )
{
writeByte( '\0' );
@@ -103,35 +103,35 @@
}
////////////////////////////////////////////////////////////////////////////////
-void StompCommandWriter::write( const unsigned char* buffer, std::size_t count )
+void StompCommandWriter::write( const unsigned char* buffer, std::size_t count )
throw( IOException )
{
if( outputStream == NULL )
{
- throw IOException(
- __FILE__, __LINE__,
+ throw IOException(
+ __FILE__, __LINE__,
"StompCommandWriter::write(char*,int) - input stream is NULL" );
}
- outputStream->write( buffer, count );
+ outputStream->write( buffer, 0, count );
}
-
+
////////////////////////////////////////////////////////////////////////////////
void StompCommandWriter::writeByte( unsigned char v ) throw( IOException )
{
if( outputStream == NULL )
{
- throw IOException(
- __FILE__, __LINE__,
+ throw IOException(
+ __FILE__, __LINE__,
"StompCommandWriter::write(char) - input stream is NULL" );
}
-
+
outputStream->write( v );
}
////////////////////////////////////////////////////////////////////////////////
-void StompCommandWriter::write( const char* buffer, std::size_t count )
- throw( io::IOException )
+void StompCommandWriter::write( const char* buffer, std::size_t count )
+ throw( decaf::io::IOException )
{
write( reinterpret_cast<const unsigned char*>( buffer ), count );
}
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompCommandWriter.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompCommandWriter.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompCommandWriter.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompCommandWriter.h Thu Nov 8 13:02:02 2007
@@ -18,25 +18,24 @@
#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPCOMMANDWRITER_H_
#include <activemq/transport/CommandWriter.h>
-#include <activemq/io/InputStream.h>
+#include <decaf/io/InputStream.h>
#include <activemq/transport/CommandIOException.h>
#include <activemq/connector/stomp/StompConnectorException.h>
#include <activemq/transport/Command.h>
-#include <activemq/io/OutputStream.h>
+#include <decaf/io/OutputStream.h>
#include <activemq/connector/stomp/marshal/Marshaler.h>
namespace activemq{
namespace connector{
namespace stomp{
- class StompCommandWriter : public transport::CommandWriter
- {
+ class StompCommandWriter : public transport::CommandWriter {
private:
-
+
/**
* Target output stream.
*/
- io::OutputStream* outputStream;
+ decaf::io::OutputStream* outputStream;
/**
* Marshaler of Stomp Commands
@@ -44,7 +43,7 @@
marshal::Marshaler marshaler;
public:
-
+
/**
* Default Constructor
*/
@@ -54,21 +53,21 @@
* Constructor.
* @param os the target output stream.
*/
- StompCommandWriter( io::OutputStream* os );
+ StompCommandWriter( decaf::io::OutputStream* os );
virtual ~StompCommandWriter() {}
/**
* Sets the target output stream.
*/
- virtual void setOutputStream( io::OutputStream* os ){
+ virtual void setOutputStream( decaf::io::OutputStream* os ){
outputStream = os;
}
-
+
/**
* Gets the target output stream.
*/
- virtual io::OutputStream* getOutputStream(){
+ virtual decaf::io::OutputStream* getOutputStream(){
return outputStream;
}
@@ -78,7 +77,7 @@
* @param os the target stream for the write.
* @throws CommandIOException if a problem occurs during the write.
*/
- virtual void writeCommand( transport::Command* command )
+ virtual void writeCommand( transport::Command* command )
throw ( transport::CommandIOException );
/**
@@ -87,26 +86,26 @@
* @param count the number of bytes in the array to write.
* @throws IOException thrown if an error occurs.
*/
- virtual void write( const unsigned char* buffer, std::size_t count )
- throw( io::IOException );
-
+ virtual void write( const unsigned char* buffer, std::size_t count )
+ throw( decaf::io::IOException );
+
/**
* Writes a byte to the output stream.
* @param v The value to be written.
* @throws IOException thrown if an error occurs.
*/
- virtual void writeByte( unsigned char v ) throw( io::IOException );
+ virtual void writeByte( unsigned char v ) throw( decaf::io::IOException );
private:
-
+
/**
* Writes a char array to the output stream.
* @param buffer a char array
* @param count the number of bytes in the array to write.
* @throws IOException thrown if an error occurs.
*/
- virtual void write( const char* buffer, std::size_t count )
- throw( io::IOException );
+ virtual void write( const char* buffer, std::size_t count )
+ throw( decaf::io::IOException );
};
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectionNegotiator.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectionNegotiator.cpp?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectionNegotiator.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectionNegotiator.cpp Thu Nov 8 13:02:02 2007
@@ -19,15 +19,16 @@
#include <activemq/connector/stomp/commands/ConnectCommand.h>
#include <activemq/connector/stomp/commands/ConnectedCommand.h>
+#include <activemq/exceptions/ActiveMQException.h>
using namespace std;
using namespace activemq;
using namespace activemq::exceptions;
using namespace activemq::transport;
-using namespace activemq::concurrent;
using namespace activemq::connector;
using namespace activemq::connector::stomp;
using namespace activemq::connector::stomp::commands;
+using namespace decaf::util::concurrent;
////////////////////////////////////////////////////////////////////////////////
StompConnectionNegotiator::StompConnectionNegotiator( Transport* next, bool own ) :
@@ -48,7 +49,7 @@
////////////////////////////////////////////////////////////////////////////////
void StompConnectionNegotiator::oneway( Command* command )
- throw( CommandIOException, exceptions::UnsupportedOperationException ) {
+ throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException ) {
try{
@@ -60,7 +61,7 @@
next->oneway( command );
}
- AMQ_CATCH_RETHROW( exceptions::UnsupportedOperationException )
+ AMQ_CATCH_RETHROW( decaf::lang::exceptions::UnsupportedOperationException )
AMQ_CATCH_RETHROW( CommandIOException )
AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, CommandIOException )
AMQ_CATCHALL_THROW( CommandIOException )
@@ -68,7 +69,7 @@
////////////////////////////////////////////////////////////////////////////////
Response* StompConnectionNegotiator::request( Command* command )
- throw( CommandIOException, exceptions::UnsupportedOperationException ) {
+ throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException ) {
try{
@@ -110,7 +111,7 @@
return connectedCmd;
}
}
- AMQ_CATCH_RETHROW( exceptions::UnsupportedOperationException )
+ AMQ_CATCH_RETHROW( decaf::lang::exceptions::UnsupportedOperationException )
AMQ_CATCH_RETHROW( CommandIOException )
AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, CommandIOException )
AMQ_CATCHALL_THROW( CommandIOException )
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectionNegotiator.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectionNegotiator.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectionNegotiator.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectionNegotiator.h Thu Nov 8 13:02:02 2007
@@ -20,10 +20,10 @@
#include <activemq/transport/TransportFilter.h>
#include <activemq/transport/Command.h>
-#include <activemq/concurrent/Mutex.h>
-#include <activemq/concurrent/CountDownLatch.h>
-#include <activemq/concurrent/Concurrent.h>
#include <activemq/connector/stomp/commands/ConnectedCommand.h>
+#include <decaf/util/concurrent/Mutex.h>
+#include <decaf/util/concurrent/CountDownLatch.h>
+#include <decaf/util/concurrent/Concurrent.h>
namespace activemq{
namespace connector{
@@ -45,7 +45,7 @@
/**
* Latch objects to count down till we receive the wireFormat info
*/
- concurrent::CountDownLatch readyCountDownLatch;
+ decaf::util::concurrent::CountDownLatch readyCountDownLatch;
/**
* Indicates Transport has shut down
@@ -160,7 +160,7 @@
* by this transport.
*/
virtual void oneway( transport::Command* command )
- throw( transport::CommandIOException, exceptions::UnsupportedOperationException );
+ throw( transport::CommandIOException, decaf::lang::exceptions::UnsupportedOperationException );
/**
* Sends the given request to the server and waits for the response.
@@ -171,7 +171,7 @@
* @throws CommandIOException if an error occurs with the request.
*/
virtual transport::Response* request( transport::Command* command )
- throw( transport::CommandIOException, exceptions::UnsupportedOperationException );
+ throw( transport::CommandIOException, decaf::lang::exceptions::UnsupportedOperationException );
/**
* This is called in the context of the nested transport's
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnector.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnector.cpp?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnector.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnector.cpp Thu Nov 8 13:02:02 2007
@@ -15,8 +15,8 @@
* limitations under the License.
*/
+#include <activemq/util/Config.h>
#include <activemq/connector/stomp/StompConnector.h>
-#include <activemq/concurrent/Concurrent.h>
#include <activemq/transport/Transport.h>
#include <activemq/connector/stomp/StompTopic.h>
#include <activemq/connector/stomp/StompQueue.h>
@@ -34,8 +34,8 @@
#include <activemq/connector/stomp/StompProducerInfo.h>
#include <activemq/connector/stomp/StompTransactionInfo.h>
#include <activemq/connector/stomp/StompConnectionNegotiator.h>
-#include <activemq/util/Long.h>
-#include <activemq/util/Config.h>
+#include <decaf/lang/Long.h>
+#include <decaf/util/concurrent/Concurrent.h>
using namespace std;
using namespace activemq;
@@ -46,11 +46,15 @@
using namespace activemq::connector::stomp;
using namespace activemq::connector::stomp::commands;
-LOGCMS_INITIALIZE(logger, StompConnector, "activemq.connector.stomp.StompConnector" )
+using namespace decaf::lang;
+using namespace decaf::util;
+using namespace decaf::lang::exceptions;
+
+LOGDECAF_INITIALIZE(logger, StompConnector, "activemq.connector.stomp.StompConnector" )
////////////////////////////////////////////////////////////////////////////////
StompConnector::StompConnector( Transport* transport,
- const util::Properties& properties )
+ const decaf::util::Properties& properties )
throw ( IllegalArgumentException )
{
if( transport == NULL )
@@ -788,7 +792,7 @@
}
// We were not closing - log the stack trace.
- LOGCMS_WARN(logger, ex.getStackTraceString() );
+ LOGDECAF_WARN(logger, ex.getStackTraceString() );
// Inform the user of the error.
fire( ex );
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnector.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnector.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnector.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnector.h Thu Nov 8 13:02:02 2007
@@ -22,16 +22,16 @@
#include <activemq/transport/Transport.h>
#include <activemq/transport/CommandListener.h>
#include <activemq/transport/TransportExceptionListener.h>
-#include <activemq/concurrent/Mutex.h>
-#include <activemq/util/Properties.h>
+#include <decaf/util/concurrent/Mutex.h>
+#include <decaf/util/Properties.h>
#include <activemq/connector/stomp/StompCommandReader.h>
#include <activemq/connector/stomp/StompCommandWriter.h>
#include <activemq/connector/stomp/StompCommandListener.h>
#include <activemq/connector/stomp/StompSessionManager.h>
#include <activemq/connector/stomp/commands/CommandConstants.h>
#include <activemq/core/ActiveMQConstants.h>
-#include <activemq/exceptions/IllegalArgumentException.h>
-#include <activemq/logger/LoggerDefines.h>
+#include <decaf/lang/exceptions/IllegalArgumentException.h>
+#include <decaf/util/logging/LoggerDefines.h>
#include <activemq/util/LongSequenceGenerator.h>
namespace activemq{
@@ -49,7 +49,7 @@
public StompCommandListener
{
- LOGCMS_DECLARE( logger )
+ LOGDECAF_DECLARE( logger )
private:
@@ -72,7 +72,7 @@
/**
* Sync object.
*/
- concurrent::Mutex mutex;
+ decaf::util::concurrent::Mutex mutex;
/**
* Observer of messages directed at a particular
@@ -118,7 +118,7 @@
/**
* Properties for the connector.
*/
- util::Properties properties;
+ decaf::util::Properties properties;
private:
@@ -154,8 +154,8 @@
* @param properties properties for configuring the connector.
*/
StompConnector( transport::Transport* transport,
- const util::Properties& properties )
- throw ( exceptions::IllegalArgumentException );
+ const decaf::util::Properties& properties )
+ throw ( decaf::lang::exceptions::IllegalArgumentException );
virtual ~StompConnector();
@@ -211,10 +211,10 @@
* @throws InvalidStateException if the Transport is not set
*/
virtual transport::Transport& getTransport() const
- throw ( exceptions::InvalidStateException ) {
+ throw ( decaf::lang::exceptions::InvalidStateException ) {
if( transport == NULL ) {
- throw exceptions::InvalidStateException(
+ throw decaf::lang::exceptions::InvalidStateException(
__FILE__, __LINE__,
"StompConnector::getTransport - "
"Invalid State, No Transport.");
@@ -322,7 +322,7 @@
*/
virtual cms::TemporaryTopic* createTemporaryTopic(
SessionInfo* session )
- throw ( ConnectorException, exceptions::UnsupportedOperationException );
+ throw ( ConnectorException, decaf::lang::exceptions::UnsupportedOperationException );
/**
* Creates a Temporary Queue given a name and session info
@@ -332,7 +332,7 @@
*/
virtual cms::TemporaryQueue* createTemporaryQueue(
SessionInfo* session )
- throw ( ConnectorException, exceptions::UnsupportedOperationException );
+ throw ( ConnectorException, decaf::lang::exceptions::UnsupportedOperationException );
/**
* Sends a Message
@@ -438,7 +438,7 @@
virtual cms::MapMessage* createMapMessage(
SessionInfo* session,
TransactionInfo* transaction )
- throw ( ConnectorException, exceptions::UnsupportedOperationException );
+ throw ( ConnectorException, decaf::lang::exceptions::UnsupportedOperationException );
/**
* Unsubscribe from a givenDurable Subscription
@@ -446,7 +446,7 @@
* @throws ConnectorException
*/
virtual void unsubscribe( const std::string& name )
- throw ( ConnectorException, exceptions::UnsupportedOperationException );
+ throw ( ConnectorException, decaf::lang::exceptions::UnsupportedOperationException );
/**
* Closes the given connector resource, caller must still delete
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectorFactory.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectorFactory.cpp?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectorFactory.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectorFactory.cpp Thu Nov 8 13:02:02 2007
@@ -28,7 +28,7 @@
////////////////////////////////////////////////////////////////////////////////
Connector* StompConnectorFactory::createConnector(
- const activemq::util::Properties& properties,
+ const decaf::util::Properties& properties,
activemq::transport::Transport* transport )
{
return dynamic_cast<Connector*>(
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectorFactory.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectorFactory.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectorFactory.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnectorFactory.h Thu Nov 8 13:02:02 2007
@@ -27,17 +27,17 @@
class StompConnectorFactory : public connector::ConnectorFactory
{
public:
-
+
virtual ~StompConnectorFactory(void) {}
-
- /**
+
+ /**
* Creates a StompConnector
- * @param properties The Properties that the new connector is
+ * @param properties The Properties that the new connector is
* configured with
* @param transport the Transport instance this connector uses.
*/
virtual Connector* createConnector(
- const activemq::util::Properties& properties,
+ const decaf::util::Properties& properties,
activemq::transport::Transport* transport );
/**
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompDestination.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompDestination.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompDestination.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompDestination.h Thu Nov 8 13:02:02 2007
@@ -20,9 +20,10 @@
#include <string>
+#include <activemq/exceptions/ActiveMQException.h>
#include <activemq/util/ActiveMQProperties.h>
-#include <activemq/util/StringTokenizer.h>
-#include <activemq/exceptions/IllegalArgumentException.h>
+#include <decaf/util/StringTokenizer.h>
+#include <decaf/lang/exceptions/IllegalArgumentException.h>
#include <cms/Destination.h>
@@ -68,7 +69,7 @@
cms::Destination::DestinationType destType ) {
try
{
- util::StringTokenizer tokenizer(dest, "?&");
+ decaf::util::StringTokenizer tokenizer(dest, "?&");
std::vector<std::string> tokens;
// Set the type, we know that much anyway
@@ -77,7 +78,7 @@
// Require that there at least one token, the dest
if( tokenizer.countTokens() < 1 )
{
- throw exceptions::IllegalArgumentException(
+ throw decaf::lang::exceptions::IllegalArgumentException(
__FILE__, __LINE__,
( std::string(
"ActiveMQDestination::ActiveMQDestination - "
@@ -96,7 +97,7 @@
if( tokenizer.countTokens() != 2 )
{
- throw exceptions::IllegalArgumentException(
+ throw decaf::lang::exceptions::IllegalArgumentException(
__FILE__, __LINE__,
( std::string(
"ActiveMQDestination::ActiveMQDestination - "
@@ -111,9 +112,9 @@
properties.setProperty( key, value );
}
}
- AMQ_CATCH_RETHROW( exceptions::IllegalArgumentException )
- AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, exceptions::IllegalArgumentException )
- AMQ_CATCHALL_THROW( exceptions::IllegalArgumentException )
+ AMQ_CATCH_RETHROW( decaf::lang::exceptions::IllegalArgumentException )
+ AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::lang::exceptions::IllegalArgumentException )
+ AMQ_CATCHALL_THROW( decaf::lang::exceptions::IllegalArgumentException )
}
virtual ~StompDestination() {}
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompFrame.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompFrame.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompFrame.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompFrame.h Thu Nov 8 13:02:02 2007
@@ -21,7 +21,7 @@
#include <string>
#include <string.h>
#include <map>
-#include <activemq/util/Properties.h>
+#include <decaf/util/Properties.h>
namespace activemq{
namespace connector{
@@ -86,8 +86,8 @@
* Gets access to the header properties for this frame.
* @return the Properties object owned by this Frame
*/
- util::Properties& getProperties(){ return properties; }
- const util::Properties& getProperties() const {
+ decaf::util::Properties& getProperties(){ return properties; }
+ const decaf::util::Properties& getProperties() const {
return properties;
}
@@ -133,7 +133,7 @@
std::string command;
// Properties of the Stomp Message
- util::Properties properties;
+ decaf::util::Properties properties;
// Byte data of Body.
std::vector<unsigned char> body;
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompResponseBuilder.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompResponseBuilder.cpp?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompResponseBuilder.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompResponseBuilder.cpp Thu Nov 8 13:02:02 2007
@@ -22,13 +22,13 @@
#include <activemq/connector/stomp/commands/SubscribeCommand.h>
#include <activemq/connector/stomp/commands/UnsubscribeCommand.h>
-#include <activemq/util/Guid.h>
+#include <decaf/util/UUID.h>
using namespace activemq;
-using namespace activemq::util;
using namespace activemq::connector;
using namespace activemq::connector::stomp;
using namespace activemq::transport;
+using namespace decaf::util;
////////////////////////////////////////////////////////////////////////////////
Response* StompResponseBuilder::buildResponse( const transport::Command* cmd ){
@@ -46,7 +46,7 @@
////////////////////////////////////////////////////////////////////////////////
void StompResponseBuilder::buildIncomingCommands(
- const transport::Command* command, util::Queue<transport::Command*>& queue ){
+ const transport::Command* command, decaf::util::Queue<transport::Command*>& queue ){
const commands::ConnectCommand* connectCommand =
dynamic_cast<const commands::ConnectCommand*>( command );
@@ -56,7 +56,7 @@
resp->setCorrelationId( connectCommand->getCommandId() );
if( connectCommand->getClientId() == NULL ) {
- resp->setSessionId( Guid::createGUIDString() );
+ resp->setSessionId( UUID::randomUUID().toString() );
} else {
resp->setSessionId( connectCommand->getClientId() );
}
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompResponseBuilder.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompResponseBuilder.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompResponseBuilder.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompResponseBuilder.h Thu Nov 8 13:02:02 2007
@@ -32,7 +32,7 @@
virtual transport::Response* buildResponse( const transport::Command* cmd );
virtual void buildIncomingCommands(
- const transport::Command* cmd, util::Queue<transport::Command*>& queue );
+ const transport::Command* cmd, decaf::util::Queue<transport::Command*>& queue );
};
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompSessionManager.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompSessionManager.cpp?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompSessionManager.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompSessionManager.cpp Thu Nov 8 13:02:02 2007
@@ -19,24 +19,29 @@
#include <activemq/core/ActiveMQMessage.h>
#include <activemq/core/ActiveMQConstants.h>
-#include <activemq/concurrent/Concurrent.h>
+#include <decaf/util/concurrent/Concurrent.h>
#include <activemq/connector/stomp/StompSessionInfo.h>
#include <activemq/connector/stomp/StompConsumerInfo.h>
#include <activemq/connector/stomp/commands/SubscribeCommand.h>
#include <activemq/connector/stomp/commands/UnsubscribeCommand.h>
#include <activemq/connector/stomp/StompSelector.h>
-#include <activemq/util/Properties.h>
+#include <decaf/util/Properties.h>
+#include <decaf/lang/Boolean.h>
+#include <decaf/lang/Integer.h>
#include <activemq/util/Config.h>
using namespace std;
using namespace activemq;
using namespace activemq::core;
-using namespace activemq::util;
using namespace activemq::exceptions;
using namespace activemq::transport;
using namespace activemq::connector;
using namespace activemq::connector::stomp;
using namespace activemq::connector::stomp::commands;
+using namespace decaf::lang;
+using namespace decaf::util;
+using namespace decaf::util::concurrent;
+using namespace decaf::lang::exceptions;
////////////////////////////////////////////////////////////////////////////////
StompSessionManager::StompSessionManager( const std::string& connectionId,
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompSessionManager.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompSessionManager.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompSessionManager.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompSessionManager.h Thu Nov 8 13:02:02 2007
@@ -21,7 +21,7 @@
#include <activemq/connector/SessionInfo.h>
#include <activemq/connector/ConsumerInfo.h>
#include <activemq/transport/Transport.h>
-#include <activemq/concurrent/Mutex.h>
+#include <decaf/util/concurrent/Mutex.h>
#include <activemq/connector/ConnectorException.h>
#include <activemq/connector/Connector.h>
#include <activemq/connector/stomp/StompCommandListener.h>
@@ -58,7 +58,7 @@
long long nextConsumerId;
// Mutex to protect ids.
- concurrent::Mutex mutex;
+ decaf::util::concurrent::Mutex mutex;
// Mapping of a Session to all the consumer's
DestinationMap destinationMap;
@@ -140,7 +140,7 @@
const std::string& selector = "",
bool noLocal = false )
throw ( StompConnectorException );
-
+
/**
* Given a valid Consumer info Object that was previously created
* by a call to <code>createConsumer</code>, the Consumer will be
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/AbstractCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/AbstractCommand.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/AbstractCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/AbstractCommand.h Thu Nov 8 13:02:02 2007
@@ -21,11 +21,11 @@
#include <activemq/connector/stomp/StompFrame.h>
#include <activemq/connector/stomp/commands/StompCommand.h>
#include <activemq/transport/Command.h>
-#include <activemq/exceptions/NullPointerException.h>
-#include <activemq/util/Integer.h>
-#include <activemq/util/Long.h>
+#include <decaf/lang/exceptions/NullPointerException.h>
+#include <decaf/lang/Integer.h>
+#include <decaf/lang/Long.h>
#include <activemq/util/Config.h>
-#include <activemq/util/Character.h>
+#include <decaf/lang/Character.h>
#include <typeinfo>
#include <sstream>
@@ -57,7 +57,7 @@
StompFrame& getFrame() {
if( frame == NULL ){
- throw exceptions::NullPointerException(
+ throw decaf::lang::exceptions::NullPointerException(
__FILE__, __LINE__,
"AbstractCommand::getFrame - Frame not initialized");
}
@@ -67,7 +67,7 @@
const StompFrame& getFrame() const {
if( frame == NULL ){
- throw exceptions::NullPointerException(
+ throw decaf::lang::exceptions::NullPointerException(
__FILE__, __LINE__,
"AbstractCommand::getFrame - Frame not initialized");
}
@@ -130,7 +130,7 @@
for( std::size_t ix=0; ix<bytes.size(); ++ix ){
char c = (char)bytes[ix];
- if( util::Character::isLetterOrDigit(c) || util::Character::isWhitespace(c) ){
+ if( decaf::lang::Character::isLetterOrDigit(c) || decaf::lang::Character::isWhitespace(c) ){
ostream << c;
}
else
@@ -159,10 +159,10 @@
* Gets the properties map for this command.
* @return Reference to a Properties object
*/
- virtual util::Properties& getProperties(){
+ virtual decaf::util::Properties& getProperties(){
return getFrame().getProperties();
}
- virtual const util::Properties& getProperties() const{
+ virtual const decaf::util::Properties& getProperties() const{
return getFrame().getProperties();
}
@@ -182,7 +182,7 @@
* @return Command Id
*/
virtual int getCommandId() const {
- return util::Integer::parseInt(
+ return decaf::lang::Integer::parseInt(
getPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_REQUESTID ),
@@ -212,7 +212,7 @@
* @return the Correlation Id
*/
virtual int getCorrelationId() const {
- return util::Integer::parseInt(
+ return decaf::lang::Integer::parseInt(
getPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_RESPONSEID ),
@@ -227,7 +227,7 @@
setPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_RESPONSEID),
- util::Integer::toString( corrId ) );
+ decaf::lang::Integer::toString( corrId ) );
}
/**
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h Thu Nov 8 13:02:02 2007
@@ -21,11 +21,12 @@
#include <cms/BytesMessage.h>
#include <activemq/connector/stomp/commands/StompMessage.h>
#include <activemq/connector/stomp/commands/CommandConstants.h>
-#include <activemq/exceptions/IllegalStateException.h>
-#include <activemq/io/ByteArrayInputStream.h>
-#include <activemq/io/ByteArrayOutputStream.h>
-#include <activemq/io/DataInputStream.h>
-#include <activemq/io/DataOutputStream.h>
+#include <decaf/lang/Long.h>
+#include <decaf/lang/exceptions/IllegalStateException.h>
+#include <decaf/io/ByteArrayInputStream.h>
+#include <decaf/io/ByteArrayOutputStream.h>
+#include <decaf/io/DataInputStream.h>
+#include <decaf/io/DataOutputStream.h>
namespace activemq{
namespace connector{
@@ -52,23 +53,23 @@
* InputStream that wraps around the frame's body when in read-only
* mode.
*/
- mutable io::ByteArrayInputStream inputStream;
+ mutable decaf::io::ByteArrayInputStream inputStream;
/**
* OutputStream that wraps around the frame's body when in write-only
* mode.
*/
- io::ByteArrayOutputStream outputStream;
+ decaf::io::ByteArrayOutputStream outputStream;
/**
* DataInputStream wrapper around the input stream.
*/
- mutable io::DataInputStream dataInputStream;
+ mutable decaf::io::DataInputStream dataInputStream;
/**
* DataOutputStream wrapper around the output stream.
*/
- io::DataOutputStream dataOutputStream;
+ decaf::io::DataOutputStream dataOutputStream;
public:
@@ -138,7 +139,7 @@
setPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_CONTENTLENGTH),
- util::Long::toString( getFrame().getBodyLength() ) );
+ decaf::lang::Long::toString( getFrame().getBodyLength() ) );
return StompMessage<cms::BytesMessage>::marshal();
}
@@ -519,7 +520,7 @@
*/
void checkWriteOnly() const throw (cms::CMSException){
if( readOnly ){
- throw exceptions::IllegalStateException( __FILE__, __LINE__,
+ throw decaf::lang::exceptions::IllegalStateException( __FILE__, __LINE__,
"message is in read-only mode and cannot be written to" );
}
}
@@ -530,7 +531,7 @@
*/
void checkReadOnly() const throw (cms::CMSException){
if( !readOnly ){
- throw exceptions::IllegalStateException( __FILE__, __LINE__,
+ throw decaf::lang::exceptions::IllegalStateException( __FILE__, __LINE__,
"message is in write-only mode and cannot be read from" );
}
}
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommandConstants.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommandConstants.cpp?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommandConstants.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommandConstants.cpp Thu Nov 8 13:02:02 2007
@@ -23,9 +23,9 @@
using namespace std;
using namespace activemq;
-using namespace activemq::exceptions;
using namespace activemq::connector::stomp;
using namespace activemq::connector::stomp::commands;
+using namespace decaf::lang::exceptions;
////////////////////////////////////////////////////////////////////////////////
const char* CommandConstants::queuePrefix = "/queue/";
@@ -118,7 +118,7 @@
////////////////////////////////////////////////////////////////////////////////
cms::Destination* CommandConstants::toDestination( const std::string& dest )
- throw ( exceptions::IllegalArgumentException )
+ throw ( decaf::lang::exceptions::IllegalArgumentException )
{
std::size_t qpos = dest.find(queuePrefix);
std::size_t tpos = dest.find(topicPrefix);
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommandConstants.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommandConstants.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommandConstants.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/CommandConstants.h Thu Nov 8 13:02:02 2007
@@ -18,7 +18,7 @@
#define ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_COMMANDCONSTANTS_H_
#include <cms/Destination.h>
-#include <activemq/exceptions/IllegalArgumentException.h>
+#include <decaf/lang/exceptions/IllegalArgumentException.h>
#include <string>
#include <map>
@@ -178,7 +178,7 @@
}
static cms::Destination* toDestination( const std::string& dest )
- throw ( exceptions::IllegalArgumentException );
+ throw ( decaf::lang::exceptions::IllegalArgumentException );
class StaticInitializer{
public:
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ConnectCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ConnectCommand.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ConnectCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/ConnectCommand.h Thu Nov 8 13:02:02 2007
@@ -62,7 +62,7 @@
setPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_REQUESTID),
- util::Integer::toString( id ) );
+ decaf::lang::Integer::toString( id ) );
}
/**
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/StompCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/StompCommand.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/StompCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/StompCommand.h Thu Nov 8 13:02:02 2007
@@ -108,8 +108,8 @@
* Retrieves the Properties that are part of this command
* @return const reference to a properties object
*/
- virtual util::Properties& getProperties() = 0;
- virtual const util::Properties& getProperties() const = 0;
+ virtual decaf::util::Properties& getProperties() = 0;
+ virtual const decaf::util::Properties& getProperties() const = 0;
/**
* Clone the StompCommand and return the new copy.
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/StompMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/StompMessage.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/StompMessage.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/StompMessage.h Thu Nov 8 13:02:02 2007
@@ -23,14 +23,14 @@
#include <activemq/connector/stomp/commands/AbstractCommand.h>
#include <activemq/transport/Command.h>
#include <activemq/connector/stomp/StompTopic.h>
-#include <activemq/exceptions/IllegalArgumentException.h>
-#include <activemq/exceptions/NoSuchElementException.h>
-#include <activemq/exceptions/RuntimeException.h>
-
-#include <activemq/util/Date.h>
-#include <activemq/util/Long.h>
-#include <activemq/util/Integer.h>
-#include <activemq/util/Boolean.h>
+
+#include <decaf/lang/exceptions/IllegalArgumentException.h>
+#include <decaf/lang/exceptions/NoSuchElementException.h>
+#include <decaf/lang/exceptions/RuntimeException.h>
+#include <decaf/util/Date.h>
+#include <decaf/lang/Long.h>
+#include <decaf/lang/Integer.h>
+#include <decaf/lang/Boolean.h>
#include <string>
#include <sstream>
@@ -120,7 +120,7 @@
*/
virtual void clearProperties(){
- util::Properties& props = getFrame().getProperties();
+ decaf::util::Properties& props = getFrame().getProperties();
std::vector< std::pair< std::string, std::string > > propArray = props.toArray();
for( unsigned int ix=0; ix<propArray.size(); ++ix ){
@@ -141,7 +141,7 @@
virtual std::vector<std::string> getPropertyNames() const{
std::vector<std::string> names;
- const util::Properties& props = getFrame().getProperties();
+ const decaf::util::Properties& props = getFrame().getProperties();
std::vector< std::pair< std::string, std::string > > propArray = props.toArray();
for( unsigned int ix=0; ix<propArray.size(); ++ix ){
@@ -299,7 +299,7 @@
return cms::DeliveryMode::PERSISTENT;
}
- if( util::Boolean::parseBoolean( getPropertyValue(
+ if( decaf::lang::Boolean::parseBoolean( getPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_PERSISTENT ) ) ) == true ) {
return (int)cms::DeliveryMode::PERSISTENT;
@@ -354,7 +354,7 @@
* @return time value
*/
virtual long long getCMSExpiration() const {
- return util::Long::parseLong( getPropertyValue(
+ return decaf::lang::Long::parseLong( getPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_EXPIRES ), "0" ) );
}
@@ -367,7 +367,7 @@
setPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_EXPIRES) ,
- util::Long::toString( expireTime ) );
+ decaf::lang::Long::toString( expireTime ) );
}
/**
@@ -396,7 +396,7 @@
* @return priority value
*/
virtual int getCMSPriority() const {
- return util::Integer::parseInt( getPropertyValue(
+ return decaf::lang::Integer::parseInt( getPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_JMSPRIORITY ), "0" ) );
}
@@ -409,7 +409,7 @@
setPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_JMSPRIORITY),
- util::Integer::toString( priority ) );
+ decaf::lang::Integer::toString( priority ) );
}
/**
@@ -417,7 +417,7 @@
* @return redelivered value
*/
virtual bool getCMSRedelivered() const {
- return util::Boolean::parseBoolean( getPropertyValue(
+ return decaf::lang::Boolean::parseBoolean( getPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_REDELIVERED ),
"false" ) );
@@ -431,7 +431,7 @@
setPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_REDELIVERED ),
- util::Boolean::toString( redelivered ) );
+ decaf::lang::Boolean::toString( redelivered ) );
}
/**
@@ -463,7 +463,7 @@
* @return time stamp value
*/
virtual long long getCMSTimestamp() const {
- return util::Long::parseLong( getPropertyValue(
+ return decaf::lang::Long::parseLong( getPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_TIMESTAMP ), "0" ) );
}
@@ -476,7 +476,7 @@
setPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_TIMESTAMP ),
- util::Long::toString( timeStamp ) );
+ decaf::lang::Long::toString( timeStamp ) );
}
/**
@@ -529,7 +529,7 @@
* @return redelivery count
*/
virtual int getRedeliveryCount() const {
- return util::Integer::parseInt( getPropertyValue(
+ return decaf::lang::Integer::parseInt( getPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_REDELIVERYCOUNT ),
"0" ) );
@@ -544,7 +544,7 @@
setPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_REDELIVERYCOUNT ),
- util::Integer::toString( count ) );
+ decaf::lang::Integer::toString( count ) );
}
/**
@@ -554,7 +554,7 @@
*/
virtual bool isExpired() const {
long long expireTime = this->getCMSExpiration();
- long long currentTime = util::Date::getCurrentTimeMilliseconds();
+ long long currentTime = decaf::util::Date::getCurrentTimeMilliseconds();
if( expireTime > 0 && currentTime > expireTime ) {
return true;
}
@@ -570,7 +570,7 @@
virtual void testProperty( const std::string& name ) const
throw( cms::CMSException ){
if( CommandConstants::isStompHeader( name ) ){
- throw exceptions::IllegalArgumentException( __FILE__, __LINE__,
+ throw decaf::lang::exceptions::IllegalArgumentException( __FILE__, __LINE__,
"searching for property with name of pre-defined header" );
}
}
@@ -586,7 +586,7 @@
testProperty( name );
if( !getProperties().hasProperty( name ) ){
- throw exceptions::NoSuchElementException(
+ throw decaf::lang::exceptions::NoSuchElementException(
__FILE__, __LINE__,
"property not available in message" );
}
@@ -597,7 +597,7 @@
stream >> value;
if( stream.fail() ){
- throw exceptions::RuntimeException(
+ throw decaf::lang::exceptions::RuntimeException(
__FILE__, __LINE__,
"Error extracting property from string" );
}
Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/SubscribeCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/SubscribeCommand.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/SubscribeCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/commands/SubscribeCommand.h Thu Nov 8 13:02:02 2007
@@ -21,7 +21,7 @@
#include <activemq/connector/stomp/commands/AbstractCommand.h>
#include <activemq/connector/stomp/commands/CommandConstants.h>
#include <activemq/transport/Command.h>
-#include <activemq/util/Boolean.h>
+#include <decaf/lang/Boolean.h>
namespace activemq{
namespace connector{
@@ -151,7 +151,7 @@
* @return NoLocal value
*/
virtual bool getNoLocal(void) const {
- return util::Boolean::parseBoolean( getPropertyValue(
+ return decaf::lang::Boolean::parseBoolean( getPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_NOLOCAL ),
"false" ) );
@@ -166,7 +166,7 @@
setPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_NOLOCAL ),
- util::Boolean::toString( noLocal ) );
+ decaf::lang::Boolean::toString( noLocal ) );
}
/**
@@ -175,7 +175,7 @@
* @return true if in dispatch async mode
*/
virtual bool getDispatchAsync() const {
- return util::Boolean::parseBoolean( getPropertyValue(
+ return decaf::lang::Boolean::parseBoolean( getPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_DISPATCH_ASYNC ),
"false" ) );
@@ -190,7 +190,7 @@
setPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_DISPATCH_ASYNC ),
- util::Boolean::toString( dispatchAsync ) );
+ decaf::lang::Boolean::toString( dispatchAsync ) );
}
/**
@@ -199,7 +199,7 @@
* @return true for exclusive mode
*/
virtual bool getExclusive() const {
- return util::Boolean::parseBoolean( getPropertyValue(
+ return decaf::lang::Boolean::parseBoolean( getPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_EXCLUSIVE ),
"false" ) );
@@ -214,7 +214,7 @@
setPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_EXCLUSIVE ),
- util::Boolean::toString( exclusive ) );
+ decaf::lang::Boolean::toString( exclusive ) );
}
/**
@@ -226,7 +226,7 @@
* @return Max value
*/
virtual int getMaxPendingMsgLimit() const {
- return util::Integer::parseInt( getPropertyValue(
+ return decaf::lang::Integer::parseInt( getPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_MAXPENDINGMSGLIMIT ),
"0" ) );
@@ -244,7 +244,7 @@
setPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_MAXPENDINGMSGLIMIT ),
- util::Integer::toString( limit ) );
+ decaf::lang::Integer::toString( limit ) );
}
/**
@@ -256,7 +256,7 @@
* @return prefetch size value
*/
virtual int getPrefetchSize() const {
- return util::Integer::parseInt( getPropertyValue(
+ return decaf::lang::Integer::parseInt( getPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_PREFETCHSIZE ),
"1000" ) );
@@ -274,7 +274,7 @@
setPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_PREFETCHSIZE ),
- util::Integer::toString( size ) );
+ decaf::lang::Integer::toString( size ) );
}
/**
@@ -283,7 +283,7 @@
* @return priority level
*/
virtual int getPriority() const {
- return util::Integer::parseInt( getPropertyValue(
+ return decaf::lang::Integer::parseInt( getPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_CONSUMERPRIORITY ),
"0" ) );
@@ -298,7 +298,7 @@
setPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_CONSUMERPRIORITY ),
- util::Integer::toString( priority ) );
+ decaf::lang::Integer::toString( priority ) );
}
/**
@@ -307,7 +307,7 @@
* @return true for retroactive mode
*/
virtual bool getRetroactive() const {
- return util::Boolean::parseBoolean( getPropertyValue(
+ return decaf::lang::Boolean::parseBoolean( getPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_RETROACTIVE ),
"false" ) );
@@ -322,7 +322,7 @@
setPropertyValue(
CommandConstants::toString(
CommandConstants::HEADER_RETROACTIVE ),
- util::Boolean::toString( retroactive ) );
+ decaf::lang::Boolean::toString( retroactive ) );
}
protected:
Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.cpp?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.cpp Thu Nov 8 13:02:02 2007
@@ -20,14 +20,16 @@
#include <cms/Session.h>
#include <activemq/core/ActiveMQSession.h>
#include <activemq/core/ActiveMQConsumer.h>
-#include <activemq/exceptions/NullPointerException.h>
-#include <activemq/util/Boolean.h>
-#include <activemq/util/Iterator.h>
+#include <decaf/lang/exceptions/NullPointerException.h>
+#include <decaf/lang/Boolean.h>
+#include <decaf/util/Iterator.h>
using namespace cms;
using namespace activemq;
using namespace activemq::core;
-using namespace activemq::util;
+using namespace decaf::util;
+using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
using namespace activemq::connector;
using namespace activemq::exceptions;
using namespace std;
@@ -200,7 +202,7 @@
try {
if( connectionData == NULL) {
- NullPointerException ex(
+ ActiveMQException ex(
__FILE__, __LINE__,
"ActiveMQConnection::onConsumerMessage - "
"Connection Data Null, could be closed." );
Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.h Thu Nov 8 13:02:02 2007
@@ -24,9 +24,10 @@
#include <activemq/core/ActiveMQMessage.h>
#include <activemq/core/Dispatcher.h>
#include <activemq/connector/ConsumerMessageListener.h>
-#include <activemq/util/Properties.h>
-#include <activemq/util/Map.h>
-#include <activemq/util/Set.h>
+#include <activemq/exceptions/ActiveMQException.h>
+#include <decaf/util/Properties.h>
+#include <decaf/util/Map.h>
+#include <decaf/util/Set.h>
#include <string>
@@ -77,12 +78,12 @@
/**
* Map of message dispatchers indexed by consumer id.
*/
- util::Map< long long, Dispatcher* > dispatchers;
+ decaf::util::Map< long long, Dispatcher* > dispatchers;
/**
* Maintain the set of all active sessions.
*/
- util::Set<ActiveMQSession*> activeSessions;
+ decaf::util::Set<ActiveMQSession*> activeSessions;
public:
@@ -210,12 +211,9 @@
* Notify the excpetion listener
* @param ex the exception to fire
*/
- void fire( exceptions::ActiveMQException& ex )
- {
- if( exceptionListener != NULL )
- {
- try
- {
+ void fire( exceptions::ActiveMQException& ex ) {
+ if( exceptionListener != NULL ) {
+ try {
exceptionListener->onException( ex );
}
catch(...){}
@@ -226,4 +224,4 @@
}}
-#endif /*ACTIVEMQCONNECTION_H_*/
+#endif /*_ACTIVEMQ_CORE_ACTIVEMQCONNECTION_H_*/
Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnectionData.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnectionData.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnectionData.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnectionData.h Thu Nov 8 13:02:02 2007
@@ -19,8 +19,8 @@
#include <activemq/connector/Connector.h>
#include <activemq/transport/Transport.h>
-#include <activemq/exceptions/IllegalArgumentException.h>
-#include <activemq/util/Properties.h>
+#include <decaf/lang/exceptions/IllegalArgumentException.h>
+#include <decaf/util/Properties.h>
namespace activemq{
namespace core{
@@ -30,19 +30,18 @@
* object. Each ActiveMQConnection owns one of these objects. This
* object knows how to clean up the Connection Dependencies correctly
*/
- class ActiveMQConnectionData
- {
+ class ActiveMQConnectionData {
private:
-
+
// Connector Object
connector::Connector* connector;
-
+
// Transport we are using
transport::Transport* transport;
-
+
// Properties used to configure this connection.
- util::Properties* properties;
-
+ decaf::util::Properties* properties;
+
public:
/**
@@ -55,13 +54,13 @@
*/
ActiveMQConnectionData( connector::Connector* connector,
transport::Transport* transport,
- util::Properties* properties )
+ decaf::util::Properties* properties )
{
- if( connector == NULL ||
- transport == NULL ||
+ if( connector == NULL ||
+ transport == NULL ||
properties == NULL )
{
- throw exceptions::IllegalArgumentException(
+ throw decaf::lang::exceptions::IllegalArgumentException(
__FILE__, __LINE__,
"ActiveMQConnectionData::ActiveMQConnectionData - "
"Required Parameter was NULL.");
@@ -71,33 +70,33 @@
this->transport = transport;
this->properties = properties;
}
-
+
virtual ~ActiveMQConnectionData(){
close();
}
-
+
virtual void close() throw (exceptions::ActiveMQException) {
-
+
bool hasException = false;
exceptions::ActiveMQException e;
-
+
try
{
if( connector != NULL ){
-
+
try{
connector->close();
- }catch( exceptions::ActiveMQException& ex ){
+ }catch( exceptions::ActiveMQException& ex ){
if( !hasException ){
hasException = true;
ex.setMark(__FILE__, __LINE__ );
e = ex;
}
}
-
+
try{
delete connector;
- }catch( exceptions::ActiveMQException& ex ){
+ }catch( exceptions::ActiveMQException& ex ){
if( !hasException ){
hasException = true;
ex.setMark(__FILE__, __LINE__ );
@@ -106,22 +105,22 @@
}
connector = NULL;
}
-
+
if( transport != NULL ){
-
+
try{
transport->close();
- }catch( exceptions::ActiveMQException& ex ){
+ }catch( exceptions::ActiveMQException& ex ){
if( !hasException ){
hasException = true;
ex.setMark(__FILE__, __LINE__ );
e = ex;
}
}
-
+
try{
- delete transport;
- }catch( exceptions::ActiveMQException& ex ){
+ delete transport;
+ }catch( exceptions::ActiveMQException& ex ){
if( !hasException ){
hasException = true;
ex.setMark(__FILE__, __LINE__ );
@@ -130,12 +129,12 @@
}
transport = NULL;
}
-
+
if( properties != NULL ){
delete properties;
properties = NULL;
}
-
+
// If we encountered an exception - throw the first
// one we encountered.
if( hasException ){
@@ -167,10 +166,10 @@
* this Connection.
* @return Properties object reference.
*/
- virtual const util::Properties& getProperties() const {
+ virtual const decaf::util::Properties& getProperties() const {
return *properties;
}
-
+
};
}}
Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnectionFactory.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnectionFactory.cpp?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnectionFactory.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnectionFactory.cpp Thu Nov 8 13:02:02 2007
@@ -16,11 +16,11 @@
*/
#include "ActiveMQConnectionFactory.h"
-#include <activemq/util/Guid.h>
-#include <activemq/util/Properties.h>
+#include <decaf/util/UUID.h>
+#include <decaf/util/Properties.h>
+#include <decaf/lang/exceptions/NullPointerException.h>
#include <activemq/connector/ConnectorFactoryMap.h>
#include <activemq/transport/TransportBuilder.h>
-#include <activemq/exceptions/NullPointerException.h>
#include <activemq/core/ActiveMQConnection.h>
#include <activemq/core/ActiveMQConstants.h>
#include <activemq/support/LibraryInit.h>
@@ -28,10 +28,11 @@
using namespace std;
using namespace activemq;
using namespace activemq::core;
-using namespace activemq::util;
using namespace activemq::connector;
using namespace activemq::exceptions;
using namespace activemq::transport;
+using namespace decaf::util;
+using namespace decaf::lang::exceptions;
////////////////////////////////////////////////////////////////////////////////
cms::ConnectionFactory* cms::ConnectionFactory::createCMSConnectionFactory( const std::string& brokerURI )
@@ -63,7 +64,7 @@
cms::Connection* ActiveMQConnectionFactory::createConnection()
throw ( cms::CMSException ) {
- return createConnection( brokerURL, username, password, Guid::createGUIDString() );
+ return createConnection( brokerURL, username, password, UUID::randomUUID().toString() );
}
////////////////////////////////////////////////////////////////////////////////
@@ -72,7 +73,7 @@
const std::string& password )
throw ( cms::CMSException ) {
- return createConnection( brokerURL, username, password, Guid::createGUIDString() );
+ return createConnection( brokerURL, username, password, UUID::randomUUID().toString() );
}
////////////////////////////////////////////////////////////////////////////////
@@ -108,7 +109,7 @@
// if no Client Id specified, create one
if( clientIdLocal == "" ) {
- clientIdLocal = Guid::createGUIDString();
+ clientIdLocal = UUID::randomUUID().toString();
}
// Store login data in the properties
Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnectionFactory.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnectionFactory.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnectionFactory.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnectionFactory.h Thu Nov 8 13:02:02 2007
@@ -21,7 +21,6 @@
#include <cms/ConnectionFactory.h>
#include <cms/Connection.h>
-#include <activemq/util/Properties.h>
namespace activemq{
namespace core{
Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConstants.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConstants.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConstants.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConstants.h Thu Nov 8 13:02:02 2007
@@ -17,22 +17,20 @@
#ifndef ACTIVEMQ_CORE_ACTIVEMQCONSTANTS_H_
#define ACTIVEMQ_CORE_ACTIVEMQCONSTANTS_H_
-#include <activemq/exceptions/IllegalArgumentException.h>
-
#include <string>
#include <map>
namespace activemq{
namespace core{
-
+
/**
* Class holding constant values for various ActiveMQ specific things
* Each constant is defined as an enumeration and has functions that
* convert back an forth between string and enum values.
*/
- class ActiveMQConstants{
+ class ActiveMQConstants{
public:
-
+
/**
* These values represent the options that can be appended to an
* Destination name, i.e. /topic/foo?consumer.exclusive=true
@@ -52,7 +50,7 @@
/**
* These values represent the parameters that can be added to the
* connection URI that affect the ActiveMQ Core API
- */
+ */
enum URIParam
{
PARAM_USERNAME,
@@ -60,54 +58,54 @@
PARAM_CLIENTID,
NUM_PARAMS
};
-
+
static const std::string& toString( const DestinationOption option ){
return StaticInitializer::destOptions[option];
}
-
- static DestinationOption toDestinationOption( const std::string& option ){
- std::map< std::string, DestinationOption >::iterator iter =
+
+ static DestinationOption toDestinationOption( const std::string& option ){
+ std::map< std::string, DestinationOption >::iterator iter =
StaticInitializer::destOptionMap.find( option );
if( iter == StaticInitializer::destOptionMap.end() ){
return NUM_OPTIONS;
}
-
+
return iter->second;
- }
-
+ }
+
static const std::string& toString( const URIParam option ){
return StaticInitializer::uriParams[option];
}
-
- static URIParam toURIOption( const std::string& option ){
- std::map< std::string, URIParam >::iterator iter =
+
+ static URIParam toURIOption( const std::string& option ){
+ std::map< std::string, URIParam >::iterator iter =
StaticInitializer::uriParamsMap.find( option );
if( iter == StaticInitializer::uriParamsMap.end() ){
return NUM_PARAMS;
}
-
+
return iter->second;
- }
+ }
class StaticInitializer{
public:
StaticInitializer();
virtual ~StaticInitializer(){}
-
+
static std::string destOptions[NUM_OPTIONS];
static std::string uriParams[NUM_PARAMS];
static std::map<std::string, DestinationOption> destOptionMap;
static std::map<std::string, URIParam> uriParamsMap;
};
-
+
private:
-
- static StaticInitializer staticInits;
+
+ static StaticInitializer staticInits;
};
-
+
}}
#endif /*ACTIVEMQ_CORE_ACTIVEMQCONSTANTS_H_*/
Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConsumer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConsumer.cpp?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConsumer.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConsumer.cpp Thu Nov 8 13:02:02 2007
@@ -16,22 +16,25 @@
*/
#include "ActiveMQConsumer.h"
-#include <activemq/exceptions/NullPointerException.h>
-#include <activemq/exceptions/InvalidStateException.h>
-#include <activemq/exceptions/IllegalArgumentException.h>
+#include <decaf/lang/exceptions/NullPointerException.h>
+#include <decaf/lang/exceptions/InvalidStateException.h>
+#include <decaf/lang/exceptions/IllegalArgumentException.h>
+#include <decaf/util/Date.h>
+#include <activemq/util/Config.h>
+#include <activemq/exceptions/ExceptionDefines.h>
#include <activemq/core/ActiveMQSession.h>
#include <activemq/core/ActiveMQMessage.h>
-#include <activemq/util/Date.h>
#include <cms/ExceptionListener.h>
using namespace std;
using namespace cms;
using namespace activemq;
using namespace activemq::core;
-using namespace activemq::util;
using namespace activemq::connector;
using namespace activemq::exceptions;
-using namespace activemq::concurrent;
+using namespace decaf::lang::exceptions;
+using namespace decaf::util;
+using namespace decaf::util::concurrent;
////////////////////////////////////////////////////////////////////////////////
ActiveMQConsumer::ActiveMQConsumer( connector::ConsumerInfo* consumerInfo,
@@ -132,9 +135,9 @@
}
////////////////////////////////////////////////////////////////////////////////
-ActiveMQMessage* ActiveMQConsumer::dequeue(int timeout)
- throw ( cms::CMSException )
-{
+ActiveMQMessage* ActiveMQConsumer::dequeue(int timeout)
+ throw ( cms::CMSException )
+{
try
{
if( closed )
@@ -142,7 +145,7 @@
throw InvalidStateException(
__FILE__, __LINE__,
"ActiveMQConsumer::receive - This Consumer is closed" );
- }
+ }
synchronized( &unconsumedMessages )
{
@@ -151,10 +154,10 @@
if (timeout > 0) {
deadline = Date::getCurrentTimeMilliseconds() + timeout;
}
-
+
// Loop until the time is up or we get a non-expired message
while( true ) {
-
+
// Wait until either the deadline is met, a message arrives, or
// we've closed.
while( !closed && unconsumedMessages.empty() && timeout != 0 )
@@ -166,36 +169,36 @@
timeout = std::max((int)(deadline - Date::getCurrentTimeMilliseconds()), 0);
}
}
-
+
if( unconsumedMessages.empty() ) {
return NULL;
}
-
+
// Fetch the Message then copy it so it can be handed off
// to the user.
DispatchData data = unconsumedMessages.pop();
-
+
// Get the message.
ActiveMQMessage* message = data.getMessage();
-
+
// If it's expired, process the message and then go back to waiting.
if( message->isExpired() ) {
-
+
beforeMessageIsConsumed(message);
afterMessageIsConsumed(message, true);
if (timeout > 0) {
timeout = std::max((int)(deadline - Date::getCurrentTimeMilliseconds()), 0);
}
-
+
// Go back to waiting for a non-expired message.
- continue;
- }
-
+ continue;
+ }
+
// Return the message.
return message;
-
+
} // while( true )
-
+
} // synchronized( &unconsumedMessages )
return NULL;
@@ -203,7 +206,7 @@
AMQ_CATCH_RETHROW( ActiveMQException )
AMQ_CATCHALL_THROW( ActiveMQException )
}
-
+
////////////////////////////////////////////////////////////////////////////////
cms::Message* ActiveMQConsumer::receive() throw ( cms::CMSException )
{
@@ -221,17 +224,17 @@
if( msg == NULL ) {
return NULL;
}
-
+
// Message preprocessing
beforeMessageIsConsumed(msg);
-
+
// Need to clone the message because the user is responsible for freeing
// its copy of the message.
cms::Message* clonedMsg = dynamic_cast<cms::Message*>(msg)->clone();
-
+
// Post processing (may result in the message being deleted)
afterMessageIsConsumed(msg, false);
-
+
// Return the cloned message.
return clonedMsg;
}
@@ -257,17 +260,17 @@
if( msg == NULL ) {
return NULL;
}
-
+
// Message preprocessing
beforeMessageIsConsumed(msg);
-
+
// Need to clone the message because the user is responsible for freeing
// its copy of the message.
cms::Message* clonedMsg = dynamic_cast<cms::Message*>(msg)->clone();
-
+
// Post processing (may result in the message being deleted)
afterMessageIsConsumed(msg, false);
-
+
// Return the cloned message.
return clonedMsg;
}
@@ -293,17 +296,17 @@
if( msg == NULL ) {
return NULL;
}
-
+
// Message preprocessing
beforeMessageIsConsumed(msg);
-
+
// Need to clone the message because the user is responsible for freeing
// its copy of the message.
cms::Message* clonedMsg = dynamic_cast<cms::Message*>(msg)->clone();
-
+
// Post processing (may result in the message being deleted)
afterMessageIsConsumed(msg, false);
-
+
// Return the cloned message.
return clonedMsg;
}
@@ -348,7 +351,7 @@
////////////////////////////////////////////////////////////////////////////////
void ActiveMQConsumer::beforeMessageIsConsumed( ActiveMQMessage* message ) {
-
+
// If the Session is in ClientAcknowledge mode, then we set the
// handler in the message to this object and send it out. Otherwise
// we ack it here for all the other Modes.
@@ -361,7 +364,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQConsumer::afterMessageIsConsumed( ActiveMQMessage* message,
+void ActiveMQConsumer::afterMessageIsConsumed( ActiveMQMessage* message,
bool messageExpired AMQCPP_UNUSED )
{
try
@@ -369,7 +372,7 @@
if( !session->isClientAcknowledge() ) {
session->acknowledge( this, message );
}
-
+
// The Message is cleaned up here if the Session is not
// transacted, otherwise we let the transaction clean up
// this message as it will have already been ack'd and
@@ -416,21 +419,21 @@
// stop now, don't queue
return;
- }
+ }
// If we have a listener, send the message.
if( listener != NULL ) {
ActiveMQMessage* message = data.getMessage();
-
+
// Preprocessing.
beforeMessageIsConsumed( message );
-
+
// Notify the listener
listener->onMessage( dynamic_cast<cms::Message*>(message) );
-
+
// Postprocessing
afterMessageIsConsumed( message, false );
-
+
} else {
// No listener, add it to the unconsumed messages list
@@ -465,7 +468,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQConsumer::destroyMessage( ActiveMQMessage* message )
+void ActiveMQConsumer::destroyMessage( ActiveMQMessage* message )
throw ( ActiveMQException )
{
Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConsumer.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConsumer.h?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConsumer.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConsumer.h Thu Nov 8 13:02:02 2007
@@ -22,12 +22,14 @@
#include <cms/Message.h>
#include <cms/CMSException.h>
+#include <activemq/exceptions/ActiveMQException.h>
#include <activemq/connector/ConsumerInfo.h>
#include <activemq/connector/ConnectorResourceListener.h>
-#include <activemq/util/Queue.h>
#include <activemq/core/ActiveMQAckHandler.h>
#include <activemq/core/Dispatcher.h>
-#include <activemq/concurrent/Mutex.h>
+
+#include <decaf/util/Queue.h>
+#include <decaf/util/concurrent/Mutex.h>
namespace activemq{
namespace core{
@@ -60,7 +62,7 @@
/**
* Queue of unconsumed messages.
*/
- util::Queue<DispatchData> unconsumedMessages;
+ decaf::util::Queue<DispatchData> unconsumedMessages;
/**
* Boolean that indicates if the consumer has been closed
@@ -186,28 +188,28 @@
*/
virtual void destroyMessage( ActiveMQMessage* message )
throw (exceptions::ActiveMQException);
-
+
/**
* Used by synchronous receive methods to wait for messages to come in.
- * @param timeout - The maximum number of milliseconds to wait before
+ * @param timeout - The maximum number of milliseconds to wait before
* returning.
- * If -1, it will block until a messages is received or this consumer
+ * If -1, it will block until a messages is received or this consumer
* is closed.
- * If 0, will not block at all. If > 0, will wait at a maximum the
+ * If 0, will not block at all. If > 0, will wait at a maximum the
* specified number of milliseconds before returning.
- * @return the message, if received within the allotted time.
+ * @return the message, if received within the allotted time.
* Otherwise NULL.
- * @throws InvalidStateException if this consumer is closed upon
+ * @throws InvalidStateException if this consumer is closed upon
* entering this method.
*/
ActiveMQMessage* dequeue(int timeout) throw ( cms::CMSException );
-
+
/**
* Pre-consume processing
* @param message - the message being consumed.
*/
virtual void beforeMessageIsConsumed( ActiveMQMessage* message );
-
+
/**
* Post-consume processing
* @param message - the consumed message
Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQProducer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQProducer.cpp?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQProducer.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQProducer.cpp Thu Nov 8 13:02:02 2007
@@ -17,17 +17,18 @@
#include "ActiveMQProducer.h"
#include <activemq/core/ActiveMQSession.h>
-#include <activemq/exceptions/NullPointerException.h>
-#include <activemq/exceptions/InvalidStateException.h>
-#include <activemq/exceptions/IllegalArgumentException.h>
-#include <activemq/util/Date.h>
+#include <decaf/lang/exceptions/NullPointerException.h>
+#include <decaf/lang/exceptions/InvalidStateException.h>
+#include <decaf/lang/exceptions/IllegalArgumentException.h>
+#include <decaf/util/Date.h>
using namespace std;
using namespace activemq;
using namespace activemq::core;
using namespace activemq::connector;
using namespace activemq::exceptions;
-using namespace activemq::util;
+using namespace decaf::util;
+using namespace decaf::lang::exceptions;
////////////////////////////////////////////////////////////////////////////////
ActiveMQProducer::ActiveMQProducer( connector::ProducerInfo* producerInfo,
Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSession.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSession.cpp?rev=593309&r1=593308&r2=593309&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSession.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSession.cpp Thu Nov 8 13:02:02 2007
@@ -16,16 +16,18 @@
*/
#include "ActiveMQSession.h"
-#include <activemq/exceptions/InvalidStateException.h>
-#include <activemq/exceptions/NullPointerException.h>
+#include <decaf/lang/exceptions/InvalidStateException.h>
+#include <decaf/lang/exceptions/NullPointerException.h>
+#include <activemq/exceptions/ActiveMQException.h>
#include <activemq/core/ActiveMQConnection.h>
#include <activemq/core/ActiveMQTransaction.h>
#include <activemq/core/ActiveMQConsumer.h>
#include <activemq/core/ActiveMQMessage.h>
#include <activemq/core/ActiveMQProducer.h>
#include <activemq/core/ActiveMQSessionExecutor.h>
-#include <activemq/util/Boolean.h>
+#include <decaf/lang/Boolean.h>
+#include <decaf/util/Queue.h>
#include <activemq/connector/TransactionInfo.h>
@@ -33,9 +35,10 @@
using namespace cms;
using namespace activemq;
using namespace activemq::core;
-using namespace activemq::util;
using namespace activemq::connector;
using namespace activemq::exceptions;
+using namespace decaf::util;
+using namespace decaf::lang::exceptions;
////////////////////////////////////////////////////////////////////////////////
ActiveMQSession::ActiveMQSession( SessionInfo* sessionInfo,
@@ -815,9 +818,9 @@
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQSession::redispatch( util::Queue<DispatchData>& unconsumedMessages )
+void ActiveMQSession::redispatch( decaf::util::Queue<DispatchData>& unconsumedMessages )
{
- util::Queue<DispatchData> reversedList;
+ decaf::util::Queue<DispatchData> reversedList;
// Copy the list in reverse order then clear the original list.
synchronized( &unconsumedMessages ) {