activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r732499 - in /activemq/activemq-cpp/trunk/src: main/ main/activemq/library/ main/activemq/transport/ main/activemq/transport/correlator/ main/activemq/transport/filters/ main/activemq/transport/logging/ main/activemq/transport/mock/ main/ac...
Date Wed, 07 Jan 2009 21:15:32 GMT
Author: tabish
Date: Wed Jan  7 13:15:30 2009
New Revision: 732499

URL: http://svn.apache.org/viewvc?rev=732499&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-100

Some initial refactoring work that leads to V3 and addition of Failover.

Added:
    activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportRegistry.cpp   (with props)
    activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportRegistry.h   (with props)
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/   (props changed)
      - copied from r731754, activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/
    activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/
    activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.cpp   (contents, props changed)
      - copied, changed from r731754, activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransport.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.h   (contents, props changed)
      - copied, changed from r731754, activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransport.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransportFactory.cpp   (contents, props changed)
      - copied, changed from r731754, activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransportFactory.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransportFactory.h   (contents, props changed)
      - copied, changed from r731754, activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransportFactory.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/
    activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransport.cpp   (contents, props changed)
      - copied, changed from r731754, activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransport.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransport.h   (contents, props changed)
      - copied, changed from r731754, activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransport.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransportFactory.cpp   (contents, props changed)
      - copied, changed from r731754, activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransportFactory.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransportFactory.h   (contents, props changed)
      - copied, changed from r731754, activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransportFactory.h
    activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/   (props changed)
      - copied from r731754, activemq/activemq-cpp/trunk/src/test/activemq/transport/filters/
Removed:
    activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactoryMap.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactoryMap.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFactoryMapRegistrar.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/AsyncSendTransport.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/AsyncSendTransport.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/AsyncSendTransportFactory.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/AsyncSendTransportFactory.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/LoggingTransport.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/LoggingTransport.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/LoggingTransportFactory.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/LoggingTransportFactory.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/TcpTransport.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/TcpTransport.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/TcpTransportFactory.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/TcpTransportFactory.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/
    activemq/activemq-cpp/trunk/src/test/activemq/transport/TransportFactoryMapRegistrarTest.cpp
    activemq/activemq-cpp/trunk/src/test/activemq/transport/TransportFactoryMapRegistrarTest.h
    activemq/activemq-cpp/trunk/src/test/activemq/transport/TransportFactoryMapTest.cpp
    activemq/activemq-cpp/trunk/src/test/activemq/transport/TransportFactoryMapTest.h
    activemq/activemq-cpp/trunk/src/test/activemq/transport/filters/
Modified:
    activemq/activemq-cpp/trunk/src/main/Makefile.am
    activemq/activemq-cpp/trunk/src/main/activemq/library/ActiveMQCPP.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportBuilder.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/FutureResponse.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelatorFactory.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelatorFactory.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransportFactory.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransportFactory.h
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormatRegistry.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormatRegistry.h
    activemq/activemq-cpp/trunk/src/test/Makefile.am
    activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompConnectorTest.cpp
    activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompSessionManagerTest.cpp
    activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.cpp
    activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.cpp
    activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp
    activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.h
    activemq/activemq-cpp/trunk/src/test/testRegistry.cpp

Modified: activemq/activemq-cpp/trunk/src/main/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/Makefile.am?rev=732499&r1=732498&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/src/main/Makefile.am Wed Jan  7 13:15:30 2009
@@ -68,20 +68,18 @@
     activemq/connector/ConnectorFactoryMap.cpp \
     activemq/connector/BaseConnectorResource.cpp \
     activemq/transport/TransportBuilder.cpp \
-    activemq/transport/TransportFactoryMap.cpp \
     activemq/transport/TransportFilter.cpp \
+    activemq/transport/TransportRegistry.cpp \
     activemq/transport/IOTransportFactory.cpp \
     activemq/transport/IOTransport.cpp \
     activemq/transport/mock/MockTransport.cpp \
     activemq/transport/mock/MockTransportFactory.cpp \
-    activemq/transport/filters/ResponseCorrelator.cpp \
-    activemq/transport/filters/ResponseCorrelatorFactory.cpp \
-    activemq/transport/filters/AsyncSendTransport.cpp \
-    activemq/transport/filters/AsyncSendTransportFactory.cpp \
-    activemq/transport/filters/TcpTransport.cpp \
-    activemq/transport/filters/TcpTransportFactory.cpp \
-    activemq/transport/filters/LoggingTransport.cpp \
-    activemq/transport/filters/LoggingTransportFactory.cpp \
+    activemq/transport/correlator/ResponseCorrelator.cpp \
+    activemq/transport/correlator/ResponseCorrelatorFactory.cpp \
+    activemq/transport/tcp/TcpTransport.cpp \
+    activemq/transport/tcp/TcpTransportFactory.cpp \
+    activemq/transport/logging/LoggingTransport.cpp \
+    activemq/transport/logging/LoggingTransportFactory.cpp \
     activemq/wireformat/WireFormatRegistry.cpp \
     decaf/internal/DecafRuntime.cpp \
     decaf/internal/AprPool.cpp \
@@ -261,8 +259,7 @@
     activemq/transport/TransportFilter.h \
     activemq/transport/TransportFactory.h \
     activemq/transport/TransportExceptionListener.h \
-    activemq/transport/TransportFactoryMapRegistrar.h \
-    activemq/transport/TransportFactoryMap.h \
+    activemq/transport/TransportRegistry.cpp \
     activemq/transport/Response.h \
     activemq/transport/Command.h \
     activemq/transport/CommandListener.h \
@@ -273,15 +270,13 @@
     activemq/transport/IOTransport.h \
     activemq/transport/mock/MockTransport.h \
     activemq/transport/mock/MockTransportFactory.h \
