activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r419422 [1/11] - in /incubator/activemq/trunk/openwire-cpp/src/main/cpp: activemq/ activemq/command/ activemq/protocol/openwire/ activemq/transport/ activemq/transport/tcp/ cms/ ppr/ ppr/io/ ppr/io/encoding/ ppr/net/ ppr/thread/ ppr/util/
Date Thu, 06 Jul 2006 03:18:03 GMT
Author: chirino
Date: Wed Jul  5 20:17:58 2006
New Revision: 419422

URL: http://svn.apache.org/viewvc?rev=419422&view=rev
Log:
set the eol style to native

Modified:
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/BrokerException.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/ConnectionClosedException.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/ConnectionFactory.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/ConsumerClosedException.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/DestinationFilter.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/Dispatcher.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageConsumer.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageConsumerSynchronization.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageProducer.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/Session.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/TransactionContext.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQBytesMessage.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQDestination.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQObjectMessage.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQQueue.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQStreamMessage.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempDestination.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempQueue.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempTopic.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTextMessage.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTopic.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/BaseCommand.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/BaseDataStructure.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/BrokerError.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/BrokerId.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/BrokerInfo.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ConnectionControl.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ConnectionError.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ConnectionId.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ConnectionInfo.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ConsumerControl.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ConsumerId.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ConsumerInfo.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ControlCommand.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/DataArrayResponse.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/DataResponse.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/DestinationInfo.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/DiscoveryEvent.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ExceptionResponse.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/FlushCommand.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/IntegerResponse.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/JournalQueueAck.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/JournalTopicAck.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/JournalTrace.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/JournalTransaction.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/KeepAliveInfo.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/LastPartialCommand.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/LocalTransactionId.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/Message.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/MessageAck.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/MessageDispatch.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/MessageDispatchNotification.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/MessageId.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/NetworkBridgeFilter.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/PartialCommand.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ProducerId.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ProducerInfo.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/RemoveInfo.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/RemoveSubscriptionInfo.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ReplayCommand.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/Response.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SessionId.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SessionInfo.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ShutdownInfo.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/SubscriptionInfo.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/TransactionId.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/TransactionInfo.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/WireFormatInfo.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/XATransactionId.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireMarshaller.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireProtocol.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/transport/CorrelatorFilter.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/transport/FutureResponse.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/transport/LoggingFilter.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/transport/MutexFilter.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/transport/TransportFactory.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/transport/TransportFilter.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/transport/tcp/TcpTransport.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/cms/CmsException.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/TraceException.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/io/BufferedInputStream.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/io/BufferedOutputStream.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/io/ByteArrayInputStream.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/io/ByteArrayOutputStream.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/io/DataInputStream.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/io/DataOutputStream.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/io/SocketInputStream.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/io/SocketOutputStream.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/io/encoding/AsciiToUTF8Encoder.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/io/encoding/CharsetEncoderRegistry.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/net/ServerSocket.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/net/Socket.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/net/Uri.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/thread/Thread.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/util/Guid.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/util/Hex.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/util/MapItemHolder.cpp   (contents, props changed)
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/ppr/util/Time.cpp   (contents, props changed)

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/BrokerException.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/BrokerException.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/BrokerException.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/BrokerException.cpp Wed Jul  5 20:17:58 2006
@@ -1,48 +1,48 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/BrokerException.hpp"
-
-using namespace apache::activemq;
-
-/*
- * 
- */
-BrokerException::BrokerException(p<BrokerError> brokerError)
-{
-    this->brokerError = brokerError ;
-
-    // Build exception message
-    msg.assign( brokerError->getExceptionClass()->c_str() ) ;
-    msg.append( " : " ) ;
-    msg.append( brokerError->getMessage()->c_str() ) ;
-}
-
-/*
- * 
- */
-p<BrokerError> BrokerException::getBrokerError()
-{
-    return brokerError ;
-}
-
-/*
- * 
- */
-p<string> BrokerException::getJavaStackTrace()
-{
-    return brokerError->getStackTrace() ;
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/BrokerException.hpp"
+
+using namespace apache::activemq;
+
+/*
+ * 
+ */
+BrokerException::BrokerException(p<BrokerError> brokerError)
+{
+    this->brokerError = brokerError ;
+
+    // Build exception message
+    msg.assign( brokerError->getExceptionClass()->c_str() ) ;
+    msg.append( " : " ) ;
+    msg.append( brokerError->getMessage()->c_str() ) ;
+}
+
+/*
+ * 
+ */
+p<BrokerError> BrokerException::getBrokerError()
+{
+    return brokerError ;
+}
+
+/*
+ * 
+ */
+p<string> BrokerException::getJavaStackTrace()
+{
+    return brokerError->getStackTrace() ;
+}

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/BrokerException.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/ConnectionClosedException.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/ConnectionClosedException.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/ConnectionClosedException.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/ConnectionClosedException.cpp Wed Jul  5 20:17:58 2006
@@ -1,29 +1,29 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/ConnectionClosedException.hpp"
-
-using namespace apache::activemq;
-
-/*
- * 
- */
-ConnectionClosedException::ConnectionClosedException(const char* message)
-    : CmsException(message)
-{
-    // no-op
-}
-
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/ConnectionClosedException.hpp"
+
+using namespace apache::activemq;
+
+/*
+ * 
+ */
+ConnectionClosedException::ConnectionClosedException(const char* message)
+    : CmsException(message)
+{
+    // no-op
+}
+

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/ConnectionClosedException.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/ConnectionFactory.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/ConnectionFactory.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/ConnectionFactory.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/ConnectionFactory.cpp Wed Jul  5 20:17:58 2006
@@ -1,184 +1,184 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/ConnectionFactory.hpp"
-#include "activemq/Connection.hpp"
-#include "activemq/protocol/openwire/OpenWireProtocol.hpp"
-#include "activemq/transport/tcp/TcpTransport.hpp"
-
-using namespace apache::activemq;
-
-/*
- *
- */
-ConnectionFactory::ConnectionFactory()
-{
-    // Use default URI
-    brokerUri        = new Uri ("tcp://localhost:61616") ;
-    username         = NULL ;
-    password         = NULL ;
-    clientId         = Guid::getGuidString() ;
-    transportFactory = new TransportFactory() ;
-}
-
-/*
- *
- */
-ConnectionFactory::ConnectionFactory(p<Uri> brokerUri)
-{
-    this->brokerUri  = brokerUri;
-    username         = NULL ;
-    password         = NULL ;
-    clientId         = Guid::getGuidString() ;
-    transportFactory = new TransportFactory() ;
-}
-
-
-// --- Attribute methods --------------------------------------------
-
-/*
- *
- */
-p<Uri> ConnectionFactory::getBrokerUri()
-{
-     return brokerUri ;
-}
-
-/*
- *
- */
-void ConnectionFactory::setBrokerUri(p<Uri> brokerUri)
-{
-    this->brokerUri = brokerUri ;
-}
-
-/*
- *
- */
-p<string> ConnectionFactory::getUsername()
-{
-    return username ;
-}
-
-/*
- *
- */
-void ConnectionFactory::setUsername(const char* username)
-{
-    this->username = new string(username) ;
-}
-
-/*
- *
- */
-p<string> ConnectionFactory::getPassword()
-{
-    return password ;
-}
-
-/*
- *
- */
-void ConnectionFactory::setPassword(const char* password)
-{
-    this->password = new string(password);
-
-}
-
-/*
- *
- */
-p<string> ConnectionFactory::getClientId()
-{
-    return clientId ;
-}
-
-/*
- *
- */
-void ConnectionFactory::setClientId(const char* clientId)
-{
-    this->clientId = new string(clientId) ;
-}
-
-
-// --- Operation methods --------------------------------------------
-
-/*
- *
- */
-p<IConnection> ConnectionFactory::createConnection() throw (ConnectionException)
-{
-    return createConnection( (username != NULL) ? username->c_str() : NULL,
-                             (password != NULL) ? password->c_str() : NULL ) ;
-}
-
-/*
- *
- */
-p<IConnection> ConnectionFactory::createConnection(const char* username, const char* password) throw (ConnectionException)
-{
-    p<ConnectionInfo> connectionInfo ;
-    p<ITransport>     transport ;
-    p<Connection>     connection ;
-
-
-    // Set up a new connection object
-    connectionInfo = createConnectionInfo(username, password) ;
-    transport      = createTransport() ;
-    connection     = new Connection(transport, connectionInfo) ;
-    connection->setClientId( clientId->c_str() ) ;
-
-    return connection ;
-}
-
-
-// --- Implementation methods ---------------------------------------
-
-/*
- *
- */
-p<ConnectionInfo> ConnectionFactory::createConnectionInfo(const char* username, const char* password)
-{
-    p<ConnectionInfo> connectionInfo = new ConnectionInfo() ;
-    p<ConnectionId>   connectionId   = new ConnectionId() ;
-    p<string>         uid = (username != NULL) ? new string(username) : NULL ;
-    p<string>         pwd = (password != NULL) ? new string(password) : NULL ;
-
-    connectionId->setValue( Guid::getGuidString() ) ;
-    connectionInfo->setConnectionId( connectionId ) ;
-    connectionInfo->setUserName( uid ) ;
-    connectionInfo->setPassword( pwd ) ;
-    connectionInfo->setClientId( clientId ) ;
-
-    return connectionInfo ;
-}
-
-/*
- *
- */
-p<ITransport> ConnectionFactory::createTransport() throw (ConnectionException)
-{
-    try
-    {
-    	// Create a transport for given URI
-        return transportFactory->createTransport( brokerUri ) ;
-    }
-    catch( SocketException se )
-    {
-        throw ConnectionException(__FILE__, __LINE__, "Failed to connect socket") ;
-    }
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/ConnectionFactory.hpp"
+#include "activemq/Connection.hpp"
+#include "activemq/protocol/openwire/OpenWireProtocol.hpp"
+#include "activemq/transport/tcp/TcpTransport.hpp"
+
+using namespace apache::activemq;
+
+/*
+ *
+ */
+ConnectionFactory::ConnectionFactory()
+{
+    // Use default URI
+    brokerUri        = new Uri ("tcp://localhost:61616") ;
+    username         = NULL ;
+    password         = NULL ;
+    clientId         = Guid::getGuidString() ;
+    transportFactory = new TransportFactory() ;
+}
+
+/*
+ *
+ */
+ConnectionFactory::ConnectionFactory(p<Uri> brokerUri)
+{
+    this->brokerUri  = brokerUri;
+    username         = NULL ;
+    password         = NULL ;
+    clientId         = Guid::getGuidString() ;
+    transportFactory = new TransportFactory() ;
+}
+
+
+// --- Attribute methods --------------------------------------------
+
+/*
+ *
+ */
+p<Uri> ConnectionFactory::getBrokerUri()
+{
+     return brokerUri ;
+}
+
+/*
+ *
+ */
+void ConnectionFactory::setBrokerUri(p<Uri> brokerUri)
+{
+    this->brokerUri = brokerUri ;
+}
+
+/*
+ *
+ */
+p<string> ConnectionFactory::getUsername()
+{
+    return username ;
+}
+
+/*
+ *
+ */
+void ConnectionFactory::setUsername(const char* username)
+{
+    this->username = new string(username) ;
+}
+
+/*
+ *
+ */
+p<string> ConnectionFactory::getPassword()
+{
+    return password ;
+}
+
+/*
+ *
+ */
+void ConnectionFactory::setPassword(const char* password)
+{
+    this->password = new string(password);
+
+}
+
+/*
+ *
+ */
+p<string> ConnectionFactory::getClientId()
+{
+    return clientId ;
+}
+
+/*
+ *
+ */
+void ConnectionFactory::setClientId(const char* clientId)
+{
+    this->clientId = new string(clientId) ;
+}
+
+
+// --- Operation methods --------------------------------------------
+
+/*
+ *
+ */
+p<IConnection> ConnectionFactory::createConnection() throw (ConnectionException)
+{
+    return createConnection( (username != NULL) ? username->c_str() : NULL,
+                             (password != NULL) ? password->c_str() : NULL ) ;
+}
+
+/*
+ *
+ */
+p<IConnection> ConnectionFactory::createConnection(const char* username, const char* password) throw (ConnectionException)
+{
+    p<ConnectionInfo> connectionInfo ;
+    p<ITransport>     transport ;
+    p<Connection>     connection ;
+
+
+    // Set up a new connection object
+    connectionInfo = createConnectionInfo(username, password) ;
+    transport      = createTransport() ;
+    connection     = new Connection(transport, connectionInfo) ;
+    connection->setClientId( clientId->c_str() ) ;
+
+    return connection ;
+}
+
+
+// --- Implementation methods ---------------------------------------
+
+/*
+ *
+ */
+p<ConnectionInfo> ConnectionFactory::createConnectionInfo(const char* username, const char* password)
+{
+    p<ConnectionInfo> connectionInfo = new ConnectionInfo() ;
+    p<ConnectionId>   connectionId   = new ConnectionId() ;
+    p<string>         uid = (username != NULL) ? new string(username) : NULL ;
+    p<string>         pwd = (password != NULL) ? new string(password) : NULL ;
+
+    connectionId->setValue( Guid::getGuidString() ) ;
+    connectionInfo->setConnectionId( connectionId ) ;
+    connectionInfo->setUserName( uid ) ;
+    connectionInfo->setPassword( pwd ) ;
+    connectionInfo->setClientId( clientId ) ;
+
+    return connectionInfo ;
+}
+
+/*
+ *
+ */
+p<ITransport> ConnectionFactory::createTransport() throw (ConnectionException)
+{
+    try
+    {
+    	// Create a transport for given URI
+        return transportFactory->createTransport( brokerUri ) ;
+    }
+    catch( SocketException se )
+    {
+        throw ConnectionException(__FILE__, __LINE__, "Failed to connect socket") ;
+    }
+}

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/ConnectionFactory.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/ConsumerClosedException.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/ConsumerClosedException.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/ConsumerClosedException.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/ConsumerClosedException.cpp Wed Jul  5 20:17:58 2006
@@ -1,29 +1,29 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/ConsumerClosedException.hpp"
-
-using namespace apache::activemq;
-
-/*
- * 
- */
-ConsumerClosedException::ConsumerClosedException(const char* message)
-    : CmsException(message)
-{
-    // no-op
-}
-
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/ConsumerClosedException.hpp"
+
+using namespace apache::activemq;
+
+/*
+ * 
+ */
+ConsumerClosedException::ConsumerClosedException(const char* message)
+    : CmsException(message)
+{
+    // no-op
+}
+

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/ConsumerClosedException.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/DestinationFilter.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/DestinationFilter.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/DestinationFilter.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/DestinationFilter.cpp Wed Jul  5 20:17:58 2006
@@ -1,47 +1,47 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/DestinationFilter.hpp"
-
-using namespace apache::activemq;
-
-// Init static constants
-const char* DestinationFilter::ANY_DESCENDENT = ">" ;
-const char* DestinationFilter::ANY_CHILD      = "*" ;
-
-/*
- * 
- */
-DestinationFilter::DestinationFilter()
-{
-    // no-op
-}
-
-/*
- * 
- */
-DestinationFilter::~DestinationFilter()
-{
-    // no-op
-}
-
-/*
- * 
- */
-bool DestinationFilter::matches(p<ActiveMQMessage> message)
-{
-    return matches( message->getDestination() ) ; 
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/DestinationFilter.hpp"
+
+using namespace apache::activemq;
+
+// Init static constants
+const char* DestinationFilter::ANY_DESCENDENT = ">" ;
+const char* DestinationFilter::ANY_CHILD      = "*" ;
+
+/*
+ * 
+ */
+DestinationFilter::DestinationFilter()
+{
+    // no-op
+}
+
+/*
+ * 
+ */
+DestinationFilter::~DestinationFilter()
+{
+    // no-op
+}
+
+/*
+ * 
+ */
+bool DestinationFilter::matches(p<ActiveMQMessage> message)
+{
+    return matches( message->getDestination() ) ; 
+}

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/DestinationFilter.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/Dispatcher.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/Dispatcher.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/Dispatcher.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/Dispatcher.cpp Wed Jul  5 20:17:58 2006
@@ -1,140 +1,140 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/Dispatcher.hpp"
-
-using namespace apache::activemq;
-
-/*
- * 
- */
-Dispatcher::Dispatcher()
-{
-    dispatchQueue = new queue< p<IMessage> > ;
-    redeliverList = new list< p<IMessage> > ;
-}
-
-/*
- * 
- */
-void Dispatcher::redeliverRolledBackMessages()
-{
-    LOCKED_SCOPE (mutex);
-
-    p<queue< p<IMessage> > > replacementQueue = new queue< p<IMessage> > ;
-    //(dispatchQueue->size() + redeliverList->size() ) ;
-
-    // Copy all messages to be redelivered to the new queue
-    while( !redeliverList->empty() )
-    {
-        replacementQueue->push( redeliverList->front() ) ;
-        redeliverList->pop_front() ;
-    }
-
-    // Copy all messages to be dispatched to the new queue
-    while( dispatchQueue->size() > 0 )
-    {
-        // Get first element in queue
-        p<IMessage> element = p_cast<IMessage> (dispatchQueue->front()) ;
-
-        // Remove first element from queue
-        dispatchQueue->pop() ;
-
-        // Add element to the new queue
-        replacementQueue->push(element) ;
-    }
-    // Switch to the new queue
-    dispatchQueue = replacementQueue ;
-
-    semaphore.notify() ;
-}
-
-/*
- * 
- */
-void Dispatcher::redeliver(p<IMessage> message)
-{
-    LOCKED_SCOPE (mutex);
-    redeliverList->push_back(message) ;
-}
-
-/*
- * 
- */
-void Dispatcher::enqueue(p<IMessage> message)
-{
-    LOCKED_SCOPE (mutex);
-    dispatchQueue->push(message) ;
-    semaphore.notify() ;
-}
-
-/*
- * 
- */
-p<IMessage> Dispatcher::dequeueNoWait()
-{
-    p<IMessage> msg = NULL ;
-
-    {
-        LOCKED_SCOPE (mutex);
-
-        if( dispatchQueue->size() > 0 )
-        {
-            msg = p_cast<IMessage> (dispatchQueue->front()) ;
-            dispatchQueue->pop() ;
-        }
-    }        
-    return msg ;
-}
-
-/*
- * 
- */
-p<IMessage> Dispatcher::dequeue(int timeout)
-{
-    p<IMessage> msg = NULL ;
-
-    {
-        LOCKED_SCOPE (mutex);
-
-        if( dispatchQueue->size() == 0 )
-            semaphore.wait(timeout) ;
-
-        if( dispatchQueue->size() > 0 )
-        {
-            msg = p_cast<IMessage> (dispatchQueue->front()) ;
-            dispatchQueue->pop() ;
-        }
-    }
-    return msg ;
-}
-
-/*
- * 
- */
-p<IMessage> Dispatcher::dequeue()
-{
-    p<IMessage> msg = NULL ;
-
-    {
-        LOCKED_SCOPE (mutex);
-
-        msg = p_cast<IMessage> (dispatchQueue->front()) ;
-        dispatchQueue->pop() ;
-    }
-
-    return msg ;
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/Dispatcher.hpp"
+
+using namespace apache::activemq;
+
+/*
+ * 
+ */
+Dispatcher::Dispatcher()
+{
+    dispatchQueue = new queue< p<IMessage> > ;
+    redeliverList = new list< p<IMessage> > ;
+}
+
+/*
+ * 
+ */
+void Dispatcher::redeliverRolledBackMessages()
+{
+    LOCKED_SCOPE (mutex);
+
+    p<queue< p<IMessage> > > replacementQueue = new queue< p<IMessage> > ;
+    //(dispatchQueue->size() + redeliverList->size() ) ;
+
+    // Copy all messages to be redelivered to the new queue
+    while( !redeliverList->empty() )
+    {
+        replacementQueue->push( redeliverList->front() ) ;
+        redeliverList->pop_front() ;
+    }
+
+    // Copy all messages to be dispatched to the new queue
+    while( dispatchQueue->size() > 0 )
+    {
+        // Get first element in queue
+        p<IMessage> element = p_cast<IMessage> (dispatchQueue->front()) ;
+
+        // Remove first element from queue
+        dispatchQueue->pop() ;
+
+        // Add element to the new queue
+        replacementQueue->push(element) ;
+    }
+    // Switch to the new queue
+    dispatchQueue = replacementQueue ;
+
+    semaphore.notify() ;
+}
+
+/*
+ * 
+ */
+void Dispatcher::redeliver(p<IMessage> message)
+{
+    LOCKED_SCOPE (mutex);
+    redeliverList->push_back(message) ;
+}
+
+/*
+ * 
+ */
+void Dispatcher::enqueue(p<IMessage> message)
+{
+    LOCKED_SCOPE (mutex);
+    dispatchQueue->push(message) ;
+    semaphore.notify() ;
+}
+
+/*
+ * 
+ */
+p<IMessage> Dispatcher::dequeueNoWait()
+{
+    p<IMessage> msg = NULL ;
+
+    {
+        LOCKED_SCOPE (mutex);
+
+        if( dispatchQueue->size() > 0 )
+        {
+            msg = p_cast<IMessage> (dispatchQueue->front()) ;
+            dispatchQueue->pop() ;
+        }
+    }        
+    return msg ;
+}
+
+/*
+ * 
+ */
+p<IMessage> Dispatcher::dequeue(int timeout)
+{
+    p<IMessage> msg = NULL ;
+
+    {
+        LOCKED_SCOPE (mutex);
+
+        if( dispatchQueue->size() == 0 )
+            semaphore.wait(timeout) ;
+
+        if( dispatchQueue->size() > 0 )
+        {
+            msg = p_cast<IMessage> (dispatchQueue->front()) ;
+            dispatchQueue->pop() ;
+        }
+    }
+    return msg ;
+}
+
+/*
+ * 
+ */
+p<IMessage> Dispatcher::dequeue()
+{
+    p<IMessage> msg = NULL ;
+
+    {
+        LOCKED_SCOPE (mutex);
+
+        msg = p_cast<IMessage> (dispatchQueue->front()) ;
+        dispatchQueue->pop() ;
+    }
+
+    return msg ;
+}

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/Dispatcher.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageConsumer.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageConsumer.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageConsumer.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageConsumer.cpp Wed Jul  5 20:17:58 2006
@@ -1,307 +1,307 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/MessageConsumer.hpp"
-#include "activemq/Session.hpp"
-
-using namespace apache::activemq;
-
-/*
- * 
- */
-MessageConsumer::MessageConsumer(p<Session> session, p<ConsumerInfo> consumerInfo, AcknowledgementMode acknowledgementMode)
-{
-    this->session                = session ;
-    this->consumerInfo           = consumerInfo ;
-    this->acknowledgementMode    = acknowledgementMode ;
-    this->dispatcher             = new Dispatcher() ;
-    this->listener               = NULL ;
-    this->closed                 = false ;
-    this->maximumRedeliveryCount = 10 ;
-    this->redeliveryTimeout      = 500 ;
-}
-
-/*
- *
- */
-MessageConsumer::~MessageConsumer()
-{
-    // Make sure consumer is closed
-    close() ;
-}
-
-// Attribute methods ------------------------------------------------
-
-/*
- *
- */
-void MessageConsumer::setMessageListener(p<IMessageListener> listener)
-{
-    this->listener = listener ;
-}
-
-/*
- *
- */
-p<IMessageListener> MessageConsumer::getMessageListener()
-{
-    return listener ;
-}
-
-/*
- *
- */
-p<ConsumerId> MessageConsumer::getConsumerId()
-{
-    return consumerInfo->getConsumerId() ;
-}
-
-/*
- *
- */
-void MessageConsumer::setMaximumRedeliveryCount(int count)
-{
-    this->maximumRedeliveryCount = count ;
-}
-
-/*
- *
- */
-int MessageConsumer::getMaximumRedeliveryCount()
-{
-    return maximumRedeliveryCount ;
-}
-
-/*
- *
- */
-void MessageConsumer::setRedeliveryTimeout(int timeout)
-{
-    this->redeliveryTimeout = timeout ;
-}
-
-/*
- *
- */
-int MessageConsumer::getRedeliveryTimeout()
-{
-    return redeliveryTimeout ;
-}
-
-
-// Operation methods ------------------------------------------------
-
-/*
- *
- */
-p<IMessage> MessageConsumer::receive()
-{
-    checkClosed() ;
-    return autoAcknowledge( dispatcher->dequeue() ) ;
-}
-
-/*
- *
- */
-p<IMessage> MessageConsumer::receive(int timeout)
-{
-    checkClosed() ;
-    return autoAcknowledge( dispatcher->dequeue(timeout) ) ;
-}
-
-/*
- *
- */
-p<IMessage> MessageConsumer::receiveNoWait()
-{
-    checkClosed() ;
-    return autoAcknowledge( dispatcher->dequeueNoWait() ) ;
-}
-
-/*
- *
- */
-void MessageConsumer::redeliverRolledBackMessages()
-{
-    dispatcher->redeliverRolledBackMessages() ;
-}
-
-/*
- * Transport callback that handles messages dispatching
- */
-void MessageConsumer::dispatch(p<IMessage> message)
-{
-    dispatcher->enqueue(message) ;
-
-    // Activate background dispatch thread if async listener is set up
-    if( listener != NULL )
-        session->dispatch() ;
-}
-
-/*
- *
- */
-void MessageConsumer::dispatchAsyncMessages()
-{
-    while( listener != NULL )
-    {
-        p<IMessage> message = dispatcher->dequeueNoWait() ;
-
-        if( message != NULL )
-        {
-            // Auto acknowledge message if selected
-            autoAcknowledge(message) ;
-
-            // Let listener process message
-            listener->onMessage(message) ;
-        }
-        else
-            break ;
-    }
-}
-
-/*
- * IAcknowledger callback method.
- */
-void MessageConsumer::acknowledge(p<ActiveMQMessage> message)
-{
-    doClientAcknowledge(message) ;
-}
-
-/*
- * 
- */
-void MessageConsumer::close()
-{
-    if( !closed )
-    {
-        closed = true ;
-    
-        // De-register consumer from broker
-        session->getConnection()->disposeOf( consumerInfo->getConsumerId() ) ;
-
-        // Reset internal state (prevent cyclic references)
-        session = NULL ;
-    }
-}
-
-
-// Implementation methods ------------------------------------------------
-
-/*
- *
- */
-void MessageConsumer::checkClosed() throw(CmsException) 
-{
-    if( closed )
-        throw ConnectionClosedException("Oops! Connection already closed") ;
-}
-
-/*
- *
- */
-p<IMessage> MessageConsumer::autoAcknowledge(p<IMessage> message)
-{
-    try
-    {
-        // Is the message an ActiveMQMessage? (throws bad_cast otherwise)
-        p<ActiveMQMessage> activeMessage = p_dyncast<ActiveMQMessage> (message) ;
-
-        // Register the handler for client acknowledgment
-        activeMessage->setAcknowledger( smartify(this) ) ;
-
-        if( acknowledgementMode != ClientAckMode )
-            doAcknowledge(activeMessage) ;
-    }
-    catch( bad_cast& bc )
-    {
-        // ignore
-    }
-    return message ;
-}
-
-/*
- *
- */
-void MessageConsumer::doClientAcknowledge(p<ActiveMQMessage> message)
-{
-    if( acknowledgementMode == ClientAckMode )
-        doAcknowledge(message);
-}
-
-/*
- *
- */
-void MessageConsumer::doAcknowledge(p<Message> message)
-{
-    p<MessageAck> ack = createMessageAck(message) ;
-    session->getConnection()->oneway(ack) ;
-}
-
-/*
- *
- */
-p<MessageAck> MessageConsumer::createMessageAck(p<Message> message)
-{
-    p<MessageAck> ack = new MessageAck() ;
-
-    // Set ack properties
-    ack->setAckType( ConsumedAck ) ;
-    ack->setConsumerId( consumerInfo->getConsumerId() ) ;
-    ack->setDestination( message->getDestination() ) ;
-    ack->setFirstMessageId( message->getMessageId() ) ;
-    ack->setLastMessageId( message->getMessageId() ) ;
-    ack->setMessageCount( 1 ) ;
-    
-    if( session->isTransacted() )
-    {
-        session->doStartTransaction() ;
-        ack->setTransactionId( session->getTransactionContext()->getTransactionId() ) ;
-        session->getTransactionContext()->addSynchronization( new MessageConsumerSynchronization(smartify(this), message) ) ;
-    }
-    return ack ;
-}
-
-/*
- *
- */
-void MessageConsumer::afterRollback(p<ActiveMQMessage> message)
-{
-    // Try redeliver of the message again
-    message->setRedeliveryCounter( message->getRedeliveryCounter() + 1 ) ;
-
-    // Check if redeliver count has exceeded maximum
-    if( message->getRedeliveryCounter() > maximumRedeliveryCount )
-    {
-        // Send back a poisoned pill
-        p<MessageAck> ack = new MessageAck() ;
-        ack->setAckType( PoisonAck ) ;
-        ack->setConsumerId( consumerInfo->getConsumerId() ) ;
-        ack->setDestination( message->getDestination() ) ;
-        ack->setFirstMessageId( message->getMessageId() ) ;
-        ack->setLastMessageId( message->getMessageId() ) ;
-        ack->setMessageCount( 1 ) ;
-        session->getConnection()->oneway(ack) ;
-    }
-    else
-    {
-        dispatcher->redeliver(message) ;
-        
-        // Re-dispatch the message at some point in the future
-        if( listener != NULL )
-            session->dispatch( redeliveryTimeout ) ;
-    }
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/MessageConsumer.hpp"
+#include "activemq/Session.hpp"
+
+using namespace apache::activemq;
+
+/*
+ * 
+ */
+MessageConsumer::MessageConsumer(p<Session> session, p<ConsumerInfo> consumerInfo, AcknowledgementMode acknowledgementMode)
+{
+    this->session                = session ;
+    this->consumerInfo           = consumerInfo ;
+    this->acknowledgementMode    = acknowledgementMode ;
+    this->dispatcher             = new Dispatcher() ;
+    this->listener               = NULL ;
+    this->closed                 = false ;
+    this->maximumRedeliveryCount = 10 ;
+    this->redeliveryTimeout      = 500 ;
+}
+
+/*
+ *
+ */
+MessageConsumer::~MessageConsumer()
+{
+    // Make sure consumer is closed
+    close() ;
+}
+
+// Attribute methods ------------------------------------------------
+
+/*
+ *
+ */
+void MessageConsumer::setMessageListener(p<IMessageListener> listener)
+{
+    this->listener = listener ;
+}
+
+/*
+ *
+ */
+p<IMessageListener> MessageConsumer::getMessageListener()
+{
+    return listener ;
+}
+
+/*
+ *
+ */
+p<ConsumerId> MessageConsumer::getConsumerId()
+{
+    return consumerInfo->getConsumerId() ;
+}
+
+/*
+ *
+ */
+void MessageConsumer::setMaximumRedeliveryCount(int count)
+{
+    this->maximumRedeliveryCount = count ;
+}
+
+/*
+ *
+ */
+int MessageConsumer::getMaximumRedeliveryCount()
+{
+    return maximumRedeliveryCount ;
+}
+
+/*
+ *
+ */
+void MessageConsumer::setRedeliveryTimeout(int timeout)
+{
+    this->redeliveryTimeout = timeout ;
+}
+
+/*
+ *
+ */
+int MessageConsumer::getRedeliveryTimeout()
+{
+    return redeliveryTimeout ;
+}
+
+
+// Operation methods ------------------------------------------------
+
+/*
+ *
+ */
+p<IMessage> MessageConsumer::receive()
+{
+    checkClosed() ;
+    return autoAcknowledge( dispatcher->dequeue() ) ;
+}
+
+/*
+ *
+ */
+p<IMessage> MessageConsumer::receive(int timeout)
+{
+    checkClosed() ;
+    return autoAcknowledge( dispatcher->dequeue(timeout) ) ;
+}
+
+/*
+ *
+ */
+p<IMessage> MessageConsumer::receiveNoWait()
+{
+    checkClosed() ;
+    return autoAcknowledge( dispatcher->dequeueNoWait() ) ;
+}
+
+/*
+ *
+ */
+void MessageConsumer::redeliverRolledBackMessages()
+{
+    dispatcher->redeliverRolledBackMessages() ;
+}
+
+/*
+ * Transport callback that handles messages dispatching
+ */
+void MessageConsumer::dispatch(p<IMessage> message)
+{
+    dispatcher->enqueue(message) ;
+
+    // Activate background dispatch thread if async listener is set up
+    if( listener != NULL )
+        session->dispatch() ;
+}
+
+/*
+ *
+ */
+void MessageConsumer::dispatchAsyncMessages()
+{
+    while( listener != NULL )
+    {
+        p<IMessage> message = dispatcher->dequeueNoWait() ;
+
+        if( message != NULL )
+        {
+            // Auto acknowledge message if selected
+            autoAcknowledge(message) ;
+
+            // Let listener process message
+            listener->onMessage(message) ;
+        }
+        else
+            break ;
+    }
+}
+
+/*
+ * IAcknowledger callback method.
+ */
+void MessageConsumer::acknowledge(p<ActiveMQMessage> message)
+{
+    doClientAcknowledge(message) ;
+}
+
+/*
+ * 
+ */
+void MessageConsumer::close()
+{
+    if( !closed )
+    {
+        closed = true ;
+    
+        // De-register consumer from broker
+        session->getConnection()->disposeOf( consumerInfo->getConsumerId() ) ;
+
+        // Reset internal state (prevent cyclic references)
+        session = NULL ;
+    }
+}
+
+
+// Implementation methods ------------------------------------------------
+
+/*
+ *
+ */
+void MessageConsumer::checkClosed() throw(CmsException) 
+{
+    if( closed )
+        throw ConnectionClosedException("Oops! Connection already closed") ;
+}
+
+/*
+ *
+ */
+p<IMessage> MessageConsumer::autoAcknowledge(p<IMessage> message)
+{
+    try
+    {
+        // Is the message an ActiveMQMessage? (throws bad_cast otherwise)
+        p<ActiveMQMessage> activeMessage = p_dyncast<ActiveMQMessage> (message) ;
+
+        // Register the handler for client acknowledgment
+        activeMessage->setAcknowledger( smartify(this) ) ;
+
+        if( acknowledgementMode != ClientAckMode )
+            doAcknowledge(activeMessage) ;
+    }
+    catch( bad_cast& bc )
+    {
+        // ignore
+    }
+    return message ;
+}
+
+/*
+ *
+ */
+void MessageConsumer::doClientAcknowledge(p<ActiveMQMessage> message)
+{
+    if( acknowledgementMode == ClientAckMode )
+        doAcknowledge(message);
+}
+
+/*
+ *
+ */
+void MessageConsumer::doAcknowledge(p<Message> message)
+{
+    p<MessageAck> ack = createMessageAck(message) ;
+    session->getConnection()->oneway(ack) ;
+}
+
+/*
+ *
+ */
+p<MessageAck> MessageConsumer::createMessageAck(p<Message> message)
+{
+    p<MessageAck> ack = new MessageAck() ;
+
+    // Set ack properties
+    ack->setAckType( ConsumedAck ) ;
+    ack->setConsumerId( consumerInfo->getConsumerId() ) ;
+    ack->setDestination( message->getDestination() ) ;
+    ack->setFirstMessageId( message->getMessageId() ) ;
+    ack->setLastMessageId( message->getMessageId() ) ;
+    ack->setMessageCount( 1 ) ;
+    
+    if( session->isTransacted() )
+    {
+        session->doStartTransaction() ;
+        ack->setTransactionId( session->getTransactionContext()->getTransactionId() ) ;
+        session->getTransactionContext()->addSynchronization( new MessageConsumerSynchronization(smartify(this), message) ) ;
+    }
+    return ack ;
+}
+
+/*
+ *
+ */
+void MessageConsumer::afterRollback(p<ActiveMQMessage> message)
+{
+    // Try redeliver of the message again
+    message->setRedeliveryCounter( message->getRedeliveryCounter() + 1 ) ;
+
+    // Check if redeliver count has exceeded maximum
+    if( message->getRedeliveryCounter() > maximumRedeliveryCount )
+    {
+        // Send back a poisoned pill
+        p<MessageAck> ack = new MessageAck() ;
+        ack->setAckType( PoisonAck ) ;
+        ack->setConsumerId( consumerInfo->getConsumerId() ) ;
+        ack->setDestination( message->getDestination() ) ;
+        ack->setFirstMessageId( message->getMessageId() ) ;
+        ack->setLastMessageId( message->getMessageId() ) ;
+        ack->setMessageCount( 1 ) ;
+        session->getConnection()->oneway(ack) ;
+    }
+    else
+    {
+        dispatcher->redeliver(message) ;
+        
+        // Re-dispatch the message at some point in the future
+        if( listener != NULL )
+            session->dispatch( redeliveryTimeout ) ;
+    }
+}

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageConsumer.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageConsumerSynchronization.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageConsumerSynchronization.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageConsumerSynchronization.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageConsumerSynchronization.cpp Wed Jul  5 20:17:58 2006
@@ -1,60 +1,60 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/MessageConsumerSynchronization.hpp"
-#include "activemq/MessageConsumer.hpp"
-
-using namespace apache::activemq;
-
-/*
- * 
- */
-MessageConsumerSynchronization::MessageConsumerSynchronization(p<MessageConsumer> consumer, p<Message> message)
-{
-    this->consumer = consumer ;
-    this->message  = message ;
-}
-
-/*
- * 
- */
-MessageConsumerSynchronization::~MessageConsumerSynchronization()
-{
-}
-
-/*
- * 
- */
-void MessageConsumerSynchronization::beforeCommit()
-{
-    // no-op
-}
-
-/*
- * 
- */
-void MessageConsumerSynchronization::afterCommit()
-{
-    // no-op
-}
-
-/*
- * 
- */
-void MessageConsumerSynchronization::afterRollback()
-{
-    consumer->afterRollback( p_cast<ActiveMQMessage> (message)) ;
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/MessageConsumerSynchronization.hpp"
+#include "activemq/MessageConsumer.hpp"
+
+using namespace apache::activemq;
+
+/*
+ * 
+ */
+MessageConsumerSynchronization::MessageConsumerSynchronization(p<MessageConsumer> consumer, p<Message> message)
+{
+    this->consumer = consumer ;
+    this->message  = message ;
+}
+
+/*
+ * 
+ */
+MessageConsumerSynchronization::~MessageConsumerSynchronization()
+{
+}
+
+/*
+ * 
+ */
+void MessageConsumerSynchronization::beforeCommit()
+{
+    // no-op
+}
+
+/*
+ * 
+ */
+void MessageConsumerSynchronization::afterCommit()
+{
+    // no-op
+}
+
+/*
+ * 
+ */
+void MessageConsumerSynchronization::afterRollback()
+{
+    consumer->afterRollback( p_cast<ActiveMQMessage> (message)) ;
+}

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageConsumerSynchronization.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageProducer.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageProducer.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageProducer.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageProducer.cpp Wed Jul  5 20:17:58 2006
@@ -1,179 +1,179 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/MessageProducer.hpp"
-#include "activemq/Session.hpp"
-
-using namespace apache::activemq;
-
-
-// Constructors -----------------------------------------------------
-
-/*
- * 
- */
-MessageProducer::MessageProducer(p<Session> session, p<ProducerInfo> producerInfo)
-{
-    this->session                 = session ;
-    this->producerInfo            = producerInfo ;
-    this->priority                = DEFAULT_PRIORITY ;
-    this->timeToLive              = DEFAULT_TIMETOLIVE ;
-    this->messageCounter          = 0 ;
-    this->persistent              = false ;
-    this->disableMessageID        = false ;
-    this->disableMessageTimestamp = false ;
-    this->closed                  = false ;
-}
-
-/*
- * 
- */
-MessageProducer::~MessageProducer()
-{
-    // Make sure the producer is closed
-    close() ;
-}
-
-
-// Attribute methods ------------------------------------------------
-
-bool MessageProducer::getPersistent()
-{
-    return persistent ;
-}
-
-void MessageProducer::setPersistent(bool persistent)
-{
-    this->persistent = persistent ;
-}
-
-long long MessageProducer::getTimeToLive()
-{
-    return timeToLive ;
-}
-
-void MessageProducer::getTimeToLive(long long ttl)
-{
-    this->timeToLive = ttl ;
-}
-
-int MessageProducer::getPriority()
-{
-    return priority ;
-}
-
-void MessageProducer::getPriority(int priority)
-{
-    this->priority = priority ;
-}
-
-bool MessageProducer::getDisableMessageID()
-{
-    return disableMessageID ;
-}
-
-void MessageProducer::getDisableMessageID(bool disable)
-{
-    this->disableMessageID = disable ;
-}
-
-bool MessageProducer::getDisableMessageTimestamp()
-{
-    return disableMessageTimestamp ;
-}
-
-void MessageProducer::getDisableMessageTimestamp(bool disable)
-{
-    this->disableMessageTimestamp = disable ;
-}
-
-
-// Operation methods ------------------------------------------------
-
-/*
- * 
- */
-void MessageProducer::send(p<IMessage> message)
-{
-    send(producerInfo->getDestination(), message, DEFAULT_PRIORITY, DEFAULT_TIMETOLIVE) ;
-}
-
-/*
- * 
- */
-void MessageProducer::send(p<IDestination> destination, p<IMessage> message)
-{
-    send(destination, message, DEFAULT_PRIORITY, DEFAULT_TIMETOLIVE) ;
-}
-
-/*
- * 
- */
-void MessageProducer::send(p<IDestination> destination, p<IMessage> message, char priority, long long timeToLive)
-{
-    p<MessageId> msgId = new MessageId() ;
-    msgId->setProducerId( producerInfo->getProducerId() ) ;
-
-    // Acquire next sequence id
-    {
-        LOCKED_SCOPE (mutex);
-        msgId->setProducerSequenceId( ++messageCounter ) ;
-    }
-
-    // Configure the message
-    p<ActiveMQMessage> activeMessage = p_dyncast<ActiveMQMessage> (message) ;
-    activeMessage->setMessageId( msgId ) ;
-    activeMessage->setProducerId( producerInfo->getProducerId() ) ;
-    activeMessage->setDestination( p_dyncast<ActiveMQDestination> (destination) ) ;
-    activeMessage->setPriority(priority) ;
-
-    if( session->isTransacted() )
-    {
-        session->doStartTransaction() ;
-        activeMessage->setTransactionId( session->getTransactionContext()->getTransactionId() ) ;
-    }
-
-    // Set time values if not disabled
-    if( !this->disableMessageTimestamp )
-    {
-        long long timestamp = Time::getCurrentTimeMillis() ;
-
-        // Set message time stamp/expiration
-        activeMessage->setTimestamp(timestamp) ;
-        if( timeToLive > 0 )
-            activeMessage->setExpiration( timestamp + timeToLive ) ;
-    }
-
-    // Finally, transmit the message
-    session->doSend(destination, message) ;
-}
-
-/*
- * 
- */
-void MessageProducer::close()
-{
-    if( !closed )
-    {
-        closed = true ;
-    
-        // De-register producer from broker
-        session->getConnection()->disposeOf( producerInfo->getProducerId() ) ;
-
-        // Reset internal state (prevent cyclic references)
-        session = NULL ;
-    }
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/MessageProducer.hpp"
+#include "activemq/Session.hpp"
+
+using namespace apache::activemq;
+
+
+// Constructors -----------------------------------------------------
+
+/*
+ * 
+ */
+MessageProducer::MessageProducer(p<Session> session, p<ProducerInfo> producerInfo)
+{
+    this->session                 = session ;
+    this->producerInfo            = producerInfo ;
+    this->priority                = DEFAULT_PRIORITY ;
+    this->timeToLive              = DEFAULT_TIMETOLIVE ;
+    this->messageCounter          = 0 ;
+    this->persistent              = false ;
+    this->disableMessageID        = false ;
+    this->disableMessageTimestamp = false ;
+    this->closed                  = false ;
+}
+
+/*
+ * 
+ */
+MessageProducer::~MessageProducer()
+{
+    // Make sure the producer is closed
+    close() ;
+}
+
+
+// Attribute methods ------------------------------------------------
+
+bool MessageProducer::getPersistent()
+{
+    return persistent ;
+}
+
+void MessageProducer::setPersistent(bool persistent)
+{
+    this->persistent = persistent ;
+}
+
+long long MessageProducer::getTimeToLive()
+{
+    return timeToLive ;
+}
+
+void MessageProducer::getTimeToLive(long long ttl)
+{
+    this->timeToLive = ttl ;
+}
+
+int MessageProducer::getPriority()
+{
+    return priority ;
+}
+
+void MessageProducer::getPriority(int priority)
+{
+    this->priority = priority ;
+}
+
+bool MessageProducer::getDisableMessageID()
+{
+    return disableMessageID ;
+}
+
+void MessageProducer::getDisableMessageID(bool disable)
+{
+    this->disableMessageID = disable ;
+}
+
+bool MessageProducer::getDisableMessageTimestamp()
+{
+    return disableMessageTimestamp ;
+}
+
+void MessageProducer::getDisableMessageTimestamp(bool disable)
+{
+    this->disableMessageTimestamp = disable ;
+}
+
+
+// Operation methods ------------------------------------------------
+
+/*
+ * 
+ */
+void MessageProducer::send(p<IMessage> message)
+{
+    send(producerInfo->getDestination(), message, DEFAULT_PRIORITY, DEFAULT_TIMETOLIVE) ;
+}
+
+/*
+ * 
+ */
+void MessageProducer::send(p<IDestination> destination, p<IMessage> message)
+{
+    send(destination, message, DEFAULT_PRIORITY, DEFAULT_TIMETOLIVE) ;
+}
+
+/*
+ * 
+ */
+void MessageProducer::send(p<IDestination> destination, p<IMessage> message, char priority, long long timeToLive)
+{
+    p<MessageId> msgId = new MessageId() ;
+    msgId->setProducerId( producerInfo->getProducerId() ) ;
+
+    // Acquire next sequence id
+    {
+        LOCKED_SCOPE (mutex);
+        msgId->setProducerSequenceId( ++messageCounter ) ;
+    }
+
+    // Configure the message
+    p<ActiveMQMessage> activeMessage = p_dyncast<ActiveMQMessage> (message) ;
+    activeMessage->setMessageId( msgId ) ;
+    activeMessage->setProducerId( producerInfo->getProducerId() ) ;
+    activeMessage->setDestination( p_dyncast<ActiveMQDestination> (destination) ) ;
+    activeMessage->setPriority(priority) ;
+
+    if( session->isTransacted() )
+    {
+        session->doStartTransaction() ;
+        activeMessage->setTransactionId( session->getTransactionContext()->getTransactionId() ) ;
+    }
+
+    // Set time values if not disabled
+    if( !this->disableMessageTimestamp )
+    {
+        long long timestamp = Time::getCurrentTimeMillis() ;
+
+        // Set message time stamp/expiration
+        activeMessage->setTimestamp(timestamp) ;
+        if( timeToLive > 0 )
+            activeMessage->setExpiration( timestamp + timeToLive ) ;
+    }
+
+    // Finally, transmit the message
+    session->doSend(destination, message) ;
+}
+
+/*
+ * 
+ */
+void MessageProducer::close()
+{
+    if( !closed )
+    {
+        closed = true ;
+    
+        // De-register producer from broker
+        session->getConnection()->disposeOf( producerInfo->getProducerId() ) ;
+
+        // Reset internal state (prevent cyclic references)
+        session = NULL ;
+    }
+}

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageProducer.cpp
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message