activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmitt...@apache.org
Subject svn commit: r589358 [2/2] - in /activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq: exceptions/ network/ support/ transport/filters/
Date Sun, 28 Oct 2007 14:17:05 GMT
Modified: activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/network/TcpSocket.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/network/TcpSocket.h?rev=589358&r1=589357&r2=589358&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/network/TcpSocket.h
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/network/TcpSocket.h
Sun Oct 28 07:17:03 2007
@@ -24,71 +24,70 @@
 
 #include <activemq/util/Config.h>
 
-namespace activemq{
-namespace network{
+namespace activemq {
+namespace network {
 
     // Forward declarations
     class SocketInputStream;
     class SocketOutputStream;
-
+    
     /**
      * Platform-independent implementation of the socket interface.
      */
-    class TcpSocket : public Socket
-    {
+    class TcpSocket : public Socket {
     protected:
-
+    
         /**
          * The handle for this socket.
          */
-         SocketHandle socketHandle;
-
-         /**
-          * The input stream for reading this socket.
-          */
-         SocketInputStream* inputStream;
-
-         /**
-          * The output stream for writing to this socket.
-          */
-         SocketOutputStream* outputStream;
-
-	 /**
-	  * Create streams.
-	  */
-	 virtual void initialize () throw (SocketException);
-
+        SocketHandle socketHandle;
+    
+        /**
+         * The input stream for reading this socket.
+         */
+        SocketInputStream* inputStream;
+    
+        /**
+         * The output stream for writing to this socket.
+         */
+        SocketOutputStream* outputStream;
+    
+        /**
+         * Create streams.
+         */
+        virtual void initialize() throw (SocketException);
+    
     public:
-
+    
         /**
          * Construct a non-connected socket.
          * @throws SocketException thrown one windows if the static initialization
          * call to WSAStartup was not successful.
          */
         TcpSocket() throw (SocketException);
-
+    
         /**
          * Construct a connected or bound socket based on given
          * socket handle.
          * @param socketHandle a socket handle to wrap in the object
          */
-        TcpSocket( SocketHandle socketHandle );
-
+        TcpSocket(SocketHandle socketHandle);
+    
         /**
          * Destruct.
          * Releases the socket handle but not
          * gracefully shut down the connection.
          */
         virtual ~TcpSocket();
-
+    
         /**
          * Gets the handle for the socket.
          * @return SocketHabler for this Socket, can be NULL
          */
-        SocketHandle getSocketHandle () {
+        SocketHandle getSocketHandle() {
             return socketHandle;
         }
-
+    
         /**
          * Connects to the specified destination. Closes this socket if
          * connected to another destination.
@@ -96,167 +95,167 @@
          * @param port The port of the server to connect to.
          * @throws IOException Thrown if a failure occurred in the connect.
          */
-        virtual void connect( const char* host, int port ) throw( SocketException );
-
+        virtual void connect(const char* host, int port) throw(SocketException );
+    
         /**
          * Indicates whether or not this socket is connected to a destination.
          * @return true if connected
          */
-        virtual bool isConnected() const{
+        virtual bool isConnected() const {
             return socketHandle != INVALID_SOCKET_HANDLE;
         }
-
+    
         /**
          * Gets the InputStream for this socket.
          * @return The InputStream for this socket. NULL if not connected.
          */
         virtual io::InputStream* getInputStream();
-
+    
         /**
          * Gets the OutputStream for this socket.
          * @return the OutputStream for this socket.  NULL if not connected.
          */
         virtual io::OutputStream* getOutputStream();
-
+    
         /**
          * Gets the linger time.
          * @return The linger time in seconds.
          * @throws SocketException if the operation fails.
          */
-        virtual int getSoLinger() const throw( SocketException );
-
+        virtual int getSoLinger() const throw(SocketException );
+    
         /**
          * Sets the linger time.
          * @param linger The linger time in seconds.  If 0, linger is off.
          * @throws SocketException if the operation fails.
          */
-        virtual void setSoLinger( int linger ) throw( SocketException );
-
+        virtual void setSoLinger(int linger) throw(SocketException );
+    
         /**
          * Gets the keep alive flag.
          * @return True if keep alive is enabled.
          * @throws SocketException if the operation fails.
          */
-        virtual bool getKeepAlive() const throw( SocketException );
-
+        virtual bool getKeepAlive() const throw(SocketException );
+    
         /**
          * Enables/disables the keep alive flag.
          * @param keepAlive If true, enables the flag.
          * @throws SocketException if the operation fails.
          */
-        virtual void setKeepAlive( bool keepAlive ) throw( SocketException );
-
+        virtual void setKeepAlive(bool keepAlive) throw(SocketException );
+    
         /**
          * Gets the receive buffer size.
          * @return the receive buffer size in bytes.
          * @throws SocketException if the operation fails.
          */
-        virtual int getReceiveBufferSize() const throw( SocketException );
-
+        virtual int getReceiveBufferSize() const throw(SocketException );
+    
         /**
          * Sets the recieve buffer size.
          * @param size Number of bytes to set the receive buffer to.
          * @throws SocketException if the operation fails.
          */
-        virtual void setReceiveBufferSize( int size ) throw( SocketException );
-
+        virtual void setReceiveBufferSize(int size) throw(SocketException );
+    
         /**
          * Gets the reuse address flag.
          * @return True if the address can be reused.
          * @throws SocketException if the operation fails.
          */
-        virtual bool getReuseAddress() const throw( SocketException );
-
+        virtual bool getReuseAddress() const throw(SocketException );
+    
         /**
          * Sets the reuse address flag.
          * @param reuse If true, sets the flag.
          * @throws SocketException if the operation fails.
          */
-        virtual void setReuseAddress( bool reuse ) throw( SocketException );
-
+        virtual void setReuseAddress(bool reuse) throw(SocketException );
+    
         /**
          * Gets the send buffer size.
          * @return the size in bytes of the send buffer.
          * @throws SocketException if the operation fails.
          */
-        virtual int getSendBufferSize() const throw( SocketException );
-
+        virtual int getSendBufferSize() const throw(SocketException );
+    
         /**
          * Sets the send buffer size.
          * @param size The number of bytes to set the send buffer to.
          * @throws SocketException if the operation fails.
          */
-        virtual void setSendBufferSize( int size ) throw( SocketException );
-
+        virtual void setSendBufferSize(int size) throw(SocketException );
+    
         /**
          * Gets the timeout for socket operations.
          * @return The timeout in milliseconds for socket operations.
          * @throws SocketException Thrown if unable to retrieve the information.
          */
-        virtual int getSoTimeout() const throw( SocketException );
-
+        virtual int getSoTimeout() const throw(SocketException );
+    
         /**
          * Sets the timeout for socket operations.
          * @param timeout The timeout in milliseconds for socket operations.<p>
          * @throws SocketException Thrown if unable to set the information.
          */
-        virtual void setSoTimeout( int timeout ) throw(SocketException);
-
+        virtual void setSoTimeout(int timeout) throw(SocketException);
+    
         /**
          * Closes this object and deallocates the appropriate resources.
          * @throws CMSException
          */
-        virtual void close() throw( cms::CMSException );
-
+        virtual void close() throw(cms::CMSException );
+    
     public:
-
+    
         /**
          * Gets the Status of the TCP_NODELAY param for this socket as a Bool
          * @returns true if TCP_NODELAY is enabled
          * @throws CMSException
          */
-        virtual bool getTcpNoDelay() const throw ( cms::CMSException );
-
+        virtual bool getTcpNoDelay() const throw (cms::CMSException );
+    
         /**
          * Sets the Status of the TCP_NODELAY param for this socket as a Bool
          * @param value - true if TCP_NODELAY is to be enabled
          * @throws CMSException
          */
-        virtual void setTcpNoDelay( bool value ) throw ( cms::CMSException );
-
+        virtual void setTcpNoDelay(bool value) throw (cms::CMSException );
+    
     protected:
-
-        #if defined(HAVE_WINSOCK2_H)
-
-            // WINDOWS needs initialization of winsock
-            class StaticSocketInitializer {
-            private:
-
-                SocketException* socketInitError;
-
-                void clear(){
-                    if( socketInitError != NULL ){
-                        delete socketInitError;
-                    }
-                    socketInitError = NULL;
-                }
-
-            public:
-
-                SocketException* getSocketInitError() {
-                    return socketInitError;
+    
+    #if defined(HAVE_WINSOCK2_H)
+    
+        // WINDOWS needs initialization of winsock
+        class StaticSocketInitializer {
+        private:
+    
+            SocketException* socketInitError;
+    
+            void clear() {
+                if( socketInitError != NULL ) {
+                    delete socketInitError;
                 }
-
-                StaticSocketInitializer();
-                virtual ~StaticSocketInitializer();
-
-            };
-
-            static StaticSocketInitializer staticSocketInitializer;
-        #endif
-
-        void checkResult( int value ) const throw (SocketException);
-
+                socketInitError = NULL;
+            }
+    
+        public:
+    
+            SocketException* getSocketInitError() {
+                return socketInitError;
+            }
+    
+            StaticSocketInitializer();
+            virtual ~StaticSocketInitializer();
+    
+        };
+    
+        static StaticSocketInitializer staticSocketInitializer;
+    #endif
+    
+        void checkResult(int value) const throw (SocketException);
+    
     };
 
 }}

Modified: activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/network/TcpSocketFactory.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/network/TcpSocketFactory.cpp?rev=589358&r1=589357&r2=589358&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/network/TcpSocketFactory.cpp
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/network/TcpSocketFactory.cpp
Sun Oct 28 07:17:03 2007
@@ -27,18 +27,15 @@
 using namespace activemq::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
-Socket* TcpSocketFactory::createSocket(
-    const std::string& uri,
-    const Properties& properties)
-        throw ( SocketException )
-{
+Socket* TcpSocketFactory::createSocket(const std::string& uri,
+        const Properties& properties) throw (SocketException ) {
     try
     {
         // Ensure something is actually passed in for the URI
         if( uri == "" )
         {
             throw SocketException( __FILE__, __LINE__,
-                "SocketTransport::start() - uri not provided" );
+                    "SocketTransport::start() - uri not provided" );
         }
 
         string dummy = uri;
@@ -48,7 +45,7 @@
         if( portIx == string::npos )
         {
             throw SocketException( __FILE__, __LINE__,
-                "SocketTransport::start() - uri malformed - port not specified: %s", uri.c_str()
);
+                    "SocketTransport::start() - uri malformed - port not specified: %s",
uri.c_str() );
         }
         string host = dummy.substr( 0, portIx );
         string portString = dummy.substr( portIx + 1 );
@@ -56,7 +53,7 @@
         if( sscanf( portString.c_str(), "%d", &port) != 1 )
         {
             throw SocketException( __FILE__, __LINE__,
-               "SocketTransport::start() - unable to extract port from uri: %s", uri.c_str()
);
+                    "SocketTransport::start() - unable to extract port from uri: %s", uri.c_str()
);
         }
 
         // Get the read buffer size.
@@ -76,7 +73,7 @@
 
         // Get the keepAlive flag.
         bool soKeepAlive =
-            properties.getProperty( "soKeepAlive", "false" ) == "true";
+        properties.getProperty( "soKeepAlive", "false" ) == "true";
 
         // Get the socket receive buffer size.
         int soReceiveBufferSize = -1;
@@ -90,7 +87,7 @@
 
         // Get the socket TCP_NODELAY flag.
         bool tcpNoDelay =
-            properties.getProperty( "tcpNoDelay", "true" ) == "true";
+        properties.getProperty( "tcpNoDelay", "true" ) == "true";
 
         // Now that we have all the elements that we wanted - let's do it!
         // Create a TCP Socket and then Wrap it in a buffered socket
@@ -109,11 +106,11 @@
             tcpSocket->setKeepAlive( soKeepAlive );
             tcpSocket->setTcpNoDelay( tcpNoDelay );
 
-            if( soReceiveBufferSize > 0 ){
+            if( soReceiveBufferSize > 0 ) {
                 tcpSocket->setReceiveBufferSize( soReceiveBufferSize );
             }
 
-            if( soSendBufferSize > 0 ){
+            if( soSendBufferSize > 0 ) {
                 tcpSocket->setSendBufferSize( soSendBufferSize );
             }
 
@@ -121,9 +118,9 @@
         catch ( SocketException& ex )
         {
             ex.setMark( __FILE__, __LINE__ );
-            try{
+            try {
                 delete tcpSocket;
-            } catch( SocketException& ex2 ){ /* Absorb */ }
+            } catch( SocketException& ex2 ) { /* Absorb */}
 
             throw ex;
         }
@@ -135,9 +132,8 @@
     AMQ_CATCHALL_THROW( SocketException )
 }
 
-TcpSocket* TcpSocketFactory::createTcpSocket(
-    const util::Properties & )
-        throw ( SocketException )
-{
-  return new TcpSocket();
+///////////////////////////////////////////////////////////////////////////////
+TcpSocket* TcpSocketFactory::createTcpSocket(const util::Properties &)
+        throw (SocketException ) {
+    return new TcpSocket();
 }

Modified: activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/network/TcpSocketFactory.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/network/TcpSocketFactory.h?rev=589358&r1=589357&r2=589358&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/network/TcpSocketFactory.h
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/network/TcpSocketFactory.h
Sun Oct 28 07:17:03 2007
@@ -19,11 +19,11 @@
 
 #include <activemq/network/SocketFactory.h>
 
-namespace activemq{
-namespace network{
+namespace activemq {
+namespace network {
 
     class TcpSocket;
-
+    
     /**
      * Socket Factory implementation for use in Creating Sockets
      * <p>
@@ -41,14 +41,12 @@
      *
      * @see <code>Socket</code>
      */
-    class TcpSocketFactory : public SocketFactory
-    {
-	virtual TcpSocket* createTcpSocket(
-            const util::Properties &properties )
-	    throw ( SocketException );
-
+    class TcpSocketFactory : public SocketFactory {
+        virtual TcpSocket* createTcpSocket(const util::Properties &properties)
+                throw (SocketException );
+    
     public:
-
+    
         /**
          * Creates and returns a TcpSocket dervied Object based on the values
          * defined in the Properties Object that is passed in.
@@ -56,10 +54,9 @@
          * @param properties a IProperties pointer.
          * @throws SocketException.
          */
-        Socket* createSocket( const std::string& uri,
-			      const util::Properties& properties )
-            throw ( SocketException );
-
+        Socket* createSocket(const std::string& uri,
+                const util::Properties& properties) throw (SocketException );
+    
     };
 
 }}

Modified: activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/support/InitDirector.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/support/InitDirector.cpp?rev=589358&r1=589357&r2=589358&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/support/InitDirector.cpp
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/support/InitDirector.cpp
Sun Oct 28 07:17:03 2007
@@ -33,10 +33,8 @@
 int InitDirector::refCount;
 
 ////////////////////////////////////////////////////////////////////////////////
-InitDirector::InitDirector(void)
-{
-    if( refCount == 0 )
-    {
+InitDirector::InitDirector(void) {
+    if (refCount == 0) {
         logger::LogWriter::getInstance();
         connector::stomp::StompConnectorFactory::getInstance();
         connector::openwire::OpenWireConnectorFactory::getInstance();
@@ -53,11 +51,9 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-InitDirector::~InitDirector(void)
-{
+InitDirector::~InitDirector(void) {
     refCount--;
 
-    if( refCount == 0 )
-    {
+    if (refCount == 0) {
     }
 }

Modified: activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/SSLTransportFactory.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/SSLTransportFactory.cpp?rev=589358&r1=589357&r2=589358&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/SSLTransportFactory.cpp
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/SSLTransportFactory.cpp
Sun Oct 28 07:17:03 2007
@@ -25,23 +25,21 @@
 using namespace activemq::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
-TransportFactory& SSLTransportFactory::getInstance(void)
-{
+TransportFactory& SSLTransportFactory::getInstance(void) {
     // Create the one and only instance of the registrar
-    static TransportFactoryMapRegistrar registrar(
-        "ssl", new SSLTransportFactory() );
+    static TransportFactoryMapRegistrar registrar("ssl",
+            new SSLTransportFactory());
 
     return registrar.getFactory();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 Transport* SSLTransportFactory::createTransport(
-    const activemq::util::Properties& properties,
-    Transport* next,
-    bool own ) throw ( ActiveMQException ) {
+        const activemq::util::Properties& properties, Transport* next, bool own)
+        throw (ActiveMQException ) {
 
     try {
-	return new TcpTransport( sockets, properties, next, own );
+        return new TcpTransport( sockets, properties, next, own );
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )

Modified: activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/SSLTransportFactory.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/SSLTransportFactory.h?rev=589358&r1=589357&r2=589358&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/SSLTransportFactory.h
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/SSLTransportFactory.h
Sun Oct 28 07:17:03 2007
@@ -24,19 +24,19 @@
 #include <activemq/network/SSLSocketFactory.h>
 #include <activemq/exceptions/ActiveMQException.h>
 
-namespace activemq{
-namespace transport{
-namespace filters{
+namespace activemq {
+namespace transport {
+namespace filters {
 
     /**
      * Factory Responsible for creating the TcpTransport.
      */
-    class SSLTransportFactory : public TransportFactory
-    {
+    class SSLTransportFactory : public TransportFactory {
     public:
-
-        virtual ~SSLTransportFactory() {}
-
+    
+        virtual ~SSLTransportFactory() {
+        }
+    
         /**
          * Creates a Transport instance.
          * @param properties - Object that will hold transport config values
@@ -45,18 +45,18 @@
          * @throws ActiveMQException if an error occurs.
          */
         virtual Transport* createTransport(
-            const activemq::util::Properties& properties,
-            Transport* next,
-            bool own ) throw ( exceptions::ActiveMQException );
-
+                const activemq::util::Properties& properties, Transport* next,
+                bool own) throw (exceptions::ActiveMQException );
+    
         /**
          * Returns a reference to this TransportFactory
          * @returns TransportFactory Reference
          */
         static TransportFactory& getInstance();
-
+    
     private:
-	network::SSLSocketFactory sockets;
+        
+        network::SSLSocketFactory sockets;
     };
 
 }}}

Modified: activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/TcpTransport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/TcpTransport.cpp?rev=589358&r1=589357&r2=589358&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/TcpTransport.cpp
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/TcpTransport.cpp
Sun Oct 28 07:17:03 2007
@@ -31,41 +31,40 @@
 using namespace activemq::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
-TcpTransport::TcpTransport( network::TcpSocketFactory& factory,
-			    const activemq::util::Properties& properties,
-                            Transport* next,
-                            const bool own )
+TcpTransport::TcpTransport(network::TcpSocketFactory& factory,
+        const activemq::util::Properties& properties, Transport* next,
+        const bool own) 
 :
-    TransportFilter( next, own ),
-    socket( NULL ),
-    loggingInputStream( NULL ),
-    loggingOutputStream( NULL ),
-    bufferedInputStream( NULL ),
-    bufferedOutputStream( NULL )
-{
+    TransportFilter(next, own), 
+    socket(NULL), 
+    loggingInputStream(NULL),
+    loggingOutputStream(NULL), 
+    bufferedInputStream(NULL),
+    bufferedOutputStream(NULL) {
+    
     try
     {
         if( !properties.hasProperty( "transport.uri" ) ) {
             throw ActiveMQException(
-                __FILE__, __LINE__,
-                "TcpTransport::TcpTransport - "
-                "No URI set for this transport to connect to.");
+                    __FILE__, __LINE__,
+                    "TcpTransport::TcpTransport - "
+                    "No URI set for this transport to connect to.");
         }
 
         // Create the IO device we will be communicating over the
         // wire with.  This may need to change if we add more types
         // of sockets, such as SSL.
         socket = factory.createSocket(
-            properties.getProperty( "transport.uri" ), properties );
+                properties.getProperty( "transport.uri" ), properties );
 
         // Cast it to an IO transport so we can wire up the socket
         // input and output streams.
         IOTransport* ioTransport = dynamic_cast<IOTransport*>( next );
-        if( ioTransport == NULL ){
+        if( ioTransport == NULL ) {
             throw ActiveMQException(
-                __FILE__, __LINE__,
-                "TcpTransport::TcpTransport - "
-                "transport must be of type IOTransport");
+                    __FILE__, __LINE__,
+                    "TcpTransport::TcpTransport - "
+                    "transport must be of type IOTransport");
         }
 
         InputStream* inputStream = socket->getInputStream();
@@ -93,13 +92,12 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-TcpTransport::~TcpTransport()
-{
+TcpTransport::~TcpTransport() {
     try
     {
-        try{
+        try {
             close();
-        } catch( cms::CMSException& ex ){ /* Absorb */ }
+        } catch( cms::CMSException& ex ) { /* Absorb */}
 
         if( socket != NULL ) {
             delete socket;
@@ -131,7 +129,7 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void TcpTransport::close() throw( cms::CMSException ) {
+void TcpTransport::close() throw(cms::CMSException ) {
 
     try
     {

Modified: activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/TcpTransport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/TcpTransport.h?rev=589358&r1=589357&r2=589358&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/TcpTransport.h
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/TcpTransport.h
Sun Oct 28 07:17:03 2007
@@ -27,9 +27,9 @@
 #include <activemq/io/BufferedInputStream.h>
 #include <activemq/io/BufferedOutputStream.h>
 
-namespace activemq{
-namespace transport{
-namespace filters{
+namespace activemq {
+namespace transport {
+namespace filters {
 
     /**
      * Implements a TCP/IP based transport filter, this transport
@@ -37,42 +37,40 @@
      * level transport should take care of manaing stream reads
      * and writes.
      */
-    class TcpTransport : public TransportFilter
-    {
+    class TcpTransport : public TransportFilter {
     private:
-
+    
         /**
          * Socket that this Transport Communicates with
          */
         network::Socket* socket;
-
+    
         io::LoggingInputStream* loggingInputStream;
         io::LoggingOutputStream* loggingOutputStream;
-
+    
         io::BufferedInputStream* bufferedInputStream;
         io::BufferedOutputStream* bufferedOutputStream;
-
+    
     public:
-
+    
         /**
          * Constructor
          * @param properties the configuration properties for this transport
          * @param next the next transport in the chain
          * @param own indicates if this transport owns the next.
          */
-        TcpTransport( network::TcpSocketFactory& factory,
-		      const activemq::util::Properties& properties,
-                      Transport* next,
-                      const bool own = true );
-
+        TcpTransport(network::TcpSocketFactory& factory,
+                const activemq::util::Properties& properties, Transport* next,
+                const bool own = true);
+    
         virtual ~TcpTransport();
-
+    
         /**
          * Delegates to the superclass and then closes the socket.
          * @throws CMSException if errors occur.
          */
-        virtual void close() throw( cms::CMSException );
-
+        virtual void close() throw(cms::CMSException );
+    
     };
 
 }}}

Modified: activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/TcpTransportFactory.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/TcpTransportFactory.cpp?rev=589358&r1=589357&r2=589358&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/TcpTransportFactory.cpp
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/TcpTransportFactory.cpp
Sun Oct 28 07:17:03 2007
@@ -25,23 +25,22 @@
 using namespace activemq::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
-TransportFactory& TcpTransportFactory::getInstance(void)
-{
+TransportFactory& TcpTransportFactory::getInstance(void) {
+    
     // Create the one and only instance of the registrar
-    static TransportFactoryMapRegistrar registrar(
-        "tcp", new TcpTransportFactory() );
+    static TransportFactoryMapRegistrar registrar("tcp",
+            new TcpTransportFactory());
 
     return registrar.getFactory();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 Transport* TcpTransportFactory::createTransport(
-    const activemq::util::Properties& properties,
-    Transport* next,
-    bool own ) throw ( ActiveMQException ) {
+        const activemq::util::Properties& properties, Transport* next, bool own)
+        throw (ActiveMQException ) {
 
     try {
-	return new TcpTransport( sockets, properties, next, own );
+        return new TcpTransport( sockets, properties, next, own );
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )

Modified: activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/TcpTransportFactory.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/TcpTransportFactory.h?rev=589358&r1=589357&r2=589358&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/TcpTransportFactory.h
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-ssl/src/main/activemq/transport/filters/TcpTransportFactory.h
Sun Oct 28 07:17:03 2007
@@ -24,19 +24,19 @@
 #include <activemq/network/TcpSocketFactory.h>
 #include <activemq/exceptions/ActiveMQException.h>
 
-namespace activemq{
-namespace transport{
-namespace filters{
+namespace activemq {
+namespace transport {
+namespace filters {
 
     /**
      * Factory Responsible for creating the TcpTransport.
      */
-    class TcpTransportFactory : public TransportFactory
-    {
+    class TcpTransportFactory : public TransportFactory {
     public:
-
-        virtual ~TcpTransportFactory() {}
-
+    
+        virtual ~TcpTransportFactory() {
+        }
+    
         /**
          * Creates a Transport instance.
          * @param properties - Object that will hold transport config values
@@ -45,18 +45,17 @@
          * @throws ActiveMQException if an error occurs.
          */
         virtual Transport* createTransport(
-            const activemq::util::Properties& properties,
-            Transport* next,
-            bool own ) throw ( exceptions::ActiveMQException );
-
+                const activemq::util::Properties& properties, Transport* next,
+                bool own) throw (exceptions::ActiveMQException );
+    
         /**
          * Returns a reference to this TransportFactory
          * @returns TransportFactory Reference
          */
         static TransportFactory& getInstance();
-
+    
     private:
-	network::TcpSocketFactory sockets;
+        network::TcpSocketFactory sockets;
     };
 
 }}}



Mime
View raw message