-    activemq/transport/filters/FutureResponse.h \
-    activemq/transport/filters/ResponseCorrelator.h \
-    activemq/transport/filters/ResponseCorrelatorFactory.h \
-    activemq/transport/filters/AsyncSendTransport.h \
-    activemq/transport/filters/AsyncSendTransportFactory.h \
-    activemq/transport/filters/TcpTransport.h \
-    activemq/transport/filters/TcpTransportFactory.h \
-    activemq/transport/filters/LoggingTransport.h \
-    activemq/transport/filters/LoggingTransportFactory.h \
+    activemq/transport/correlator/FutureResponse.h \
+    activemq/transport/correlator/ResponseCorrelator.h \
+    activemq/transport/correlator/ResponseCorrelatorFactory.h \
+    activemq/transport/tcp/TcpTransport.h \
+    activemq/transport/tcp/TcpTransportFactory.h \
+    activemq/transport/logging/LoggingTransport.h \
+    activemq/transport/logging/LoggingTransportFactory.h \
     activemq/util/Config.h \
     activemq/util/ActiveMQProperties.h \
     activemq/util/LongSequenceGenerator.h \

Modified: activemq/activemq-cpp/trunk/src/main/activemq/library/ActiveMQCPP.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/library/ActiveMQCPP.cpp?rev=732499&r1=732498&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/library/ActiveMQCPP.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/library/ActiveMQCPP.cpp Wed Jan  7 13:15:30 2009
@@ -19,19 +19,24 @@
 
 #include <decaf/lang/Runtime.h>
 #include <activemq/wireformat/WireFormatRegistry.h>
+#include <activemq/transport/TransportRegistry.h>
 #include <activemq/connector/openwire/OpenWireFormatFactory.h>
 
 #include <activemq/transport/IOTransportFactory.h>
 #include <activemq/transport/mock/MockTransportFactory.h>
-#include <activemq/transport/filters/AsyncSendTransportFactory.h>
-#include <activemq/transport/filters/TcpTransportFactory.h>
-#include <activemq/transport/filters/LoggingTransportFactory.h>
-#include <activemq/transport/filters/ResponseCorrelatorFactory.h>
+#include <activemq/transport/tcp/TcpTransportFactory.h>
+#include <activemq/transport/logging/LoggingTransportFactory.h>
+#include <activemq/transport/correlator/ResponseCorrelatorFactory.h>
 #include <activemq/connector/stomp/StompConnectorFactory.h>
 #include <activemq/connector/openwire/OpenWireConnectorFactory.h>
 
 using namespace activemq;
 using namespace activemq::library;
+using namespace activemq::transport;
+using namespace activemq::transport::tcp;
+using namespace activemq::transport::correlator;
+using namespace activemq::transport::logging;
+using namespace activemq::transport::mock;
 using namespace activemq::wireformat;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -42,12 +47,6 @@
 
     connector::stomp::StompConnectorFactory::getInstance();
     connector::openwire::OpenWireConnectorFactory::getInstance();
-    transport::filters::TcpTransportFactory::getInstance();
-    transport::filters::AsyncSendTransportFactory::getInstance();
-    transport::filters::LoggingTransportFactory::getInstance();
-    transport::filters::ResponseCorrelatorFactory::getInstance();
-    transport::IOTransportFactory::getInstance();
-    transport::mock::MockTransportFactory::getInstance();
 
     // Register all WireFormats
     ActiveMQCPP::registerWireFormats();
@@ -75,4 +74,18 @@
 ////////////////////////////////////////////////////////////////////////////////
 void ActiveMQCPP::registerTransports() {
 
+    // Each of the internally implemented WireFormat's is registered here
+    // with the WireFormat Registry
+
+    TransportRegistry::getInstance().registerFactory(
+        "tcp", new TcpTransportFactory() );
+    TransportRegistry::getInstance().registerFactory(
+        "transport.logging.LoggingTransport", new LoggingTransportFactory() );
+    TransportRegistry::getInstance().registerFactory(
+        "transport.correlator.ResponseCorrelator", new ResponseCorrelatorFactory() );
+    TransportRegistry::getInstance().registerFactory(
+        "transport.IOTransport", new IOTransportFactory() );
+    TransportRegistry::getInstance().registerFactory(
+        "mock", new MockTransportFactory() );
+
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.cpp?rev=732499&r1=732498&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.cpp Wed Jan  7 13:15:30 2009
@@ -30,7 +30,7 @@
 Transport* IOTransportFactory::createTransport(
     const decaf::util::Properties& properties AMQCPP_UNUSED,
     Transport* next AMQCPP_UNUSED,
-    bool own AMQCPP_UNUSED ) 
+    bool own AMQCPP_UNUSED )
         throw ( activemq::exceptions::ActiveMQException ) {
 
     try{
@@ -41,13 +41,3 @@
     AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }
-
-////////////////////////////////////////////////////////////////////////////////
-TransportFactory& IOTransportFactory::getInstance() {
-
-    // Create the one and only instance of the registrar
-    static TransportFactoryMapRegistrar registrar(
-        "transport.IOTransport", new IOTransportFactory() );
-
-    return registrar.getFactory();
-}

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.h?rev=732499&r1=732498&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransportFactory.h Wed Jan  7 13:15:30 2009
@@ -21,7 +21,6 @@
 #include <activemq/util/Config.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <activemq/transport/TransportFactory.h>
-#include <activemq/transport/TransportFactoryMapRegistrar.h>
 
 namespace activemq{
 namespace transport{
@@ -31,10 +30,6 @@
      * read from input streams and write to output streams.
      */
     class AMQCPP_API IOTransportFactory : public TransportFactory {
-    private:
-
-        static TransportFactoryMapRegistrar registrar;
-
     public:
 
         virtual ~IOTransportFactory(){}
@@ -51,12 +46,6 @@
             Transport* next,
             bool own ) throw ( exceptions::ActiveMQException );
 
-        /**
-         * Returns a reference to this TransportFactory
-         * @returns TransportFactory Reference
-         */
-        static TransportFactory& getInstance();
-
     };
 
 }}

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportBuilder.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportBuilder.cpp?rev=732499&r1=732498&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportBuilder.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportBuilder.cpp Wed Jan  7 13:15:30 2009
@@ -19,7 +19,7 @@
 
 #include <decaf/util/StringTokenizer.h>
 #include <activemq/transport/TransportFactory.h>
