activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmitt...@apache.org
Subject svn commit: r424272 [1/10] - in /incubator/activemq/trunk/activemq-cpp: ./ src/examples/ src/main/activemq/concurrent/ src/main/activemq/connector/ src/main/activemq/connector/stomp/ src/main/activemq/connector/stomp/commands/ src/main/activemq/connect...
Date Fri, 21 Jul 2006 11:36:16 GMT
Author: nmittler
Date: Fri Jul 21 04:36:09 2006
New Revision: 424272

URL: http://svn.apache.org/viewvc?rev=424272&view=rev
Log:
Applying patch to activemq-cpp client for AMQ 818

Added:
    incubator/activemq/trunk/activemq-cpp/ChangeLog.txt
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConstants.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConstants.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQDestination.h
    incubator/activemq/trunk/activemq-cpp/src/main/cms/DeliveryMode.h
    incubator/activemq/trunk/activemq-cpp/src/test-integration/integration/various/
    incubator/activemq/trunk/activemq-cpp/src/test-integration/integration/various/SimpleRollbackTest.cpp
    incubator/activemq/trunk/activemq-cpp/src/test-integration/integration/various/SimpleRollbackTest.h
    incubator/activemq/trunk/activemq-cpp/src/test/activemq/core/ActiveMQDestinationTest.cpp
    incubator/activemq/trunk/activemq-cpp/src/test/activemq/core/ActiveMQDestinationTest.h
Modified:
    incubator/activemq/trunk/activemq-cpp/makefile
    incubator/activemq/trunk/activemq-cpp/makefile-linux-debug.cfg
    incubator/activemq/trunk/activemq-cpp/makefile-linux-release.cfg
    incubator/activemq/trunk/activemq-cpp/makefile-windows-debug.cfg
    incubator/activemq/trunk/activemq-cpp/makefile-windows-release.cfg
    incubator/activemq/trunk/activemq-cpp/makefile.cfg
    incubator/activemq/trunk/activemq-cpp/pom.xml
    incubator/activemq/trunk/activemq-cpp/readme.txt
    incubator/activemq/trunk/activemq-cpp/src/examples/main.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Concurrent.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Lock.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Mutex.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/PooledThread.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/PooledThread.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/PooledThreadListener.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Runnable.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Synchronizable.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/TaskListener.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Thread.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Thread.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/ThreadPool.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/ThreadPool.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/Connector.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/ConnectorException.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/ConnectorFactory.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/ConnectorFactoryMap.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/ConnectorFactoryMap.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/ConnectorFactoryMapRegistrar.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/ConnectorResource.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/ConsumerInfo.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/ConsumerMessageListener.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/SessionInfo.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/TransactionInfo.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompCommandListener.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompCommandReader.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompCommandReader.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompCommandWriter.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompCommandWriter.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnector.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnector.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnectorException.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnectorFactory.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConnectorFactory.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompConsumerInfo.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompDestination.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompQueue.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionInfo.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompSessionManager.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompTopic.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompTransactionInfo.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbstractCommand.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AckCommand.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BeginCommand.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/CommandConstants.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/CommandConstants.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/CommitCommand.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ConnectCommand.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/DisconnectCommand.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ErrorCommand.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ReceiptCommand.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/StompCommand.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/StompMessage.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/SubscribeCommand.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/TextMessageCommand.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/UnsubscribeCommand.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/connector/stomp/marshal/Marshalable.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQAckHandler.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnectionFactory.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnectionFactory.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQMessage.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQMessageListener.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQProducer.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQProducer.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSessionResource.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQTransaction.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/core/ActiveMQTransaction.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/ActiveMQException.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/ActiveMQException.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/IllegalMonitorStateException.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/InterruptedException.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/InvalidStateException.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/NoSuchElementException.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/NullPointerException.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/RuntimeException.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/UnsupportedOperationException.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedInputStream.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedInputStream.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedOutputStream.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedOutputStream.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayInputStream.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayInputStream.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayOutputStream.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayOutputStream.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianReader.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianReader.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianWriter.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianWriter.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/IOException.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/InputStream.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/OutputStream.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/Reader.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/StandardErrorOutputStream.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/Writer.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/network/BufferedSocket.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/network/BufferedSocket.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/network/ServerSocket.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/network/ServerSocket.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/network/Socket.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/network/SocketException.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/network/SocketFactory.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/network/SocketFactory.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/network/SocketInputStream.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/network/SocketInputStream.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/network/SocketOutputStream.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/network/TcpSocket.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/network/TcpSocket.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/transport/BrokerError.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/transport/Command.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/transport/CommandIOException.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/transport/ExceptionResponse.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/transport/FutureResponse.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/transport/IOTransport.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/transport/Response.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/transport/ResponseCorrelator.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/transport/TcpTransport.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/transport/TcpTransportFactory.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/transport/Transport.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/transport/TransportExceptionListener.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/transport/TransportFactoryMap.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/transport/TransportFactoryMap.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/transport/TransportFactoryMapRegistrar.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/util/Boolean.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/util/Endian.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/util/Guid.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/util/Guid.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/util/Integer.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/util/Long.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/util/Number.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/util/Properties.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/util/Queue.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/util/SimpleProperties.h
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/util/StringTokenizer.cpp
    incubator/activemq/trunk/activemq-cpp/src/main/activemq/util/StringTokenizer.h
    incubator/activemq/trunk/activemq-cpp/src/main/cms/BytesMessage.h
    incubator/activemq/trunk/activemq-cpp/src/main/cms/CMSException.h
    incubator/activemq/trunk/activemq-cpp/src/main/cms/Closeable.h
    incubator/activemq/trunk/activemq-cpp/src/main/cms/Connection.h
    incubator/activemq/trunk/activemq-cpp/src/main/cms/ConnectionFactory.h
    incubator/activemq/trunk/activemq-cpp/src/main/cms/Destination.h
    incubator/activemq/trunk/activemq-cpp/src/main/cms/ExceptionListener.h
    incubator/activemq/trunk/activemq-cpp/src/main/cms/MapMessage.h
    incubator/activemq/trunk/activemq-cpp/src/main/cms/Message.h
    incubator/activemq/trunk/activemq-cpp/src/main/cms/MessageConsumer.h
    incubator/activemq/trunk/activemq-cpp/src/main/cms/MessageListener.h
    incubator/activemq/trunk/activemq-cpp/src/main/cms/MessageProducer.h
    incubator/activemq/trunk/activemq-cpp/src/main/cms/Queue.h
    incubator/activemq/trunk/activemq-cpp/src/main/cms/Session.h
    incubator/activemq/trunk/activemq-cpp/src/main/cms/Startable.h
    incubator/activemq/trunk/activemq-cpp/src/main/cms/Stoppable.h
    incubator/activemq/trunk/activemq-cpp/src/main/cms/TextMessage.h
    incubator/activemq/trunk/activemq-cpp/src/test-integration/integration/common/AbstractTester.cpp
    incubator/activemq/trunk/activemq-cpp/src/test-integration/integration/common/AbstractTester.h
    incubator/activemq/trunk/activemq-cpp/src/test-integration/integration/common/Tester.h
    incubator/activemq/trunk/activemq-cpp/src/test-integration/integration/durable/DurableTester.cpp
    incubator/activemq/trunk/activemq-cpp/src/test-integration/integration/simple/SimpleTester.cpp
    incubator/activemq/trunk/activemq-cpp/src/test-integration/integration/transactional/TransactionTester.cpp
    incubator/activemq/trunk/activemq-cpp/src/test/activemq/concurrent/MutexTest.h
    incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompCommandReaderTest.h
    incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompCommandWriterTest.h
    incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompConnectorTest.h
    incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompResponseBuilder.h
    incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompSessionManagerTest.h
    incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BytesMessageCommandTest.h
    incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/MessageCommandTest.h
    incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/TextMessageCommandTest.h
    incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/marshal/MarshalerTest.h
    incubator/activemq/trunk/activemq-cpp/src/test/activemq/core/ActiveMQConnectionFactoryTest.h
    incubator/activemq/trunk/activemq-cpp/src/test/activemq/core/ActiveMQConnectionTest.h
    incubator/activemq/trunk/activemq-cpp/src/test/activemq/core/ActiveMQSessionTest.h
    incubator/activemq/trunk/activemq-cpp/src/test/activemq/transport/IOTransportTest.h
    incubator/activemq/trunk/activemq-cpp/todo.txt
    incubator/activemq/trunk/activemq-cpp/unix/pom.xml
    incubator/activemq/trunk/activemq-cpp/win32-gcc/pom.xml