-#include <activemq/transport/TransportFactoryMap.h>
+#include <activemq/transport/TransportRegistry.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <activemq/util/URISupport.h>
 
@@ -57,13 +57,13 @@
 
         // Create the Transport for response correlator
         transport = this->createTransport(
-            "transport.filters.ResponseCorrelator", properties, transport );
+            "transport.correlator.ResponseCorrelator", properties, transport );
 
         // If command tracing was enabled, wrap the transport with a logging transport.
         if( properties.getProperty( "transport.commandTracingEnabled", "false" ) == "true" ) {
             // Create the Transport for response correlator
             transport = this->createTransport(
-                "transport.filters.LoggingTransport", properties, transport );
+                "transport.logging.LoggingTransport", properties, transport );
         }
 
         return transport;
@@ -83,7 +83,7 @@
 
         // Create the Transport that the Connector will use.
         TransportFactory* factory =
-            TransportFactoryMap::getInstance().lookup( name );
+            TransportRegistry::getInstance().findFactory( name );
 
         if( factory == NULL ){
             throw ActiveMQException(

Added: activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportRegistry.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportRegistry.cpp?rev=732499&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportRegistry.cpp (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportRegistry.cpp Wed Jan  7 13:15:30 2009
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 "TransportRegistry.h"
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::transport;
+using namespace decaf;
+using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
+
+////////////////////////////////////////////////////////////////////////////////
+TransportRegistry::TransportRegistry() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TransportRegistry::~TransportRegistry() {
+
+    std::vector<TransportFactory*> factories = this->registry.getValues();
+
+    std::vector<TransportFactory*>::iterator iter = factories.begin();
+
+    for( ; iter != factories.end(); ++iter ) {
+        delete *iter;
+    }
+
+    this->registry.clear();
+ }
+
+////////////////////////////////////////////////////////////////////////////////
+TransportFactory* TransportRegistry::findFactory( const std::string& name ) const
+    throw( decaf::lang::exceptions::NoSuchElementException ) {
+
+    if( !this->registry.containsKey( name ) ) {
+        throw NoSuchElementException( __FILE__, __LINE__,
+            "No Matching Factory Registered for format := %s", name.c_str() );
+    }
+
+    return this->registry.getValue( name );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void TransportRegistry::registerFactory( const std::string& name, TransportFactory* factory )
+    throw( decaf::lang::exceptions::IllegalArgumentException,
+           decaf::lang::exceptions::NullPointerException ) {
+
+    if( name == "" ) {
+        throw IllegalArgumentException( __FILE__, __LINE__,
+            "TransportFactory name cannot be the empty string" );
+    }
+
+    if( factory == NULL ) {
+        throw NullPointerException( __FILE__, __LINE__,
+            "Supplied TransportFactory pointer was NULL" );
+    }
+
+    this->registry.setValue( name, factory );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void TransportRegistry::unregisterFactory( const std::string& name ) {
+    if( this->registry.containsKey( name ) ) {
+        delete this->registry.getValue( name );
+        this->registry.remove( name );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::vector<std::string> TransportRegistry::getTransportNames() const {
+    return this->registry.getKeys();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TransportRegistry& TransportRegistry::getInstance() {
+    static TransportRegistry registry;
+    return registry;
+}

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportRegistry.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportRegistry.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportRegistry.h?rev=732499&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportRegistry.h (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportRegistry.h Wed Jan  7 13:15:30 2009
@@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ACTIVEMQ_TRANSPORT_TRANSPORTREGISTRY_H_
+#define _ACTIVEMQ_TRANSPORT_TRANSPORTREGISTRY_H_
+
+#include <activemq/util/Config.h>
+
+#include <string>
+#include <vector>
+#include <activemq/transport/TransportFactory.h>
+
+#include <decaf/util/Map.h>
+#include <decaf/lang/exceptions/NoSuchElementException.h>
+#include <decaf/lang/exceptions/NullPointerException.h>
+#include <decaf/lang/exceptions/IllegalArgumentException.h>
+
+namespace activemq {
+namespace transport {
+
+    /**
+     * Registry of all Transport Factories that are available to the client
+     * at runtime.  New Transport's must have a factory registered here before
+     * a connection attempt is made.
+     *
+     * @since 3.0
+     */
+    class AMQCPP_API TransportRegistry {
+    private:
+
+        decaf::util::Map<std::string, TransportFactory*> registry;
+
+    private:
+
+        // Hidden Constructor, prevents instantiation
+        TransportRegistry();
+
+        // Hidden Copy Constructor
+        TransportRegistry( const TransportRegistry& registry );
+
+        // Hidden Assignment operator
+        TransportRegistry& operator=( const TransportRegistry& registry );
+
+    public:
+
+        virtual ~TransportRegistry();
+
+        /**
+         * Gets a Registered TransportFactory from the Registry and returns it
+         * if there is not a registered format factory with the given name an exception
+         * is thrown.
+         *
+         * @param name
+         *        The name of the Factory to find in the Registry.
+         *
+         * @returns the Factory registered under the given name.
+         *
+         * @throws NoSuchElementException if no factory is registered with that name.
+         */
+        TransportFactory* findFactory( const std::string& name ) const
+            throw( decaf::lang::exceptions::NoSuchElementException );
+
+        /**
+         * Registers a new TransportFactory with this Registry.  If a Factory with the
+         * given name is already registered it is overwritten with the new one.  Once a
+         * factory is added to the Registry its lifetime is controlled by the Registry, it
+         * will be deleted once the Registry has been deleted.
+         *
+         * @param name
+         *        The name of the new Factory to register.
+         * @param factory
+         *        The new Factory to add to the Registry.
+         *
+         * @throws IllegalArgumentException is name is the empty string.
+         * @throws NullPointerException if the Factory is Null.
+         */
+        void registerFactory( const std::string& name, TransportFactory* factory )
+            throw( decaf::lang::exceptions::IllegalArgumentException,
+                   decaf::lang::exceptions::NullPointerException );
+
+        /**
+         * Unregisters the Factory with the given name and deletes that instance of the
+         * Factory.
+         *
+         * @param name
+         *        Name of the Factory to unregister and destroy
+         */
+        void unregisterFactory( const std::string& name );
+
+        /**
+         * Retrieves a list of the names of all the Registered Transport's in this
+         * Registry.
+         *
+         * @returns stl vector of strings with all the Transport names registered.
+         */
+        std::vector<std::string> getTransportNames() const;
+
+        /**
+         * Gets the single instance of the TransportRegistry
+         * @return reference to the single instance of this Registry
+         */
+        static TransportRegistry& getInstance();
+
+    };
+
+}}
+
+#endif /* _ACTIVEMQ_TRANSPORT_TRANSPORTREGISTRY_H_ */

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportRegistry.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/FutureResponse.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/FutureResponse.h?rev=732499&r1=731754&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/FutureResponse.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/FutureResponse.h Wed Jan  7 13:15:30 2009
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_TRANSPORT_FILTERS_FUTURERESPONSE_H_
-#define ACTIVEMQ_TRANSPORT_FILTERS_FUTURERESPONSE_H_
+#ifndef _ACTIVEMQ_TRANSPORT_CORRELATOR_FUTURERESPONSE_H_
+#define _ACTIVEMQ_TRANSPORT_CORRELATOR_FUTURERESPONSE_H_
 
 #include <activemq/util/Config.h>
 #include <decaf/util/concurrent/Mutex.h>
@@ -27,7 +27,7 @@
 
 namespace activemq{
 namespace transport{
-namespace filters{
+namespace correlator{
 
     /**
      * A container that holds a response object.  Callers of the getResponse
@@ -88,4 +88,4 @@
 
 }}}
 
-#endif /*ACTIVEMQ_TRANSPORT_FILTERS_FUTURERESPONSE_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_CORRELATOR_FUTURERESPONSE_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.cpp?rev=732499&r1=731754&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.cpp Wed Jan  7 13:15:30 2009
@@ -19,7 +19,7 @@
 
 using namespace activemq;
 using namespace activemq::transport;
-using namespace activemq::transport::filters;
+using namespace activemq::transport::correlator;
 using namespace activemq::exceptions;
 using namespace decaf::lang;
 using namespace decaf::lang::exceptions;

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.h?rev=732499&r1=731754&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.h Wed Jan  7 13:15:30 2009
@@ -15,12 +15,12 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_TRANSPORT_FILTERS_RESPONSECORRELATOR_H_
-#define ACTIVEMQ_TRANSPORT_FILTERS_RESPONSECORRELATOR_H_
+#ifndef _ACTIVEMQ_TRANSPORT_CORRELATOR_RESPONSECORRELATOR_H_
+#define _ACTIVEMQ_TRANSPORT_CORRELATOR_RESPONSECORRELATOR_H_
 
 #include <activemq/util/Config.h>
 #include <activemq/transport/TransportFilter.h>
-#include <activemq/transport/filters/FutureResponse.h>
+#include <activemq/transport/correlator/FutureResponse.h>
 #include <activemq/transport/Command.h>
 #include <decaf/util/concurrent/Mutex.h>
 #include <decaf/util/concurrent/Concurrent.h>
@@ -30,7 +30,7 @@
 
 namespace activemq{
 namespace transport{
-namespace filters{
+namespace correlator{
 
     /**
      * This type of transport filter is responsible for correlating
@@ -147,4 +147,4 @@
 
 }}}
 
-#endif /*ACTIVEMQ_TRANSPORT_FILTERS_RESPONSECORRELATOR_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_CORRELATOR_RESPONSECORRELATOR_H_*/

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelatorFactory.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelatorFactory.cpp?rev=732499&r1=731754&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelatorFactory.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelatorFactory.cpp Wed Jan  7 13:15:30 2009
@@ -17,28 +17,17 @@
 
 #include "ResponseCorrelatorFactory.h"
 
-#include <activemq/transport/filters/ResponseCorrelator.h>
+#include <activemq/transport/correlator/ResponseCorrelator.h>
 #include <decaf/lang/Long.h>
 
 using namespace activemq;
 using namespace activemq::transport;
-using namespace activemq::transport::filters;
+using namespace activemq::transport::correlator;
 using namespace activemq::exceptions;
 using namespace decaf::util;
 using namespace decaf::lang;
 
 ////////////////////////////////////////////////////////////////////////////////
-TransportFactory& ResponseCorrelatorFactory::getInstance()
-{
-    // Create the one and only instance of the registrar
-    static TransportFactoryMapRegistrar registrar(
-        "transport.filters.ResponseCorrelator",
-        new ResponseCorrelatorFactory() );
-
-    return registrar.getFactory();
-}
-
-////////////////////////////////////////////////////////////////////////////////
 Transport* ResponseCorrelatorFactory::createTransport(
     const decaf::util::Properties& properties AMQCPP_UNUSED,
     Transport* next,

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelatorFactory.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelatorFactory.h?rev=732499&r1=731754&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelatorFactory.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelatorFactory.h Wed Jan  7 13:15:30 2009
@@ -15,17 +15,16 @@
  * limitations under the License.
  */
 
-#ifndef _ACTIVEMQ_TRANSPORT_FILTERS_RESPONSECORRELATORFACTORY_H_
-#define _ACTIVEMQ_TRANSPORT_FILTERS_RESPONSECORRELATORFACTORY_H_
+#ifndef _ACTIVEMQ_TRANSPORT_CORRELATOR_RESPONSECORRELATORFACTORY_H_
+#define _ACTIVEMQ_TRANSPORT_CORRELATOR_RESPONSECORRELATORFACTORY_H_
 
 #include <activemq/util/Config.h>
 #include <activemq/transport/TransportFactory.h>
-#include <activemq/transport/TransportFactoryMapRegistrar.h>
 #include <activemq/exceptions/ActiveMQException.h>
 
 namespace activemq{
 namespace transport{
-namespace filters{
+namespace correlator{
 
     /**
      * Factory Responsible for creating the ResponseCorrelator.
@@ -47,14 +46,8 @@
             Transport* next,
             bool own ) throw ( exceptions::ActiveMQException );
 
-        /**
-         * Returns a reference to this TransportFactory
-         * @returns TransportFactory Reference
-         */
-        static TransportFactory& getInstance();
-
     };
 
 }}}
 
-#endif /*_ACTIVEMQ_TRANSPORT_FILTERS_RESPONSECORRELATORFACTORY_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_CORRELATOR_RESPONSECORRELATORFACTORY_H_*/

Copied: activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.cpp (from r731754, activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransport.cpp)
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.cpp?p2=activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.cpp&p1=activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransport.cpp&r1=731754&r2=732499&rev=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransport.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.cpp Wed Jan  7 13:15:30 2009
@@ -21,7 +21,7 @@
 using namespace activemq;
 using namespace activemq::exceptions;
 using namespace activemq::transport;
-using namespace activemq::transport::filters;
+using namespace activemq::transport::logging;
 using namespace decaf::lang;
 using namespace decaf::lang::exceptions;
 

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.cpp
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.h (from r731754, activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransport.h)
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.h?p2=activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.h&p1=activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransport.h&r1=731754&r2=732499&rev=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransport.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.h Wed Jan  7 13:15:30 2009
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_TRANSPORT_FILTERS_LOGGINGTRANSPORT_H_
-#define ACTIVEMQ_TRANSPORT_FILTERS_LOGGINGTRANSPORT_H_
+#ifndef _ACTIVEMQ_TRANSPORT_LOGGING_LOGGINGTRANSPORT_H_
+#define _ACTIVEMQ_TRANSPORT_LOGGING_LOGGINGTRANSPORT_H_
 
 #include <activemq/util/Config.h>
 #include <activemq/transport/TransportFilter.h>
@@ -24,7 +24,7 @@
 
 namespace activemq{
 namespace transport{
-namespace filters{
+namespace logging{
 
     /**
      * A transport filter that logs commands as they are sent/received.
@@ -87,4 +87,4 @@
 
 }}}
 
-#endif /*ACTIVEMQ_TRANSPORT_FILTERS_LOGGINGTRANSPORT_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_LOGGING_LOGGINGTRANSPORT_H_*/

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.h
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransportFactory.cpp (from r731754, activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransportFactory.cpp)
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransportFactory.cpp?p2=activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransportFactory.cpp&p1=activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransportFactory.cpp&r1=731754&r2=732499&rev=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransportFactory.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransportFactory.cpp Wed Jan  7 13:15:30 2009
@@ -17,26 +17,15 @@
 
 #include "LoggingTransportFactory.h"
 
-#include <activemq/transport/filters/LoggingTransport.h>
+#include <activemq/transport/logging/LoggingTransport.h>
 
 using namespace decaf::lang;
 using namespace activemq;
 using namespace activemq::transport;
-using namespace activemq::transport::filters;
+using namespace activemq::transport::logging;
 using namespace activemq::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
-TransportFactory& LoggingTransportFactory::getInstance() {
-
-    // Create the one and only instance of the registrar
-    static TransportFactoryMapRegistrar registrar(
-        "transport.filters.LoggingTransport",
-        new LoggingTransportFactory() );
-
-    return registrar.getFactory();
-}
-
-////////////////////////////////////////////////////////////////////////////////
 Transport* LoggingTransportFactory::createTransport(
     const decaf::util::Properties& properties AMQCPP_UNUSED,
     Transport* next,

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransportFactory.cpp
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransportFactory.h (from r731754, activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransportFactory.h)
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransportFactory.h?p2=activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransportFactory.h&p1=activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransportFactory.h&r1=731754&r2=732499&rev=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/LoggingTransportFactory.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransportFactory.h Wed Jan  7 13:15:30 2009
@@ -15,17 +15,16 @@
  * limitations under the License.
  */
 
-#ifndef _ACTIVEMQ_TRANSPORT_FILTERS_LOGGINGTRANSPORTFACTORY_H_
-#define _ACTIVEMQ_TRANSPORT_FILTERS_LOGGINGTRANSPORTFACTORY_H_
+#ifndef _ACTIVEMQ_TRANSPORT_LOGGING_LOGGINGTRANSPORTFACTORY_H_
+#define _ACTIVEMQ_TRANSPORT_LOGGING_LOGGINGTRANSPORTFACTORY_H_
 
 #include <activemq/util/Config.h>
 #include <activemq/transport/TransportFactory.h>
-#include <activemq/transport/TransportFactoryMapRegistrar.h>
 #include <activemq/exceptions/ActiveMQException.h>
 
 namespace activemq{
 namespace transport{
-namespace filters{
+namespace logging{
 
     /**
      * Factory Responsible for creating the LoggingTransport.
@@ -47,14 +46,8 @@
             Transport* next,
             bool own ) throw ( exceptions::ActiveMQException );
 
-        /**
-         * Returns a reference to this TransportFactory
-         * @returns TransportFactory Reference
-         */
-        static TransportFactory& getInstance();
-
     };
 
 }}}
 
-#endif /*_ACTIVEMQ_TRANSPORT_FILTERS_LOGGINGTRANSPORTFACTORY_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_LOGGING_LOGGINGTRANSPORTFACTORY_H_*/

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransportFactory.h
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransportFactory.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransportFactory.cpp?rev=732499&r1=732498&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransportFactory.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransportFactory.cpp Wed Jan  7 13:15:30 2009
@@ -21,7 +21,6 @@
 #include <activemq/transport/Transport.h>
 #include <activemq/transport/mock/MockTransport.h>
 #include <activemq/transport/mock/MockTransportFactory.h>
-#include <activemq/transport/TransportFactoryMapRegistrar.h>
 
 using namespace activemq;
 using namespace activemq::transport;
@@ -60,13 +59,3 @@
     AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }
-
-////////////////////////////////////////////////////////////////////////////////
-TransportFactory& MockTransportFactory::getInstance() {
-
-    // Create the one and only instance of the registrar
-    static TransportFactoryMapRegistrar registrar(
-        "mock", new MockTransportFactory() );
-
-    return registrar.getFactory();
-}

Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransportFactory.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransportFactory.h?rev=732499&r1=732498&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransportFactory.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransportFactory.h Wed Jan  7 13:15:30 2009
@@ -43,12 +43,6 @@
             Transport* next = NULL,
             bool own = true ) throw ( exceptions::ActiveMQException );
 
-        /**
-         * Returns a reference to this TransportFactory
-         * @returns TransportFactory Reference
-         */
-        static TransportFactory& getInstance();
-
     };
 
 }}}

Copied: activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransport.cpp (from r731754, activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransport.cpp)
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransport.cpp?p2=activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransport.cpp&p1=activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransport.cpp&r1=731754&r2=732499&rev=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransport.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransport.cpp Wed Jan  7 13:15:30 2009
@@ -20,13 +20,12 @@
 #include <decaf/net/SocketFactory.h>
 #include <activemq/transport/IOTransport.h>
 #include <activemq/transport/TransportFactory.h>
-#include <activemq/transport/TransportFactoryMap.h>
 
 using namespace std;
 using namespace activemq;
 using namespace activemq::io;
 using namespace activemq::transport;
-using namespace activemq::transport::filters;
+using namespace activemq::transport::tcp;
 using namespace activemq::exceptions;
 using namespace decaf::net;
 using namespace decaf::io;

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransport.cpp
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransport.h (from r731754, activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransport.h)
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransport.h?p2=activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransport.h&p1=activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransport.h&r1=731754&r2=732499&rev=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransport.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransport.h Wed Jan  7 13:15:30 2009
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef _ACTIVEMQ_TRANSPORT_FILTERS_TCPTRANSPORT_H_
-#define _ACTIVEMQ_TRANSPORT_FILTERS_TCPTRANSPORT_H_
+#ifndef _ACTIVEMQ_TRANSPORT_TCP_TCPTRANSPORT_H_
+#define _ACTIVEMQ_TRANSPORT_TCP_TCPTRANSPORT_H_
 
 #include <activemq/util/Config.h>
 #include <activemq/transport/TransportFilter.h>
@@ -29,7 +29,7 @@
 
 namespace activemq{
 namespace transport{
-namespace filters{
+namespace tcp{
 
     /**
      * Implements a TCP/IP based transport filter, this transport
@@ -75,4 +75,4 @@
 
 }}}
 
-#endif /*_ACTIVEMQ_TRANSPORT_FILTERS_TCPTRANSPORT_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_TCP_TCPTRANSPORT_H_*/

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransport.h
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransportFactory.cpp (from r731754, activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransportFactory.cpp)
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransportFactory.cpp?p2=activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransportFactory.cpp&p1=activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransportFactory.cpp&r1=731754&r2=732499&rev=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransportFactory.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransportFactory.cpp Wed Jan  7 13:15:30 2009
@@ -17,25 +17,15 @@
 
 #include "TcpTransportFactory.h"
 
-#include <activemq/transport/filters/TcpTransport.h>
+#include <activemq/transport/tcp/TcpTransport.h>
 
 using namespace activemq;
 using namespace activemq::transport;
-using namespace activemq::transport::filters;
+using namespace activemq::transport::tcp;
 using namespace activemq::exceptions;
 using namespace decaf::lang;
 
 ////////////////////////////////////////////////////////////////////////////////
-TransportFactory& TcpTransportFactory::getInstance()
-{
-    // Create the one and only instance of the registrar
-    static TransportFactoryMapRegistrar registrar(
-        "tcp", new TcpTransportFactory() );
-
-    return registrar.getFactory();
-}
-
-////////////////////////////////////////////////////////////////////////////////
 Transport* TcpTransportFactory::createTransport(
     const decaf::util::Properties& properties,
     Transport* next,

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransportFactory.cpp
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransportFactory.h (from r731754, activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransportFactory.h)
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransportFactory.h?p2=activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransportFactory.h&p1=activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransportFactory.h&r1=731754&r2=732499&rev=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/filters/TcpTransportFactory.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransportFactory.h Wed Jan  7 13:15:30 2009
@@ -15,18 +15,17 @@
  * limitations under the License.
  */
 
-#ifndef _ACTIVEMQ_TRANSPORT_FILTERS_TCPTRANSPORTFACTORY_H_
-#define _ACTIVEMQ_TRANSPORT_FILTERS_TCPTRANSPORTFACTORY_H_
+#ifndef _ACTIVEMQ_TRANSPORT_TCP_TCPTRANSPORTFACTORY_H_
+#define _ACTIVEMQ_TRANSPORT_TCP_TCPTRANSPORTFACTORY_H_
 
 #include <activemq/util/Config.h>
 #include <activemq/transport/TransportFactory.h>
-#include <activemq/transport/TransportFactoryMapRegistrar.h>
 #include <activemq/transport/IOTransportFactory.h>
 #include <activemq/exceptions/ActiveMQException.h>
 
 namespace activemq{
 namespace transport{
-namespace filters{
+namespace tcp{
 
     /**
      * Factory Responsible for creating the TcpTransport.
@@ -48,14 +47,8 @@
             Transport* next,
             bool own ) throw ( exceptions::ActiveMQException );
 
-        /**
-         * Returns a reference to this TransportFactory
-         * @returns TransportFactory Reference
-         */
-        static TransportFactory& getInstance();
-
     };
 
 }}}
 
-#endif /*_ACTIVEMQ_TRANSPORT_FILTERS_TCPTRANSPORTFACTORY_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_TCP_TCPTRANSPORTFACTORY_H_*/

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/transport/tcp/TcpTransportFactory.h
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormatRegistry.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormatRegistry.cpp?rev=732499&r1=732498&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormatRegistry.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormatRegistry.cpp Wed Jan  7 13:15:30 2009
@@ -30,10 +30,20 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 WireFormatRegistry::~WireFormatRegistry() {
-}
+
+    std::vector<WireFormatFactory*> factories = this->registry.getValues();
+
+    std::vector<WireFormatFactory*>::iterator iter = factories.begin();
+
+    for( ; iter != factories.end(); ++iter ) {
+        delete *iter;
+    }
+
+    this->registry.clear();
+ }
 
 ////////////////////////////////////////////////////////////////////////////////
-const WireFormatFactory* WireFormatRegistry::findFactory( const std::string& name ) const
+WireFormatFactory* WireFormatRegistry::findFactory( const std::string& name ) const
     throw( decaf::lang::exceptions::NoSuchElementException ) {
 
     if( !this->registry.containsKey( name ) ) {
@@ -63,6 +73,14 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+void WireFormatRegistry::unregisterFactory( const std::string& name ) {
+    if( this->registry.containsKey( name ) ) {
+        delete this->registry.getValue( name );
+        this->registry.remove( name );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
 std::vector<std::string> WireFormatRegistry::getWireFormatNames() const {
     return this->registry.getKeys();
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormatRegistry.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormatRegistry.h?rev=732499&r1=732498&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormatRegistry.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormatRegistry.h Wed Jan  7 13:15:30 2009
@@ -36,16 +36,27 @@
      * Registry of all WireFormat Factories that are available to the client
      * at runtime.  New WireFormat's must have a factory registered here before
      * a connection attempt is made.
+     *
+     * @since 3.0
      */
     class AMQCPP_API WireFormatRegistry {
     private:
 
         decaf::util::Map<std::string, WireFormatFactory*> registry;
 
-    public:
+    private:
 
+        // Hidden Constructor, prevents instantiation
         WireFormatRegistry();
 
+        // Hidden Copy Constructor
+        WireFormatRegistry( const WireFormatRegistry& registry );
+
+        // Hidden Assignment operator
+        WireFormatRegistry& operator=( const WireFormatRegistry& registry );
+
+    public:
+
         virtual ~WireFormatRegistry();
 
         /**
@@ -60,7 +71,7 @@
          *
          * @throws NoSuchElementException if no factory is registered with that name.
          */
-        const WireFormatFactory* findFactory( const std::string& name ) const
+        WireFormatFactory* findFactory( const std::string& name ) const
             throw( decaf::lang::exceptions::NoSuchElementException );
 
         /**
@@ -82,6 +93,15 @@
                    decaf::lang::exceptions::NullPointerException );
 
         /**
+         * Unregisters the Factory with the given name and deletes that instance of the
+         * Factory.
+         *
+         * @param name
+         *        Name of the Factory to unregister and destroy
+         */
+        void unregisterFactory( const std::string& name );
+
+        /**
          * Retrieves a list of the names of all the Registered WireFormat's in this
          * Registry.
          *

Modified: activemq/activemq-cpp/trunk/src/test/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/Makefile.am?rev=732499&r1=732498&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/src/test/Makefile.am Wed Jan  7 13:15:30 2009
@@ -68,9 +68,7 @@
   activemq/cmsutil/CmsTemplateTest.cpp \
   activemq/exceptions/ActiveMQExceptionTest.cpp \
   activemq/transport/IOTransportTest.cpp \
-  activemq/transport/filters/ResponseCorrelatorTest.cpp \
-  activemq/transport/TransportFactoryMapRegistrarTest.cpp \
-  activemq/transport/TransportFactoryMapTest.cpp \
+  activemq/transport/correlator/ResponseCorrelatorTest.cpp \
   activemq/util/PrimitiveValueNodeTest.cpp \
   activemq/util/PrimitiveListTest.cpp \
   activemq/util/PrimitiveMapTest.cpp \
@@ -188,9 +186,7 @@
   activemq/cmsutil/CmsTemplateTest.h \
   activemq/exceptions/ActiveMQExceptionTest.h \
   activemq/transport/IOTransportTest.h \
-  activemq/transport/filters/ResponseCorrelatorTest.h \
-  activemq/transport/TransportFactoryMapRegistrarTest.h \
-  activemq/transport/TransportFactoryMapTest.h \
+  activemq/transport/correlator/ResponseCorrelatorTest.h \
   activemq/util/PrimitiveValueNodeTest.h \
   activemq/util/PrimitiveListTest.h \
   activemq/util/PrimitiveMapTest.h \

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompConnectorTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompConnectorTest.cpp?rev=732499&r1=732498&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompConnectorTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompConnectorTest.cpp Wed Jan  7 13:15:30 2009
@@ -16,7 +16,7 @@
  */
 
 #include "StompConnectorTest.h"
-#include <activemq/transport/TransportFactoryMap.h>
+#include <activemq/transport/TransportRegistry.h>
 #include <decaf/lang/exceptions/UnsupportedOperationException.h>
 
 using namespace std;
@@ -289,7 +289,7 @@
     properties.setProperty( "client-id", connectionId );
 
     transport::TransportFactory* factory =
-        transport::TransportFactoryMap::getInstance().lookup( "mock" );
+        transport::TransportRegistry::getInstance().findFactory( "mock" );
     if( factory == NULL ){
         CPPUNIT_ASSERT( false );
     }

Modified: activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompSessionManagerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompSessionManagerTest.cpp?rev=732499&r1=732498&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompSessionManagerTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/connector/stomp/StompSessionManagerTest.cpp Wed Jan  7 13:15:30 2009
@@ -17,7 +17,7 @@
 
 #include "StompSessionManagerTest.h"
 
-#include <activemq/transport/TransportFactoryMap.h>
+#include <activemq/transport/TransportRegistry.h>
 
 using namespace activemq;
 using namespace activemq::transport;
@@ -337,7 +337,7 @@
     properties.setProperty( "client-id", connectionId );
 
     transport::TransportFactory* factory =
-        transport::TransportFactoryMap::getInstance().lookup( "mock" );
+        transport::TransportRegistry::getInstance().findFactory( "mock" );
     if( factory == NULL ){
         CPPUNIT_ASSERT( false );
     }

Modified: activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.cpp?rev=732499&r1=732498&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.cpp Wed Jan  7 13:15:30 2009
@@ -28,7 +28,7 @@
 #include <activemq/connector/stomp/StompConnector.h>
 #include <activemq/connector/openwire/OpenWireConnector.h>
 #include <activemq/transport/mock/MockTransportFactory.h>
-#include <activemq/transport/TransportFactoryMap.h>
+#include <activemq/transport/TransportRegistry.h>
 #include <activemq/connector/stomp/StompConsumerInfo.h>
 #include <activemq/connector/stomp/StompProducerInfo.h>
 #include <activemq/connector/stomp/StompTransactionInfo.h>
@@ -60,7 +60,7 @@
         properties->setProperty( "wireFormat", "stomp" );
 
         transport::TransportFactory* factory =
-            transport::TransportFactoryMap::getInstance().lookup( "mock" );
+            transport::TransportRegistry::getInstance().findFactory( "mock" );
         if( factory == NULL ){
             CPPUNIT_ASSERT( false );
         }
@@ -198,7 +198,7 @@
         properties->setProperty( "wireFormat", "stomp" );
 
         transport::TransportFactory* factory =
-            transport::TransportFactoryMap::getInstance().lookup( "mock" );
+            transport::TransportRegistry::getInstance().findFactory( "mock" );
         if( factory == NULL ){
             CPPUNIT_ASSERT( false );
         }
@@ -255,7 +255,7 @@
         properties->setProperty( "wireFormat", "openwire" );
 
         transport::TransportFactory* factory =
-            transport::TransportFactoryMap::getInstance().lookup( "mock" );
+            transport::TransportRegistry::getInstance().findFactory( "mock" );
         if( factory == NULL ){
             CPPUNIT_ASSERT( false );
         }

Modified: activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.cpp?rev=732499&r1=732498&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.cpp Wed Jan  7 13:15:30 2009
@@ -19,8 +19,7 @@
 
 #include <decaf/lang/Thread.h>
 #include <activemq/transport/mock/MockTransportFactory.h>
-#include <activemq/transport/TransportFactoryMap.h>
-#include <activemq/transport/TransportFactoryMapRegistrar.h>
+#include <activemq/transport/TransportRegistry.h>
 #include <activemq/connector/ConsumerInfo.h>
 #include <activemq/connector/stomp/StompConnector.h>
 #include <activemq/connector/stomp/StompConsumerInfo.h>

Propchange: activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp?rev=732499&r1=731754&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp Wed Jan  7 13:15:30 2009
@@ -19,7 +19,7 @@
 
 using namespace activemq;
 using namespace activemq::transport;
-using namespace activemq::transport::filters;
+using namespace activemq::transport::correlator;
 
 ////////////////////////////////////////////////////////////////////////////////
 void ResponseCorrelatorTest::testBasics(){
@@ -239,7 +239,7 @@
     narrowed = correlator.narrow( typeid( MyTransport ) );
     CPPUNIT_ASSERT( narrowed == &transport );
 
-    narrowed = correlator.narrow( typeid( transport::filters::ResponseCorrelator ) );
+    narrowed = correlator.narrow( typeid( transport::correlator::ResponseCorrelator ) );
     CPPUNIT_ASSERT( narrowed == &correlator );
 
     narrowed = correlator.narrow( typeid( correlator ) );

Modified: activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.h?rev=732499&r1=731754&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.h Wed Jan  7 13:15:30 2009
@@ -15,13 +15,13 @@
  * limitations under the License.
  */
 
-#ifndef ACTIVEMQ_TRANSPORT_FILTERS_RESPONSECORRELATORTEST_H_
-#define ACTIVEMQ_TRANSPORT_FILTERS_RESPONSECORRELATORTEST_H_
+#ifndef _ACTIVEMQ_TRANSPORT_CORRELATOR_RESPONSECORRELATORTEST_H_
+#define _ACTIVEMQ_TRANSPORT_CORRELATOR_RESPONSECORRELATORTEST_H_
 
 #include <cppunit/TestFixture.h>
 #include <cppunit/extensions/HelperMacros.h>
 
-#include <activemq/transport/filters/ResponseCorrelator.h>
+#include <activemq/transport/correlator/ResponseCorrelator.h>
 #include <decaf/lang/Thread.h>
 #include <decaf/util/concurrent/Concurrent.h>
 #include <decaf/lang/exceptions/UnsupportedOperationException.h>
@@ -30,7 +30,7 @@
 
 namespace activemq{
 namespace transport{
-namespace filters{
+namespace correlator{
 
     class ResponseCorrelatorTest : public CppUnit::TestFixture {
 
@@ -385,4 +385,4 @@
 
 }}}
 
-#endif /*ACTIVEMQ_TRANSPORT_FILTERS_RESPONSECORRELATORTEST_H_*/
+#endif /*_ACTIVEMQ_TRANSPORT_CORRELATOR_RESPONSECORRELATORTEST_H_*/

Modified: activemq/activemq-cpp/trunk/src/test/testRegistry.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/testRegistry.cpp?rev=732499&r1=732498&r2=732499&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/testRegistry.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/testRegistry.cpp Wed Jan  7 13:15:30 2009
@@ -128,15 +128,11 @@
 #include <activemq/core/ActiveMQSessionTest.h>
 CPPUNIT_TEST_SUITE_REGISTRATION( activemq::core::ActiveMQSessionTest );
 
-#include <activemq/transport/filters/ResponseCorrelatorTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::transport::filters::ResponseCorrelatorTest );
+#include <activemq/transport/correlator/ResponseCorrelatorTest.h>
+CPPUNIT_TEST_SUITE_REGISTRATION( activemq::transport::correlator::ResponseCorrelatorTest );
 
 #include <activemq/transport/IOTransportTest.h>
 CPPUNIT_TEST_SUITE_REGISTRATION( activemq::transport::IOTransportTest );
-#include <activemq/transport/TransportFactoryMapRegistrarTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::transport::TransportFactoryMapRegistrarTest );
-#include <activemq/transport/TransportFactoryMapTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::transport::TransportFactoryMapTest );
 
 #include <activemq/exceptions/ActiveMQExceptionTest.h>
 CPPUNIT_TEST_SUITE_REGISTRATION( activemq::exceptions::ActiveMQExceptionTest );



Mime
View raw message