Added: incubator/activemq/trunk/activemq-cpp/ChangeLog.txt
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/ChangeLog.txt?rev=424272&view=auto
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/ChangeLog.txt (added)
+++ incubator/activemq/trunk/activemq-cpp/ChangeLog.txt Fri Jul 21 04:36:09 2006
@@ -0,0 +1,31 @@
+
+Version 0.0.2
+----------------------
+New Features:
+
+    * Destinations now support the Destination Options shown here:  
+      http://www.activemq.org/site/destination-options.html
+
+Additional Changes
+
+    * Extensive code cleanup, including expanded Java DOC comments and more 
+      consistant formatting.
+    * Memory leak checking with Rational Purify was done and several small 
+      leaks were fixed.
+    * Added additional Unit tests for new functionality, and additional 
+      tests for existing feature correctness
+    * Fixed a problem on Windows that was causing the socketinputstream
+      reads to break unexpectedly.
+    * Fixed the username, password, client-id processing so they get
+      out in the ConnectCommand Properly.
+    * Minor bug fixes
+
+Known Issues
+
+    * Unchanged from version 0.0.1 
+
+
+Version 0.0.1
+----------------------
+
+  * Initial Release
\ No newline at end of file

Modified: incubator/activemq/trunk/activemq-cpp/makefile
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/makefile?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/makefile (original)
+++ incubator/activemq/trunk/activemq-cpp/makefile Fri Jul 21 04:36:09 2006
@@ -1,4 +1,5 @@
 SRCDIR = src
+OUTDIR = out
 MAKESUPPORT_HOME = $(PWD)
 
 OFILES = \
@@ -31,6 +32,7 @@
 	$(OUTDIR)/main/activemq/core/ActiveMQProducer.o \
 	$(OUTDIR)/main/activemq/core/ActiveMQConsumer.o \
 	$(OUTDIR)/main/activemq/core/ActiveMQTransaction.o \
+	$(OUTDIR)/main/activemq/core/ActiveMQConstants.o \
 	\
 	$(OUTDIR)/main/activemq/io/EndianReader.o \
 	$(OUTDIR)/main/activemq/io/EndianWriter.o \
@@ -62,6 +64,7 @@
 OTESTFILES = \
     $(OUTDIR)/test/main.o \
     \
+    $(OUTDIR)/test/activemq/core/ActiveMQDestinationTest.o \
     $(OUTDIR)/test/activemq/core/ActiveMQConnectionFactoryTest.o \
     $(OUTDIR)/test/activemq/core/ActiveMQConnectionTest.o \
     $(OUTDIR)/test/activemq/core/ActiveMQSessionTest.o \
@@ -130,10 +133,16 @@
 	$(OUTDIR)/test-integration/integration/simple/SimpleTester.o \
 	$(OUTDIR)/test-integration/integration/transactional/TransactionTester.o \
 	$(OUTDIR)/test-integration/integration/common/AbstractTester.o \
-	$(OUTDIR)/test-integration/integration/common/IntegrationCommon.o
+	$(OUTDIR)/test-integration/integration/common/IntegrationCommon.o \
+	$(OUTDIR)/test-integration/integration/various/SimpleRollbackTest.o
+	
 
-LIBFILE = $(OUTDIR)/activemq.a
-TESTEXE = $(OUTDIR)/activemqTest
+# Increment this to get a build specific library.
+VERSION = 0_0_2
+
+LIBRARY_NAME   = activemq-cpp-$(VERSION)
+LIBFILE        = $(OUTDIR)/lib$(LIBRARY_NAME).a
+TESTEXE        = $(OUTDIR)/activemqTest
 INTEGRATIONEXE = $(OUTDIR)/activemqIntegrationTests
 
 DEFINES          =

Modified: incubator/activemq/trunk/activemq-cpp/makefile-linux-debug.cfg
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/makefile-linux-debug.cfg?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/makefile-linux-debug.cfg (original)
+++ incubator/activemq/trunk/activemq-cpp/makefile-linux-debug.cfg Fri Jul 21 04:36:09 2006
@@ -2,17 +2,13 @@
 # Compiler specific configuration
 #
 
-OUTDIR           = out
-LIBRARY_NAME = activemq-cpp
-LIBFILE = $(OUTDIR)/lib$(LIBRARY_NAME).a
-
 #
 # GCC/G++ debug for Linux
 #
-CC               = g++ -frtti -g -pthread -DDEBUG -D_DEBUG -D_REENTRANT
-LD               = g++ -g -frtti -pthread
-CCFLAGS          = -Wall
-LDFLAGS          = -L$(OUTDIR) -l$(LIBRARY_NAME) -lcppunit -ldl -luuid
-ARFLAGS		 = 
+CC      = g++ -frtti -g -pthread -DDEBUG -D_DEBUG -D_REENTRANT
+LD      = g++ -g -frtti -pthread
+CCFLAGS = -Wall
+LDFLAGS = -L$(OUTDIR) -l$(LIBRARY_NAME) -lcppunit -ldl -luuid
+ARFLAGS = 
 
 

Modified: incubator/activemq/trunk/activemq-cpp/makefile-linux-release.cfg
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/makefile-linux-release.cfg?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/makefile-linux-release.cfg (original)
+++ incubator/activemq/trunk/activemq-cpp/makefile-linux-release.cfg Fri Jul 21 04:36:09 2006
@@ -2,18 +2,13 @@
 # Compiler specific configuration
 #
 
-OUTDIR           = out
-LIBRARY_NAME = activemq-cpp
-LIBFILE = $(OUTDIR)/lib$(LIBRARY_NAME).a
-
 #
 # GCC/G++ release for Linux
 #
-CC               = g++ -frtti -pthread -O3 -DNDEBUG -D_REENTRANT
-LD               = g++ -frtti -pthread 
-CCFLAGS          = -Wall
-LDFLAGS          = -L$(OUTDIR) -l$(LIBRARY_NAME) -lcppunit -ldl -luuid
-OUTDIR           = out
-ARFLAGS		 = 
+CC      = g++ -frtti -pthread -O3 -DNDEBUG -D_REENTRANT
+LD      = g++ -frtti -pthread 
+CCFLAGS = -Wall
+LDFLAGS = -L$(OUTDIR) -l$(LIBRARY_NAME) -lcppunit -ldl -luuid
+ARFLAGS = 
 
 

Modified: incubator/activemq/trunk/activemq-cpp/makefile-windows-debug.cfg
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/makefile-windows-debug.cfg?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/makefile-windows-debug.cfg (original)
+++ incubator/activemq/trunk/activemq-cpp/makefile-windows-debug.cfg Fri Jul 21 04:36:09 2006
@@ -2,17 +2,12 @@
 # Compiler specific configuration
 #
 
-OUTDIR       = out
-LIBRARY_NAME = activemq-cpp
-LIBFILE      = $(OUTDIR)/lib$(LIBRARY_NAME).a
-
 #
 # GCC/G++ debug for Linux
 #
-CC               = g++ -fexceptions -frtti -O0 -g3 -DDEBUG -D_DEBUG -D_REENTRANT -D_WIN32 -DWINVER=0x0502 -DWIN32_LEAN_AND_MEAN
-LD               = g++ -g3 -frtti
-CCFLAGS          = -Wall
-LDFLAGS          = -L$(OUTDIR) -l$(LIBRARY_NAME) -lcppunit -lws2_32 -lrpcrt4
-OUTDIR           = out
-ARFLAGS		 = 
+CC      = g++ -fexceptions -frtti -O0 -g3 -DDEBUG -D_DEBUG -D_REENTRANT -D_WIN32 -DWINVER=0x0502 -DWIN32_LEAN_AND_MEAN
+LD      = g++ -g3 -frtti
+CCFLAGS = -Wall
+LDFLAGS = -L$(OUTDIR) -l$(LIBRARY_NAME) -lcppunit -lws2_32 -lrpcrt4
+ARFLAGS = 
 

Modified: incubator/activemq/trunk/activemq-cpp/makefile-windows-release.cfg
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/makefile-windows-release.cfg?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/makefile-windows-release.cfg (original)
+++ incubator/activemq/trunk/activemq-cpp/makefile-windows-release.cfg Fri Jul 21 04:36:09 2006
@@ -2,18 +2,13 @@
 # Compiler specific configuration
 #
 
-OUTDIR       = out
-LIBRARY_NAME = activemq-cpp
-LIBFILE      = $(OUTDIR)/lib$(LIBRARY_NAME).a
-
 #
 # GCC/G++ release for Linux
 #
-CC               = g++ -fexceptions -frtti -O3 -DNDEBUG -D_REENTRANT -D__WIN32 -DWIN32_LEAN_AND_MEAN
-LD               = g++ -frtti 
-CCFLAGS          = -Wall
-LDFLAGS          = -L$(OUTDIR) -l$(LIBRARY_NAME) -lcppunit -lws2_32 -lrpcrt4
-OUTDIR           = out
-ARFLAGS		 = 
+CC      = g++ -fexceptions -frtti -O3 -DNDEBUG -D_REENTRANT -D__WIN32 -DWIN32_LEAN_AND_MEAN
+LD      = g++ -frtti 
+CCFLAGS = -Wall
+LDFLAGS = -L$(OUTDIR) -l$(LIBRARY_NAME) -lcppunit -lws2_32 -lrpcrt4
+ARFLAGS = 
 
 

Modified: incubator/activemq/trunk/activemq-cpp/makefile.cfg
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/makefile.cfg?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/makefile.cfg (original)
+++ incubator/activemq/trunk/activemq-cpp/makefile.cfg Fri Jul 21 04:36:09 2006
@@ -84,19 +84,13 @@
 
 $(LIBFILE): $(OFILES) $(DEPLIBS)
 	$(ECHO) "    - Creating static library file "$@
-	$(ECHO) "    - $(AR) $(ARFLAGS) $@ $(OFILES)"
 	$(AR) $(ARFLAGS) $@ $(OFILES)
-	$(ECHO) 'Finished building target: $@'
 	
-$(TESTEXE):	$(OTESTFILES) $(LIBFILE)
-	$(ECHO) "    - Creating executable "$@
-	$(ECHO) "    - $(LD) -o $@ $(OTESTFILES) $(LDFLAGS)"
+$(TESTEXE):	$(OTESTFILES)
 	$(LD) -o $@ $(OTESTFILES) $(LDFLAGS)
 	$(ECHO) 'Finished building target: $@'
 	
-$(INTEGRATIONEXE):	$(OINTEGRATIONFILES) $(LIBFILE)
-	$(ECHO) "    - Creating executable "$@
-	$(ECHO) "    - $(LD) -o $@ $(OINTEGRATIONFILES) $(LDFLAGS)"
+$(INTEGRATIONEXE):	$(OINTEGRATIONFILES)
 	$(LD) -o $@ $(OINTEGRATIONFILES) $(LDFLAGS)
 	$(ECHO) 'Finished building target: $@'
 
@@ -171,6 +165,7 @@
 	     $(MD) $(OUTDIR)/test-integration/integration/simple; \
 	     $(MD) $(OUTDIR)/test-integration/integration/transactional; \
 	     $(MD) $(OUTDIR)/test-integration/integration/durable; \
+	     $(MD) $(OUTDIR)/test-integration/integration/various; \
 	     fi
 
 done:

Modified: incubator/activemq/trunk/activemq-cpp/pom.xml
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/pom.xml?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/pom.xml (original)
+++ incubator/activemq/trunk/activemq-cpp/pom.xml Fri Jul 21 04:36:09 2006
@@ -91,6 +91,7 @@
 		                <fileName>ActiveMQProducer.cpp</fileName>
 		                <fileName>ActiveMQSession.cpp</fileName>
 		                <fileName>ActiveMQTransaction.cpp</fileName>
+		                <fileName>ActiveMQConstants.cpp</fileName>
 		              </fileNames>
 		            </source>
 		            <source>

Modified: incubator/activemq/trunk/activemq-cpp/readme.txt
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/readme.txt?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/readme.txt (original)
+++ incubator/activemq/trunk/activemq-cpp/readme.txt Fri Jul 21 04:36:09 2006
@@ -1,5 +1,5 @@
 --------------------------------------------------------------------------
-ActiveMQ CPP Library   - Version 0.0.1
+ActiveMQ CPP Library
 --------------------------------------------------------------------------
 
 This library provides a JMS like interface to an ActiveMQ broker in c++.

Modified: incubator/activemq/trunk/activemq-cpp/src/examples/main.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/examples/main.cpp?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/examples/main.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/examples/main.cpp Fri Jul 21 04:36:09 2006
@@ -42,7 +42,7 @@
     virtual void run() {
         try {
             // Create a ConnectionFactory
-            ActiveMQConnectionFactory* connectionFactory = new ActiveMQConnectionFactory("127.0.0.1:61613");
+            ActiveMQConnectionFactory* connectionFactory = new ActiveMQConnectionFactory("tcp://127.0.0.1:61613");
 
             // Create a Connection
             connection = connectionFactory->createConnection();
@@ -143,7 +143,7 @@
         try {
 
             // Create a ConnectionFactory
-            ActiveMQConnectionFactory* connectionFactory = new ActiveMQConnectionFactory("127.0.0.1:61613");
+            ActiveMQConnectionFactory* connectionFactory = new ActiveMQConnectionFactory("tcp://127.0.0.1:61613");
 
             // Create a Connection
             connection = connectionFactory->createConnection();

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Concurrent.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Concurrent.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Concurrent.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Concurrent.h Fri Jul 21 04:36:09 2006
@@ -51,11 +51,11 @@
 
 #define WAIT_INFINITE  0xFFFFFFFF
 
-#define synchronized(W)                                                     \
-      if(false){}                                                           \
-      else                                                                  \
-      for(activemq::concurrent::Lock lock_W(W);                                                    \
-          lock_W.isLocked(); lock_W.unlock())
+#define synchronized(W)                                               \
+        if(false){}                                                   \
+        else                                                          \
+        for(activemq::concurrent::Lock lock_W(W);                     \
+            lock_W.isLocked(); lock_W.unlock())
 
 }}
 

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Lock.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Lock.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Lock.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Lock.h Fri Jul 21 04:36:09 2006
@@ -18,106 +18,105 @@
 #ifndef ACTIVEMQ_CONCURRENT_LOCK_H
 #define ACTIVEMQ_CONCURRENT_LOCK_H
 
-// Includes.
 #include <activemq/concurrent/Synchronizable.h>
 
 namespace activemq{
 namespace concurrent{
     
-  /**
-   * A wrapper class around a given synchronization mechanism that
-   * provides automatic release upon destruction.
-   * @author  Nathan Mittler
-   */
-  class Lock
-  {
-  private:       // Data
-
     /**
-     * Flag to indicate whether or not this object has locked the
-     * sync object.
+     * A wrapper class around a given synchronization mechanism that
+     * provides automatic release upon destruction.
+     * @author  Nathan Mittler
      */
-    bool locked;
+    class Lock
+    {
+    private:       // Data
 
-    /**
-     * The synchronizable object to lock/unlock.
-     */
-    Synchronizable* syncObject;
+        /**
+         * Flag to indicate whether or not this object has locked the
+         * sync object.
+         */
+        bool locked;
+
+        /**
+         * The synchronizable object to lock/unlock.
+         */
+        Synchronizable* syncObject;
     
-  public:        // Interface
+    public:        // Interface
 
-    /**
-     * Constructor - initializes the object member and locks
-     * the object if desired.
-     * @param   object   The sync object to control
-     * @param   intiallyLocked  If true, the object will automatically
-     * be locked.
-     */
-	Lock( Synchronizable* object, const bool intiallyLocked = true )
-	{
-        try{
-    		syncObject = object;
-    		locked = false;
-    		
-    		if( intiallyLocked )
-    	    {
-    	      lock();
-    	    }
+        /**
+         * Constructor - initializes the object member and locks
+         * the object if desired.
+         * @param   object   The sync object to control
+         * @param   intiallyLocked  If true, the object will automatically
+         * be locked.
+         */
+        Lock( Synchronizable* object, const bool intiallyLocked = true )
+        {
+            try{
+                syncObject = object;
+                locked = false;
+            
+                if( intiallyLocked )
+                {
+                    lock();
+                }
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
-        AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
-        AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
-	}
-
-    /**
-     * Destructor - Unlocks the object if it is locked.
-     */
-    virtual ~Lock()
-    {
-        try{
-    	    if( locked )
-    	    {
-    	      syncObject->unlock();
-    	    } 
+    
+        /**
+         * Destructor - Unlocks the object if it is locked.
+         */
+        virtual ~Lock()
+        {
+            try{
+                if( locked )
+                {
+                  syncObject->unlock();
+                } 
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )      
         }
-        AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
-        AMQ_CATCHALL_THROW( exceptions::ActiveMQException )      
-  	}
 
-    /**
-     * Locks the object.
-     */
-    void lock()
-    {
-        try{
-    	    syncObject->lock();
-            locked = true;
+        /**
+         * Locks the object.
+         */
+        void lock()
+        {
+            try{
+                syncObject->lock();
+                locked = true;
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
-        AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
-        AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
-	}
 
-    /**
-     * Unlocks the object.
-     */
-    void unlock()
-    {
-        try{
-           if(locked)
-           {
-              syncObject->unlock();
-              locked = false;
-           }
+        /**
+         * Unlocks the object.
+         */
+        void unlock()
+        {
+            try{
+                 if(locked)
+                 {
+                     syncObject->unlock();
+                     locked = false;
+                 }
+            }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
         }
-        AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
-        AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
-  	}
 
-    /**
-     * Indicates whether or not the object is locked.
-     * @return  true if the object is locked, otherwise false.
-     */
-    bool isLocked() const{ return locked; }  
-  };
+        /**
+         * Indicates whether or not the object is locked.
+         * @return  true if the object is locked, otherwise false.
+         */
+        bool isLocked() const{ return locked; }  
+    };
 
 }}
 

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Mutex.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Mutex.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Mutex.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Mutex.h Fri Jul 21 04:36:09 2006
@@ -96,7 +96,7 @@
             lock_owner = 0;
             lock_count = 0;
         }
-      
+
         /**
          * Destructor - destroys the mutex object.
          */

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/PooledThread.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/PooledThread.cpp?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/PooledThread.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/PooledThread.cpp Fri Jul 21 04:36:09 2006
@@ -30,19 +30,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 PooledThread::PooledThread(ThreadPool* pool)
 {
-   if(pool == NULL)
-   {
-      throw exceptions::IllegalArgumentException( __FILE__, __LINE__, 
-        "PooledThread::PooledThread");
-   }
+    if(pool == NULL)
+    {
+        throw exceptions::IllegalArgumentException( __FILE__, __LINE__, 
+            "PooledThread::PooledThread");
+    }
    
-   busy = false;
-   done = false;
+    busy = false;
+    done = false;
 
-   listener = NULL;
+    listener = NULL;
    
-   // Store our Pool.
-   this->pool = pool;
+    // Store our Pool.
+    this->pool = pool;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -53,109 +53,109 @@
 ////////////////////////////////////////////////////////////////////////////////
 void PooledThread::run(void) 
 {
-   ThreadPool::Task task;
+    ThreadPool::Task task;
 
-   try
-   {
-      while(!done)
-      {
-         //LOGCMS_DEBUG(logger, "PooledThread::run - Entering deQ");
-
-         // Blocks until there something to be done
-         task = pool->deQueueTask();
-
-         //LOGCMS_DEBUG(logger, "PooledThread::run - Exited deQ");
-         
-         // Check if the Done Flag is set, in case it happened while we
-         // were waiting for a task
-         if(done)
-         {
-            break;
-         }
-         
-         // If we got here and the runnable was null then something
-         // bad must have happened.  Throw an Exception and bail.
-         if(!task.first)
-         {
-            throw exceptions::ActiveMQException( __FILE__, __LINE__, 
-               "PooledThread::run - Retrieive NULL task from Pool.");
-         }
+    try
+    {
+        while(!done)
+        {
+            //LOGCMS_DEBUG(logger, "PooledThread::run - Entering deQ");
+
+            // Blocks until there something to be done
+            task = pool->deQueueTask();
+
+            //LOGCMS_DEBUG(logger, "PooledThread::run - Exited deQ");
+         
+            // Check if the Done Flag is set, in case it happened while we
+            // were waiting for a task
+            if(done)
+            {
+                break;
+            }
+         
+            // If we got here and the runnable was null then something
+            // bad must have happened.  Throw an Exception and bail.
+            if(!task.first)
+            {
+                throw exceptions::ActiveMQException( __FILE__, __LINE__, 
+                    "PooledThread::run - Retrieive NULL task from Pool.");
+            }
                   
-         // Got some work to do, so set flag to busy
-         busy = true;
+            // Got some work to do, so set flag to busy
+            busy = true;
+         
+            // Inform a listener that we are going to start
+            if(listener)
+            {
+                /*LOGCMS_DEBUG(logger, 
+                   "PooledThread::run - Inform Listener we are starting");*/
+                listener->onTaskStarted(this);
+            }
+         
+            // Perform the work
+            task.first->run();
          
-         // Inform a listener that we are going to start
-         if(listener)
-         {
-            /*LOGCMS_DEBUG(logger, 
-               "PooledThread::run - Inform Listener we are starting");*/
-            listener->onTaskStarted(this);
-         }
-         
-         // Perform the work
-         task.first->run();
-         
-         /*LOGCMS_DEBUG(logger, 
-            "PooledThread::run - Inform Task Listener we are done");*/
-
-         // Notify the Task listener that we are done
-         task.second->onTaskComplete(task.first);
-
-         // Inform a listener that we are going to stop and wait
-         // for a new task
-         if(listener)
-         {
             /*LOGCMS_DEBUG(logger, 
-               "PooledThread::run - Inform Listener we are done");*/
-            listener->onTaskCompleted(this);
-         }
-
-         // Set flag to inactive, we will wait for work
-         busy = false;   
-      }
-   }
-   catch(exceptions::ActiveMQException& ex)
-   {
-      ex.setMark( __FILE__, __LINE__ );
+                "PooledThread::run - Inform Task Listener we are done");*/
+
+            // Notify the Task listener that we are done
+            task.second->onTaskComplete(task.first);
+
+            // Inform a listener that we are going to stop and wait
+            // for a new task
+            if(listener)
+            {
+                /*LOGCMS_DEBUG(logger, 
+                    "PooledThread::run - Inform Listener we are done");*/
+                listener->onTaskCompleted(this);
+            }
+
+            // Set flag to inactive, we will wait for work
+            busy = false;   
+        }
+    }
+    catch( exceptions::ActiveMQException& ex )
+    {
+        ex.setMark( __FILE__, __LINE__ );
       
-      // Notify the Task owner
-      if(task.first && task.second)
-      {
-         task.second->onTaskException(task.first, ex);
-      }
+        // Notify the Task owner
+        if(task.first && task.second)
+        {
+            task.second->onTaskException(task.first, ex);
+        }
 
-      busy = false;
+        busy = false;
       
-      // Notify the PooledThreadListener
-      if(listener)
-      {
-         listener->onTaskException(this, ex);
-      }
-   }
-   catch(...)
-   {
-      exceptions::ActiveMQException ex(
-         __FILE__, __LINE__, 
-         "PooledThread::run - Caught Unknown Exception");
-         
-      // Notify the Task owner
-      if(task.first && task.second)
-      {
-         task.second->onTaskException(task.first, ex);
-      }
-
-      busy = false;
-
-      // Notify the PooledThreadListener
-      if(listener)
-      {
-         listener->onTaskException(this, ex);
-      }
-   }
+        // Notify the PooledThreadListener
+        if(listener)
+        {
+            listener->onTaskException(this, ex);
+        }
+    }
+    catch(...)
+    {
+        exceptions::ActiveMQException ex(
+            __FILE__, __LINE__, 
+            "PooledThread::run - Caught Unknown Exception");
+         
+        // Notify the Task owner
+        if(task.first && task.second)
+        {
+            task.second->onTaskException(task.first, ex);
+        }
+
+        busy = false;
+
+        // Notify the PooledThreadListener
+        if(listener)
+        {
+            listener->onTaskException(this, ex);
+        }
+    }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void PooledThread::stop(void) throw ( cms::CMSException )
 {
-   done = true;
+    done = true;
 }

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/PooledThread.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/PooledThread.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/PooledThread.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/PooledThread.h Fri Jul 21 04:36:09 2006
@@ -28,77 +28,77 @@
 namespace activemq{
 namespace concurrent{
 
-   class ThreadPool;
+    class ThreadPool;
 
-   class PooledThread : public Thread, public cms::Stoppable
-   {
-   private:
+    class PooledThread : public Thread, public cms::Stoppable
+    {
+    private:
    
-      // Is this thread currently processing something
-      bool busy;
+        // Is this thread currently processing something
+        bool busy;
       
-      // Boolean flag indicating thread should stop
-      bool done;
+        // Boolean flag indicating thread should stop
+        bool done;
       
-      // Listener for Task related events
-      PooledThreadListener* listener;
+        // Listener for Task related events
+        PooledThreadListener* listener;
       
-      // The thread pool this Pooled Thread is Servicing
-      ThreadPool* pool;
+        // The thread pool this Pooled Thread is Servicing
+        ThreadPool* pool;
 
-      // Logger Init
-      LOGCMS_DECLARE(logger);
+        // Logger Init
+        LOGCMS_DECLARE(logger);
       
-   public:
+     public:
    
-      /**
-       * Constructor
-       */
-   	PooledThread(ThreadPool* pool);
-
-      /**
-       * Destructor
-       */
-   	virtual ~PooledThread(void);
-
-      /**
-       * Run Method for this object waits for something to be
-       * enqueued on the ThreadPool and then grabs it and calls 
-       * its run method.
-       */
-      virtual void run(void);
-      
-      /**
-       * Stops the Thread, thread will complete its task if currently
-       * running one, and then die.  Does not block.
-       */
-      virtual void stop(void) throw ( cms::CMSException );
-      
-      /**
-       * Checks to see if the thread is busy, if busy it means
-       * that this thread has taken a task from the ThreadPool's
-       * queue and is processing it.
-       */
-      virtual bool isBusy(void) { return busy; }
-      
-      /**
-       * Adds a listener to this <code>PooledThread</code> to be
-       * notified when this thread starts and completes a task.
-       */
-      virtual void setPooledThreadListener(PooledThreadListener* listener)
-      {
-         this->listener = listener;
-      }
-
-      /**
-       * Removes a listener for this <code>PooledThread</code> to be
-       * notified when this thread starts and completes a task.
-       */
-      virtual PooledThreadListener* getPooledThreadListener(void)
-      {
-         return this->listener;
-      }
-   };
+        /**
+         * Constructor
+         */
+        PooledThread(ThreadPool* pool);
+
+        /**
+         * Destructor
+         */
+        virtual ~PooledThread(void);
+
+        /**
+         * Run Method for this object waits for something to be
+         * enqueued on the ThreadPool and then grabs it and calls 
+         * its run method.
+         */
+        virtual void run(void);
+      
+        /**
+         * Stops the Thread, thread will complete its task if currently
+         * running one, and then die.  Does not block.
+         */
+        virtual void stop(void) throw ( cms::CMSException );
+      
+        /**
+         * Checks to see if the thread is busy, if busy it means
+         * that this thread has taken a task from the ThreadPool's
+         * queue and is processing it.
+         */
+        virtual bool isBusy(void) { return busy; }
+
+        /**
+         * Adds a listener to this <code>PooledThread</code> to be
+         * notified when this thread starts and completes a task.
+         */
+        virtual void setPooledThreadListener(PooledThreadListener* listener)
+        {
+            this->listener = listener;
+        }
+
+        /**
+         * Removes a listener for this <code>PooledThread</code> to be
+         * notified when this thread starts and completes a task.
+         */
+        virtual PooledThreadListener* getPooledThreadListener(void)
+        {
+            return this->listener;
+        }
+    };
 
 }}
 

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/PooledThreadListener.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/PooledThreadListener.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/PooledThreadListener.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/PooledThreadListener.h Fri Jul 21 04:36:09 2006
@@ -22,44 +22,43 @@
 namespace activemq{
 namespace concurrent{
 
-   //forward declare
-   class PooledThread;
+    class PooledThread;
 
-   class PooledThreadListener
-   {
-   public:
+    class PooledThreadListener
+    {
+    public:
 
-      /**
-       * Destructor
-       */
-   	virtual ~PooledThreadListener(void) {}
-      
-      /**
-       * Called by a pooled thread when it is about to begin
-       * executing a new task.
-       * @param Pointer to the Pooled Thread that is making this call
-       */
-      virtual void onTaskStarted(PooledThread* thread) = 0;
+        /**
+         * Destructor
+         */
+        virtual ~PooledThreadListener(void) {}
+
+        /**
+         * Called by a pooled thread when it is about to begin
+         * executing a new task.
+         * @param Pointer to the Pooled Thread that is making this call
+         */
+        virtual void onTaskStarted(PooledThread* thread) = 0;
        
-      /**
-       * Called by a pooled thread when it has completed a task
-       * and is going back to waiting for another task to run
-       * @param Pointer the the Pooled Thread that is making this call.
-       */
-      virtual void onTaskCompleted(PooledThread* thread) = 0;
+        /**
+         * Called by a pooled thread when it has completed a task
+         * and is going back to waiting for another task to run
+         * @param Pointer the the Pooled Thread that is making this call.
+         */
+        virtual void onTaskCompleted(PooledThread* thread) = 0;
       
-      /**
-       * Called by a pooled thread when it has encountered an exception
-       * while running a user task, after receiving this notification
-       * the callee should assume that the PooledThread is now no longer
-       * running.
-       * @param Pointer to the Pooled Thread that is making this call
-       * @param The Exception that occured.
-       */
-      virtual void onTaskException(PooledThread* thread, 
-                                   exceptions::ActiveMQException& ex) = 0;
+        /**
+         * Called by a pooled thread when it has encountered an exception
+         * while running a user task, after receiving this notification
+         * the callee should assume that the PooledThread is now no longer
+         * running.
+         * @param Pointer to the Pooled Thread that is making this call
+         * @param The Exception that occured.
+         */
+        virtual void onTaskException( PooledThread* thread, 
+                                      exceptions::ActiveMQException& ex) = 0;
        
-   };
+    };
 
 }}
 

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Runnable.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Runnable.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Runnable.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Runnable.h Fri Jul 21 04:36:09 2006
@@ -19,23 +19,23 @@
 
 namespace activemq{
 namespace concurrent{
-	
-	/**
-	 * Interface for a runnable object - defines a task
-	 * that can be run by a thread.
-	 */
-	class Runnable{
-	public:
-	
-		virtual ~Runnable(){}
-		
-		/**
-		 * Run method - called by the Thread class in the context
-		 * of the thread.
-		 */
-		virtual void run() = 0;
-	};
-	
+    
+    /**
+     * Interface for a runnable object - defines a task
+     * that can be run by a thread.
+     */
+    class Runnable{
+    public:
+    
+        virtual ~Runnable(){}
+        
+        /**
+         * Run method - called by the Thread class in the context
+         * of the thread.
+         */
+        virtual void run() = 0;
+    };
+    
 }}
 
 #endif /*ACTIVEMQ_CONCURRENT_RUNNABLE_H_*/

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Synchronizable.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Synchronizable.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Synchronizable.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Synchronizable.h Fri Jul 21 04:36:09 2006
@@ -23,64 +23,64 @@
 namespace activemq{
 namespace concurrent{
     
-   /**
-    * The interface for all synchronizable objects (that is, objects
-    * that can be locked and unlocked).
-    */
-   class Synchronizable
-   {
-   public:        // Abstract Interface
+    /**
+     * The interface for all synchronizable objects (that is, objects
+     * that can be locked and unlocked).
+     */
+    class Synchronizable
+    {
+    public:
 
-	  virtual ~Synchronizable(){}
-	
-      /**
-       * Locks the object.
-       * @throws ActiveMQException
-       */
-      virtual void lock() throw(exceptions::ActiveMQException) = 0;
+        virtual ~Synchronizable(){}
+    
+        /**
+         * Locks the object.
+         * @throws ActiveMQException
+         */
+        virtual void lock() throw(exceptions::ActiveMQException) = 0;
 
-      /**
-       * Unlocks the object.
-       * @throws ActiveMQException
-       */
-      virtual void unlock() throw(exceptions::ActiveMQException) = 0;
+        /**
+         * Unlocks the object.
+         * @throws ActiveMQException
+         */
+        virtual void unlock() throw(exceptions::ActiveMQException) = 0;
     
-      /**
-       * Waits on a signal from this object, which is generated
-       * by a call to Notify.  Must have this object locked before
-       * calling.
-       * @throws ActiveMQException
-       */
-      virtual void wait() throw(exceptions::ActiveMQException) = 0;
+        /**
+         * Waits on a signal from this object, which is generated
+         * by a call to Notify.  Must have this object locked before
+         * calling.
+         * @throws ActiveMQException
+         */
+        virtual void wait() throw(exceptions::ActiveMQException) = 0;
     
-      /**
-       * Waits on a signal from this object, which is generated
-       * by a call to Notify.  Must have this object locked before
-       * calling.  This wait will timeout after the specified time
-       * interval.
-       * @param time in millisecsonds to wait, or WAIT_INIFINITE
-       * @throws ActiveMQException
-       */
-      virtual void wait(unsigned long millisecs) 
-         throw(exceptions::ActiveMQException) = 0;
+        /**
+         * Waits on a signal from this object, which is generated
+         * by a call to Notify.  Must have this object locked before
+         * calling.  This wait will timeout after the specified time
+         * interval.
+         * @param time in millisecsonds to wait, or WAIT_INIFINITE
+         * @throws ActiveMQException
+         */
+        virtual void wait(unsigned long millisecs) 
+            throw(exceptions::ActiveMQException) = 0;
 
-      /**
-       * Signals a waiter on this object that it can now wake
-       * up and continue.  Must have this object locked before
-       * calling.
-       * @throws ActiveMQException
-       */
-      virtual void notify() throw(exceptions::ActiveMQException) = 0;
+        /**
+         * Signals a waiter on this object that it can now wake
+         * up and continue.  Must have this object locked before
+         * calling.
+         * @throws ActiveMQException
+         */
+        virtual void notify() throw( exceptions::ActiveMQException ) = 0;
     
-      /**
-       * Signals the waiters on this object that it can now wake
-       * up and continue.  Must have this object locked before
-       * calling.
-       * @throws ActiveMQException
-       */
-      virtual void notifyAll() throw(exceptions::ActiveMQException) = 0;
+        /**
+         * Signals the waiters on this object that it can now wake
+         * up and continue.  Must have this object locked before
+         * calling.
+         * @throws ActiveMQException
+         */
+        virtual void notifyAll() throw( exceptions::ActiveMQException ) = 0;
 
-   }; 
+    }; 
 
 }}
 

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/TaskListener.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/TaskListener.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/TaskListener.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/TaskListener.h Fri Jul 21 04:36:09 2006
@@ -23,33 +23,30 @@
 namespace activemq{
 namespace concurrent{
 
-class TaskListener
-{
-public:
-
-   /**
-    * Destructor
-    */
-	virtual ~TaskListener() {}
-
-   /**
-    * Called when a queued task has completed, the task that
-    * finished is passed along for user consumption
-    * @param Runnable Pointer to the task that finished
-    */
-   virtual void onTaskComplete(Runnable* task) = 0;
-   
-   /**
-    * Called when a queued task has thrown an exception while
-    * being run.  The Callee should assume that this was an 
-    * unrecoverable exeption and that this task is now defunct.
-    * @param Runnable Pointer to the task
-    * @param The ActiveMQException that was thrown.
-    */
-   virtual void onTaskException(Runnable* task, 
-                                exceptions::ActiveMQException& ex) = 0;
-   
-};
+    class TaskListener
+    {
+    public:
+    
+        virtual ~TaskListener() {}
+    
+        /**
+         * Called when a queued task has completed, the task that
+         * finished is passed along for user consumption
+         * @param Runnable Pointer to the task that finished
+         */
+        virtual void onTaskComplete(Runnable* task) = 0;
+       
+        /**
+         * Called when a queued task has thrown an exception while
+         * being run.  The Callee should assume that this was an 
+         * unrecoverable exeption and that this task is now defunct.
+         * @param Runnable Pointer to the task
+         * @param The ActiveMQException that was thrown.
+         */
+        virtual void onTaskException( Runnable* task, 
+                                      exceptions::ActiveMQException& ex) = 0;
+       
+    };
 
 }}
 

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Thread.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Thread.cpp?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Thread.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Thread.cpp Fri Jul 21 04:36:09 2006
@@ -19,10 +19,10 @@
 #include <errno.h>
 
 #ifdef unix
-	#include <errno.h> // EINTR
+    #include <errno.h> // EINTR
     extern int errno;
 #else
-	#include <process.h> // _endthreadex
+    #include <process.h> // _endthreadex
 #endif
 
 #include <activemq/exceptions/ActiveMQException.h>
@@ -45,17 +45,17 @@
 ////////////////////////////////////////////////////////////////////////////////
 Thread::Thread()
 {
-	task = this;
-	started = false;
-	joined = false;
+    task = this;
+    started = false;
+    joined = false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 Thread::Thread( Runnable* task )
 {
-	this->task = task;
-	started = false;
-	joined = false;
+    this->task = task;
+    started = false;
+    joined = false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -72,8 +72,8 @@
     }
     
 #ifdef unix
-	
-	pthread_attr_init (&attributes);
+    
+    pthread_attr_init (&attributes);
     pthread_attr_setdetachstate (&attributes, PTHREAD_CREATE_JOINABLE);
     int err = pthread_create (
         &this->threadHandle,
@@ -81,7 +81,7 @@
         runCallback,
         this);
     if (err != 0) {
-		throw exceptions::ActiveMQException( __FILE__, __LINE__,
+        throw exceptions::ActiveMQException( __FILE__, __LINE__,
             "Coud not start thread");
     }
     
@@ -91,13 +91,13 @@
     this->threadHandle = 
         (HANDLE)_beginthreadex(NULL, 0, runCallback, this, 0, &threadId);
     if (this->threadHandle == NULL) {
-		throw exceptions::ActiveMQException( __FILE__, __LINE__,
+        throw exceptions::ActiveMQException( __FILE__, __LINE__,
             "Coud not start thread");
     }
     
 #endif
 
-	// Mark the thread as started.
+    // Mark the thread as started.
     started = true;
 }
 
@@ -105,11 +105,11 @@
 void Thread::join() throw( exceptions::ActiveMQException )
 {
     if (!this->started) {
-		throw exceptions::ActiveMQException( __FILE__, __LINE__,
+        throw exceptions::ActiveMQException( __FILE__, __LINE__,
             "Thread::join() called without having called Thread::start()");
     }
     if (!this->joined) {
-    	
+        
 #ifdef unix
         pthread_join(this->threadHandle, NULL);
 #else
@@ -121,16 +121,16 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Thread::sleep(int millisecs)
+void Thread::sleep( int millisecs )
 {
 #ifdef unix
     struct timespec rec, rem;
     rec.tv_sec = millisecs / 1000;
     rec.tv_nsec = (millisecs % 1000) * 1000000;
     while( nanosleep( &rec, &rem ) == -1 ){
-    	if( errno != EINTR ){
-    		break;
-    	}
+        if( errno != EINTR ){
+            break;
+        }
     }
     
 #else
@@ -154,9 +154,9 @@
 #else
 unsigned int WINAPI
 #endif
-Thread::runCallback (void* param)
+Thread::runCallback( void* param )
 {
-	// Get the instance.
+    // Get the instance.
     Thread* thread = (Thread*)param;
     
     // Invoke run on the task.

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Thread.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Thread.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Thread.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/Thread.h Fri Jul 21 04:36:09 2006
@@ -24,107 +24,108 @@
 
 #if (defined(__unix__) || defined(unix) || defined(MACOSX) || defined(__APPLE__)) && !defined(USG)
    
-   #ifndef unix
-      #define unix
-   #endif
+    #ifndef unix
+        #define unix
+    #endif
 
-   #include <pthread.h>
+    #include <pthread.h>
 #else
-   #include <windows.h>
+    #include <windows.h>
 #endif
 
 namespace activemq{
 namespace concurrent{
    
-   /** 
-    * Basic thread class - mimics the Java Thread.  Derived classes may 
-    * implement the run method, or this class can be used as is with 
-    * a provided Runnable delegate.
-    */
-   class Thread : public Runnable
-   {
-   private:
-   
-      /**
-       * The task to be run by this thread, defaults to 
-       * this thread object.
-       */
-      Runnable* task;
+    /** 
+     * Basic thread class - mimics the Java Thread.  Derived classes may 
+     * implement the run method, or this class can be used as is with 
+     * a provided Runnable delegate.
+     */
+    class Thread : public Runnable
+    {
+    private:
+   
+        /**
+         * The task to be run by this thread, defaults to 
+         * this thread object.
+         */
+        Runnable* task;
       
-   #ifdef unix
-      pthread_attr_t attributes;
-       pthread_t   threadHandle ;
-   #else
-       HANDLE      threadHandle ;
-   #endif
-   
-       /**
-        * Started state of this thread.
-        */
-       bool started;
+        #ifdef unix
+            pthread_attr_t attributes;
+            pthread_t threadHandle;
+        #else
+            HANDLE threadHandle;
+        #endif
+   
+        /**
+         * Started state of this thread.
+         */
+        bool started;
        
-       /**
-        * Indicates whether the thread has already been
-        * joined.
-        */
-       bool joined;
+        /**
+         * Indicates whether the thread has already been
+         * joined.
+         */
+        bool joined;
        
-   public:
+    public:
       
-       Thread();
-       Thread( Runnable* task );     
-       virtual ~Thread();
-   
-       /** 
-        * Creates a system thread and starts it in a joinable mode.  
-        * Upon creation, the
-        * run() method of either this object or the provided Runnable
-        * object will be invoked in the context of this thread.
-        * @exception runtime_error is thrown if the system could
-        * not start the thread.
-        */
-       virtual void start() throw (exceptions::ActiveMQException);
-   
-       /**
-        * Wait til the thread exits. This is when the run()
-        * method has returned or has thrown an exception.
-        * If an exception was thrown in the run() method,
-        * join() will return the thrown exception. Otherwise
-        * (if run() returned normally), join() will
-        * return NULL.
-        */
-       virtual void join() throw (exceptions::ActiveMQException);
+        Thread();
+        Thread( Runnable* task );     
+        virtual ~Thread();
+   
+        /** 
+         * Creates a system thread and starts it in a joinable mode.  
+         * Upon creation, the
+         * run() method of either this object or the provided Runnable
+         * object will be invoked in the context of this thread.
+         * @exception runtime_error is thrown if the system could
+         * not start the thread.
+         */
+        virtual void start() throw ( exceptions::ActiveMQException );
+   
+        /**
+         * Wait til the thread exits. This is when the run()
+         * method has returned or has thrown an exception.
+         * If an exception was thrown in the run() method,
+         * join() will return the thrown exception. Otherwise
+         * (if run() returned normally), join() will
+         * return NULL.
+         */
+        virtual void join() throw ( exceptions::ActiveMQException );
        
-       /**
-        * Default implementation of the run method - does nothing.
-        */
-       virtual void run(){};
+        /**
+         * Default implementation of the run method - does nothing.
+         */
+        virtual void run(){};
        
-   public:
+    public:
    
-      /**
-       * Halts execution of the calling thread for a specified no of millisec.
-       *   
-       * Note that this method is a static method that applies to the
-       * calling thread and not to the thread object.
-       */
-      static void sleep(int millisecs);
+        /**
+         * Halts execution of the calling thread for a specified no of millisec.
+         *   
+         * Note that this method is a static method that applies to the
+         * calling thread and not to the thread object.
+         */
+        static void sleep( int millisecs );
        
-      /**
-       * Obtains the Thread Id of the current thread
-       * @return Thread Id
-       */
-      static unsigned long getId(void); 
-   
-   private:
-   
-       // Internal thread handling
-   #ifdef unix
-       static void* runCallback (void* param);
-   #else
-       static unsigned int WINAPI runCallback (void* param);
-   #endif
-   } ;
+        /**
+         * Obtains the Thread Id of the current thread
+         * @return Thread Id
+         */
+        static unsigned long getId(void); 
+   
+    private:
+   
+        // Internal thread handling
+        #ifdef unix
+            static void* runCallback (void* param);
+        #else
+            static unsigned int WINAPI runCallback (void* param);
+        #endif
+
+    };
 
 }}
 

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/ThreadPool.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/ThreadPool.cpp?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/ThreadPool.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/concurrent/ThreadPool.cpp Fri Jul 21 04:36:09 2006
@@ -39,273 +39,279 @@
 ////////////////////////////////////////////////////////////////////////////////
 ThreadPool::ThreadPool(void)
 {
-   maxThreads  = DEFAULT_MAX_POOL_SIZE;
-   blockSize   = DEFAULT_MAX_BLOCK_SIZE;
-   freeThreads = 0;
+    maxThreads  = DEFAULT_MAX_POOL_SIZE;
+    blockSize   = DEFAULT_MAX_BLOCK_SIZE;
+    freeThreads = 0;
 
-   shutdown = false;
+    shutdown = false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 ThreadPool::~ThreadPool(void)
 {
-   try
-   {
-      std::vector<PooledThread*>::iterator itr = pool.begin();
+    try
+    {
+        std::vector<PooledThread*>::iterator itr = pool.begin();
        
-      // Stop all the threads
-      for(; itr != pool.end(); ++itr)
-      {
-         (*itr)->stop();
-      }
+        // Stop all the threads
+        for(; itr != pool.end(); ++itr)
+        {
+            (*itr)->stop();
+        }
        
-      // Set the shutdown flag so that the DeQueue methods all quit
-      // when we interrupt them.
-      shutdown = true;
+        // Set the shutdown flag so that the DeQueue methods all quit
+        // when we interrupt them.
+        shutdown = true;
        
-      synchronized(&queue)
-      {
-         // Signal the Queue so that all waiters are notified
-         queue.notifyAll();
-      }
+        synchronized(&queue)
+        {
+            // Signal the Queue so that all waiters are notified
+            queue.notifyAll();
+        }
        
-      // Wait for everyone to die
-      for(itr = pool.begin(); itr != pool.end(); ++itr)
-      {
-         (*itr)->join();
-      }      
-   }
-   AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
-   AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        // Wait for everyone to die
+        for(itr = pool.begin(); itr != pool.end(); ++itr)
+        {
+            (*itr)->join();
+
+            // Destroy the threads
+            delete *itr;
+        }
+
+        pool.clear();
+    }
+    AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+    AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ThreadPool::queueTask(ThreadPool::Task task) 
+void ThreadPool::queueTask( ThreadPool::Task task ) 
    throw ( exceptions::ActiveMQException )
 {
-   try
-   {
-      if(!task.first || !task.second)
-      {
-         throw exceptions::IllegalArgumentException( __FILE__, __LINE__,
-            "ThreadPool::QueueTask - Invalid args for Task");
-      }
-       
-      //LOGCMS_DEBUG(logger, "ThreadPool::QueueTask - syncing on queue");
+    try
+    {
+        if(!task.first || !task.second)
+        {
+            throw exceptions::IllegalArgumentException( __FILE__, __LINE__,
+                "ThreadPool::QueueTask - Invalid args for Task");
+        }
+
+        //LOGCMS_DEBUG(logger, "ThreadPool::QueueTask - syncing on queue");
     
-      synchronized(&queue)
-      {
-         //LOGCMS_DEBUG(logger, "ThreadPool::QueueTask - sync'd, synching pool");
+        synchronized(&queue)
+        {
+            //LOGCMS_DEBUG(logger, "ThreadPool::QueueTask - sync'd, synching pool");
     
-         // If there's nobody open to do work, then create some more
-         // threads to handle the work.
-         if(freeThreads == 0)
-         {
-            AllocateThreads(blockSize);
-         }
+            // If there's nobody open to do work, then create some more
+            // threads to handle the work.
+            if(freeThreads == 0)
+            {
+                AllocateThreads(blockSize);
+            }
     
-         //LOGCMS_DEBUG(logger, "ThreadPool::QueueTask - pushing task");
+            //LOGCMS_DEBUG(logger, "ThreadPool::QueueTask - pushing task");
     
-         // queue the new work.
-         queue.push(task);
+            // queue the new work.
+            queue.push(task);
          
-         //LOGCMS_DEBUG(logger, "ThreadPool::QueueTask - calling notify");
+            //LOGCMS_DEBUG(logger, "ThreadPool::QueueTask - calling notify");
    
-         // Inform waiters that we put some work on the queue.
-         queue.notify();
-      }
-   }
-   AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
-   AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+            // Inform waiters that we put some work on the queue.
+            queue.notify();
+        }
+    }
+    AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+    AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 ThreadPool::Task ThreadPool::deQueueTask(void)
    throw ( exceptions::ActiveMQException )
 {
-   try
-   {
-      //LOGCMS_DEBUG(logger, "ThreadPool::DeQueueTask - syncing on queue");
+    try
+    {
+        //LOGCMS_DEBUG(logger, "ThreadPool::DeQueueTask - syncing on queue");
     
-      synchronized(&queue)
-      {
-         /*LOGCMS_DEBUG(logger, 
-            "ThreadPool::DeQueueTask - sync'd checking queue empty");*/
-
-         // Wait for work, wait in a while loop since another thread could
-         // be waiting for a lock and get the work before we get woken up
-         // from our wait.
-         while(queue.empty() && !shutdown)
-         {
-            //LOGCMS_DEBUG(logger, "ThreadPool::DeQueueTask - Q empty, waiting");
+        synchronized(&queue)
+        {
+            /*LOGCMS_DEBUG(logger, 
+                "ThreadPool::DeQueueTask - sync'd checking queue empty");*/
+
+           // Wait for work, wait in a while loop since another thread could
+           // be waiting for a lock and get the work before we get woken up
+           // from our wait.
+           while(queue.empty() && !shutdown)
+           {
+               //LOGCMS_DEBUG(logger, "ThreadPool::DeQueueTask - Q empty, waiting");
 
-            queue.wait();
+               queue.wait();
 
-            //LOGCMS_DEBUG(logger, "ThreadPool::DeQueueTask - done waiting");
-         }
+               //LOGCMS_DEBUG(logger, "ThreadPool::DeQueueTask - done waiting");
+           }
           
-         // Don't give more work if we are closing down
-         if(shutdown)
-         {
-            return Task();
-         }
+           // Don't give more work if we are closing down
+           if(shutdown)
+           {
+               return Task();
+           }
           
-         // check size again.
-         if(queue.empty())
-         {
-            throw exceptions::ActiveMQException( __FILE__, __LINE__,
-               "ThreadPool::DeQueueUserWorkItem - Empty Taskn, not in shutdown.");
-         }
+           // check size again.
+           if(queue.empty())
+           {
+               throw exceptions::ActiveMQException( __FILE__, __LINE__,
+                   "ThreadPool::DeQueueUserWorkItem - Empty Taskn, not in shutdown.");
+           }
           
-         //LOGCMS_DEBUG(logger, "ThreadPool::DeQueueTask - popping task");
+           //LOGCMS_DEBUG(logger, "ThreadPool::DeQueueTask - popping task");
 
-         // not empty so get the new work to do
-         return queue.pop();
-      }
+           // not empty so get the new work to do
+           return queue.pop();
+        }
        
-      return Task();
-   }
-   AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
-   AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        return Task();
+    }
+    AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+    AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ThreadPool::reserve(unsigned long size)
+void ThreadPool::reserve( unsigned long size )
 {
-   try{
-      synchronized(&poolLock)
-      {
-         if(size < pool.size() || pool.size() == maxThreads)
-         {
-            return;
-         }
+    try
+    {
+        synchronized(&poolLock)
+        {
+            if(size < pool.size() || pool.size() == maxThreads)
+            {
+                return;
+            }
          
-         // How many do we reserve
-         unsigned long allocCount = size - pool.size();
+            // How many do we reserve
+            unsigned long allocCount = size - pool.size();
           
-         // Allocate the new Threads
-         AllocateThreads(allocCount);
-      }
-   }
-   AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
-   AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+            // Allocate the new Threads
+            AllocateThreads(allocCount);
+        }
+    }
+    AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+    AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ThreadPool::setMaxThreads(unsigned long maxThreads)
+void ThreadPool::setMaxThreads( unsigned long maxThreads )
 {
-   try
-   {
-      synchronized(&poolLock)
-      {
-         if(maxThreads == 0)
-         {
-            // Caller tried to do something stupid, ignore them.
-            return;
-         }
+    try
+    {
+        synchronized(&poolLock)
+        {
+            if(maxThreads == 0)
+            {
+                // Caller tried to do something stupid, ignore them.
+                return;
+            }
           
-         this->maxThreads = maxThreads;
-      }
-   }
-   AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
-   AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+            this->maxThreads = maxThreads;
+        }
+    }
+    AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+    AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ThreadPool::setBlockSize(unsigned long blockSize)
+void ThreadPool::setBlockSize( unsigned long blockSize )
 {
-   try
-   {
-      if(blockSize <= 0)
-      {
-         // User tried something dumb, protect them from themselves
-         return;
-      }
+    try
+    {
+        if(blockSize <= 0)
+        {
+            // User tried something dumb, protect them from themselves
+            return;
+        }
     
-      synchronized(&poolLock)
-      {
-         this->blockSize = blockSize;
-      }
-   }
-   AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
-   AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        synchronized(&poolLock)
+        {
+            this->blockSize = blockSize;
+        }
+    }
+    AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+    AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ThreadPool::AllocateThreads(unsigned long count)
+void ThreadPool::AllocateThreads( unsigned long count )
 {
-   try
-   {
-      if(pool.size() >= maxThreads)
-      {
-         return;
-      }
+    try
+    {
+        if(pool.size() >= maxThreads)
+        {
+            return;
+        }
     
-      synchronized(&poolLock)
-      {
-         // Take the min of alloc size of maxThreads since we don't
-         // want anybody sneaking eaxtra threads in, greedy bastards.
-         count = std::min(count, maxThreads - pool.size());
+        synchronized(&poolLock)
+        {
+            // Take the min of alloc size of maxThreads since we don't
+            // want anybody sneaking eaxtra threads in, greedy bastards.
+            count = std::min(count, maxThreads - pool.size());
        
-         // Each time we create a thread we increment the free Threads 
-         // counter, but before we call start so that the Thread doesn't 
-         // get ahead of us.
-         for(unsigned long i = 0; i < count; ++i)
-         {
-            pool.push_back(new PooledThread(this));
-            pool.back()->setPooledThreadListener(this);
-            freeThreads++;
-            pool.back()->start();
-         }
-      }
-   }
-   AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
-   AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+            // Each time we create a thread we increment the free Threads 
+            // counter, but before we call start so that the Thread doesn't 
+            // get ahead of us.
+            for(unsigned long i = 0; i < count; ++i)
+            {
+                pool.push_back(new PooledThread(this));
+                pool.back()->setPooledThreadListener(this);
+                freeThreads++;
+                pool.back()->start();
+            }
+        }
+    }
+    AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+    AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ThreadPool::onTaskStarted(PooledThread* thread)
+void ThreadPool::onTaskStarted( PooledThread* thread )
 {
-   try
-   {
-      synchronized(&poolLock)
-      {
-         freeThreads--;
+    try
+    {
+        synchronized(&poolLock)
+        {
+            freeThreads--;
           
-         // Now that this callback has decremented the free threads coutner
-         // let check if there is any outstanding work to be done and no
-         // threads to handle it.  This could happen if the QueueTask
-         // method was called successively without any of the PooledThreads
-         // having a chance to wake up and service the queue.  This would
-         // cause the number of Task to exceed the number of free threads
-         // once the Threads got a chance to wake up and service the queue
-         if(freeThreads == 0 && !queue.empty())
-         {
-            // Allocate a new block of threads
-            AllocateThreads(blockSize);
-         }
-      }
-
-      //LOGCMS_DEBUG(logger, "ThreadPool::onTaskStarted:");
-   }
-   AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
-   AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+            // Now that this callback has decremented the free threads coutner
+            // let check if there is any outstanding work to be done and no
+            // threads to handle it.  This could happen if the QueueTask
+            // method was called successively without any of the PooledThreads
+            // having a chance to wake up and service the queue.  This would
+            // cause the number of Task to exceed the number of free threads
+            // once the Threads got a chance to wake up and service the queue
+            if(freeThreads == 0 && !queue.empty())
+            {
+                // Allocate a new block of threads
+                AllocateThreads(blockSize);
+            }
+        }
+
+        //LOGCMS_DEBUG(logger, "ThreadPool::onTaskStarted:");
+    }
+    AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+    AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
 }
  
 ////////////////////////////////////////////////////////////////////////////////
-void ThreadPool::onTaskCompleted(PooledThread* thread)
+void ThreadPool::onTaskCompleted( PooledThread* thread )
 {
-   try
-   {    
-      synchronized(&poolLock)
-      {
-         freeThreads++;
-      }
-
-      //LOGCMS_DEBUG(logger, "ThreadPool::onTaskCompleted: ");
-   }
-   AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
-   AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+    try
+    {    
+        synchronized(&poolLock)
+        {
+            freeThreads++;
+        }
+
+        //LOGCMS_DEBUG(logger, "ThreadPool::onTaskCompleted: ");
+    }
+    AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+    AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -313,32 +319,32 @@
    PooledThread* thread, 
    exceptions::ActiveMQException& ex)
 {
-   //LOGCMS_DEBUG(logger, "ThreadPool::onTaskException: ");
+    //LOGCMS_DEBUG(logger, "ThreadPool::onTaskException: ");
 
-   try
-   {
-      synchronized(&poolLock)
-      {
-         // Delete the thread that had the exception and start a new 
-         // one to take its place.
-         freeThreads--;
+    try
+    {
+        synchronized(&poolLock)
+        {
+            // Delete the thread that had the exception and start a new 
+            // one to take its place.
+            freeThreads--;
           
-         std::vector<PooledThread*>::iterator itr = 
-            std::find(pool.begin(), pool.end(), thread);
+            std::vector<PooledThread*>::iterator itr = 
+                std::find(pool.begin(), pool.end(), thread);
     
-         if(itr != pool.end())
-         {
-            pool.erase(itr);
-         }
+            if(itr != pool.end())
+            {
+                pool.erase(itr);
+            }
     
-         // Bye-Bye Thread Object
-         delete thread;
+            // Bye-Bye Thread Object
+            delete thread;
           
-         // Now allocate a replacement
-         AllocateThreads(1);
-      }
-   }
-   AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
-   AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+            // Now allocate a replacement
+            AllocateThreads(1);
+        }
+    }
+    AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+    AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
 }
                                 



Mime
View raw message