You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2007/05/30 20:43:35 UTC
svn commit: r542904 [1/2] - in /activemq/activemq-cpp/trunk/src/main/decaf:
io/ lang/ lang/exceptions/ net/ util/ util/concurrent/
Author: tabish
Date: Wed May 30 11:43:33 2007
New Revision: 542904
URL: http://svn.apache.org/viewvc?view=rev&rev=542904
Log:
http://issues.apache.org/activemq/browse/AMQCPP-103
Added:
activemq/activemq-cpp/trunk/src/main/decaf/util/Config.h
activemq/activemq-cpp/trunk/src/main/decaf/util/concurrent/Concurrent.h
activemq/activemq-cpp/trunk/src/main/decaf/util/concurrent/Lock.h
activemq/activemq-cpp/trunk/src/main/decaf/util/concurrent/Mutex.cpp
activemq/activemq-cpp/trunk/src/main/decaf/util/concurrent/Mutex.h
activemq/activemq-cpp/trunk/src/main/decaf/util/concurrent/Synchronizable.h
Modified:
activemq/activemq-cpp/trunk/src/main/decaf/io/BlockingByteArrayInputStream.cpp
activemq/activemq-cpp/trunk/src/main/decaf/io/BlockingByteArrayInputStream.h
activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedInputStream.cpp
activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedInputStream.h
activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedOutputStream.cpp
activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedOutputStream.h
activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayInputStream.cpp
activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayInputStream.h
activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayOutputStream.cpp
activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayOutputStream.h
activemq/activemq-cpp/trunk/src/main/decaf/io/Closeable.h
activemq/activemq-cpp/trunk/src/main/decaf/io/DataInputStream.cpp
activemq/activemq-cpp/trunk/src/main/decaf/io/DataInputStream.h
activemq/activemq-cpp/trunk/src/main/decaf/io/DataOutputStream.cpp
activemq/activemq-cpp/trunk/src/main/decaf/io/DataOutputStream.h
activemq/activemq-cpp/trunk/src/main/decaf/io/EOFException.h
activemq/activemq-cpp/trunk/src/main/decaf/io/FilterInputStream.h
activemq/activemq-cpp/trunk/src/main/decaf/io/FilterOutputStream.h
activemq/activemq-cpp/trunk/src/main/decaf/io/IOException.h
activemq/activemq-cpp/trunk/src/main/decaf/io/InputStream.h
activemq/activemq-cpp/trunk/src/main/decaf/io/OutputStream.h
activemq/activemq-cpp/trunk/src/main/decaf/io/StandardErrorOutputStream.h
activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.h
activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IllegalStateException.h
activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IndexOutOfBoundsException.h
activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/InterruptedException.h
activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/InvalidStateException.h
activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NoSuchElementException.h
activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NullPointerException.h
activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/RuntimeException.h
activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/UnsupportedOperationException.h
activemq/activemq-cpp/trunk/src/main/decaf/net/BufferedSocket.cpp
activemq/activemq-cpp/trunk/src/main/decaf/net/BufferedSocket.h
activemq/activemq-cpp/trunk/src/main/decaf/net/ServerSocket.cpp
activemq/activemq-cpp/trunk/src/main/decaf/net/ServerSocket.h
activemq/activemq-cpp/trunk/src/main/decaf/net/SocketException.h
activemq/activemq-cpp/trunk/src/main/decaf/net/SocketInputStream.cpp
activemq/activemq-cpp/trunk/src/main/decaf/net/SocketInputStream.h
activemq/activemq-cpp/trunk/src/main/decaf/net/SocketOutputStream.h
activemq/activemq-cpp/trunk/src/main/decaf/net/TcpSocket.cpp
activemq/activemq-cpp/trunk/src/main/decaf/net/TcpSocket.h
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/BlockingByteArrayInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/BlockingByteArrayInputStream.cpp?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/BlockingByteArrayInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/BlockingByteArrayInputStream.cpp Wed May 30 11:43:33 2007
@@ -65,7 +65,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-void BlockingByteArrayInputStream::close() throw (cms::CMSException){
+void BlockingByteArrayInputStream::close() throw ( lang::Exception ){
synchronized( this ){
@@ -103,8 +103,8 @@
////////////////////////////////////////////////////////////////////////////////
std::size_t BlockingByteArrayInputStream::read( unsigned char* buffer,
- std::size_t bufferSize )
- throw ( IOException ){
+ std::size_t bufferSize )
+ throw ( IOException ){
synchronized( this ){
std::size_t ix = 0;
@@ -123,7 +123,8 @@
}
if( closing ){
- throw IOException( __FILE__, __LINE__, "close occurred during read" );
+ throw IOException(
+ __FILE__, __LINE__, "close occurred during read" );
}
return ix;
@@ -134,7 +135,7 @@
////////////////////////////////////////////////////////////////////////////////
std::size_t BlockingByteArrayInputStream::skip( std::size_t num )
- throw ( io::IOException, exceptions::UnsupportedOperationException ){
+ throw ( io::IOException, lang::exceptions::UnsupportedOperationException ){
std::size_t ix = 0;
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/BlockingByteArrayInputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/BlockingByteArrayInputStream.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/BlockingByteArrayInputStream.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/BlockingByteArrayInputStream.h Wed May 30 11:43:33 2007
@@ -19,7 +19,7 @@
#define _DECAF_IO_BLOCKINGBYTEARRAYINPUTSTREAM_H_
#include <decaf/io/InputStream.h>
-#include <activemq/concurrent/Mutex.h>
+#include <decaf/util/concurrent/Mutex.h>
#include <vector>
namespace decaf{
@@ -47,7 +47,7 @@
/**
* Synchronization object.
*/
- concurrent::Mutex mutex;
+ util::concurrent::Mutex mutex;
/**
* Indicates that this stream is in the process of shutting
@@ -91,7 +91,7 @@
* calling.
* @throws Exception
*/
- virtual void lock() throw( Exception ){
+ virtual void lock() throw( lang::Exception ){
mutex.lock();
}
@@ -99,7 +99,7 @@
* Unlocks the object.
* @throws Exception
*/
- virtual void unlock() throw( Exception ){
+ virtual void unlock() throw( lang::Exception ){
mutex.unlock();
}
@@ -109,7 +109,7 @@
* calling.
* @throws Exception
*/
- virtual void wait() throw( Exception ){
+ virtual void wait() throw( lang::Exception ){
mutex.wait();
}
@@ -121,7 +121,7 @@
* @param time in millisecsonds to wait, or WAIT_INIFINITE
* @throws Exception
*/
- virtual void wait( unsigned long millisecs ) throw( Exception ){
+ virtual void wait( unsigned long millisecs ) throw( lang::Exception ){
mutex.wait(millisecs);
}
@@ -131,7 +131,7 @@
* calling.
* @throws Exception
*/
- virtual void notify() throw( Exception ){
+ virtual void notify() throw( lang::Exception ){
mutex.notify();
}
@@ -141,7 +141,7 @@
* calling.
* @throws Exception
*/
- virtual void notifyAll() throw( Exception ){
+ virtual void notifyAll() throw( lang::Exception ){
mutex.notifyAll();
}
@@ -151,7 +151,7 @@
* @return the data available in the internal buffer.
* @throws IOException if an error occurs.
*/
- virtual std::size_t available() const throw (IOException){
+ virtual std::size_t available() const throw ( IOException ){
return std::distance( pos, buffer.end() );
}
@@ -162,7 +162,7 @@
* @return the next byte.
* @throws IOException if an error occurs.
*/
- virtual unsigned char read() throw (IOException);
+ virtual unsigned char read() throw ( IOException );
/**
* Reads an array of bytes from the buffer. If the desired amount
@@ -175,13 +175,13 @@
* @throws IOException f an error occurs.
*/
virtual std::size_t read( unsigned char* buffer, std::size_t bufferSize )
- throw (IOException);
+ throw ( IOException );
/**
* Closes the target input stream.
* @throws IOException if an error occurs.
*/
- virtual void close() throw (cms::CMSException);
+ virtual void close() throw ( lang::Exception );
/**
* Skips over and discards n bytes of data from this input stream. The
@@ -200,7 +200,7 @@
* @throws IOException if an error occurs
*/
virtual std::size_t skip( std::size_t num )
- throw ( io::IOException, exceptions::UnsupportedOperationException );
+ throw ( io::IOException, lang::exceptions::UnsupportedOperationException );
};
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedInputStream.cpp?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedInputStream.cpp Wed May 30 11:43:33 2007
@@ -80,8 +80,8 @@
return returnValue;
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -127,13 +127,13 @@
// Return the total number of bytes read.
return totalRead;
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
std::size_t BufferedInputStream::skip( std::size_t num )
- throw ( IOException, exceptions::UnsupportedOperationException ){
+ throw ( IOException, lang::exceptions::UnsupportedOperationException ){
try{
// If there's no data left, reset to pointers to the beginning of the
@@ -166,8 +166,8 @@
// Return the total number of bytes read.
return totalSkipped;
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -196,7 +196,7 @@
// Increment the tail to the new end position.
tail += bytesRead;
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedInputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedInputStream.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedInputStream.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedInputStream.h Wed May 30 11:43:33 2007
@@ -121,7 +121,7 @@
* @throws IOException if an error occurs
*/
virtual std::size_t skip( std::size_t num )
- throw ( io::IOException, exceptions::UnsupportedOperationException );
+ throw ( io::IOException, lang::exceptions::UnsupportedOperationException );
private:
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedOutputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedOutputStream.cpp?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedOutputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedOutputStream.cpp Wed May 30 11:43:33 2007
@@ -59,7 +59,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-void BufferedOutputStream::close() throw( cms::CMSException ){
+void BufferedOutputStream::close() throw( lang::Exception ){
// Flush this stream.
flush();
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedOutputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedOutputStream.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedOutputStream.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedOutputStream.h Wed May 30 11:43:33 2007
@@ -97,7 +97,7 @@
* Invokes close on the target output stream.
* @throws CMSException thrown if an error occurs.
*/
- void close() throw( cms::CMSException );
+ void close() throw( lang::Exception );
private:
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayInputStream.cpp?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayInputStream.cpp Wed May 30 11:43:33 2007
@@ -21,7 +21,8 @@
using namespace std;
using namespace decaf;
using namespace decaf::io;
-using namespace decaf::exceptions;
+using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
////////////////////////////////////////////////////////////////////////////////
ByteArrayInputStream::ByteArrayInputStream(){
@@ -72,7 +73,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-void ByteArrayInputStream::reset() throw (cms::CMSException){
+void ByteArrayInputStream::reset() throw ( lang::Exception){
if( activeBuffer == NULL ){
throw IOException( __FILE__, __LINE__, "Buffer has not been initialized" );
}
@@ -92,7 +93,7 @@
////////////////////////////////////////////////////////////////////////////////
std::size_t ByteArrayInputStream::read( unsigned char* buffer,
- std::size_t bufferSize )
+ std::size_t bufferSize )
throw ( IOException ){
std::size_t ix = 0;
@@ -101,7 +102,9 @@
if(pos == activeBuffer->end())
{
// We don't have enough data to fulfill the request.
- throw IOException( __FILE__, __LINE__, "Reached the end of the buffer" );
+ throw IOException(
+ __FILE__, __LINE__,
+ "Reached the end of the buffer" );
}
buffer[ix] = *(pos);
@@ -112,7 +115,7 @@
////////////////////////////////////////////////////////////////////////////////
std::size_t ByteArrayInputStream::skip( std::size_t num )
- throw ( IOException, exceptions::UnsupportedOperationException ){
+ throw ( IOException, lang::exceptions::UnsupportedOperationException ){
std::size_t ix = 0;
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayInputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayInputStream.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayInputStream.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayInputStream.h Wed May 30 11:43:33 2007
@@ -19,7 +19,7 @@
#define _DECAF_IO_BYTEARRAYINPUTSTREAM_H_
#include <decaf/io/InputStream.h>
-#include <activemq/concurrent/Mutex.h>
+#include <decaf/util/concurrent/Mutex.h>
#include <vector>
#include <algorithm>
@@ -52,7 +52,7 @@
/**
* Synchronization object.
*/
- concurrent::Mutex mutex;
+ util::concurrent::Mutex mutex;
public:
@@ -104,7 +104,7 @@
* calling.
* @throws Exception
*/
- virtual void lock() throw( Exception ){
+ virtual void lock() throw( lang::Exception ){
mutex.lock();
}
@@ -112,7 +112,7 @@
* Unlocks the object.
* @throws Exception
*/
- virtual void unlock() throw( Exception ){
+ virtual void unlock() throw( lang::Exception ){
mutex.unlock();
}
@@ -122,7 +122,7 @@
* calling.
* @throws Exception
*/
- virtual void wait() throw( Exception ){
+ virtual void wait() throw( lang::Exception ){
mutex.wait();
}
@@ -135,7 +135,7 @@
* WAIT_INIFINITE
* @throws Exception
*/
- virtual void wait( unsigned long millisecs ) throw( Exception ){
+ virtual void wait( unsigned long millisecs ) throw( lang::Exception ){
mutex.wait(millisecs);
}
@@ -145,7 +145,7 @@
* calling.
* @throws Exception
*/
- virtual void notify() throw( Exception ){
+ virtual void notify() throw( lang::Exception ){
mutex.notify();
}
@@ -155,7 +155,7 @@
* calling.
* @throws Exception
*/
- virtual void notifyAll() throw( Exception ){
+ virtual void notifyAll() throw( lang::Exception ){
mutex.notifyAll();
}
@@ -163,9 +163,11 @@
* Indcates the number of bytes avaialable.
* @return The number of bytes until the end of the internal buffer.
*/
- virtual std::size_t available() const throw (IOException) {
+ virtual std::size_t available() const throw ( IOException ) {
if( activeBuffer == NULL ){
- throw IOException( __FILE__, __LINE__, "buffer has not been initialized");
+ throw IOException(
+ __FILE__, __LINE__,
+ "buffer has not been initialized");
}
return std::distance( pos, activeBuffer->end() );
@@ -186,19 +188,19 @@
* @throws IOException thrown if an error occurs.
*/
virtual std::size_t read( unsigned char* buffer, std::size_t bufferSize )
- throw (IOException);
+ throw ( IOException );
/**
* Closes the target input stream.
* @throws IOException thrown if an error occurs.
*/
- virtual void close() throw(cms::CMSException){ /* do nothing */ }
+ virtual void close() throw( lang::Exception ){ /* do nothing */ }
/**
* Resets the read index to the beginning of the byte
* array.
*/
- virtual void reset() throw (cms::CMSException);
+ virtual void reset() throw ( lang::Exception);
/**
* Skips over and discards n bytes of data from this input stream. The
@@ -217,7 +219,7 @@
* @throws IOException if an error occurs
*/
virtual std::size_t skip( std::size_t num )
- throw ( io::IOException, exceptions::UnsupportedOperationException );
+ throw ( io::IOException, lang::exceptions::UnsupportedOperationException );
};
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayOutputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayOutputStream.cpp?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayOutputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayOutputStream.cpp Wed May 30 11:43:33 2007
@@ -21,6 +21,7 @@
using namespace std;
using namespace decaf;
using namespace decaf::io;
+using namespace decaf::lang;
////////////////////////////////////////////////////////////////////////////////
ByteArrayOutputStream::ByteArrayOutputStream()
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayOutputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayOutputStream.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayOutputStream.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/ByteArrayOutputStream.h Wed May 30 11:43:33 2007
@@ -19,7 +19,7 @@
#define _DECAF_IO_BYTEARRAYOUTPUTSTREAM_H_
#include <decaf/io/OutputStream.h>
-#include <activemq/concurrent/Mutex.h>
+#include <decaf/util/concurrent/Mutex.h>
#include <vector>
namespace decaf{
@@ -42,7 +42,7 @@
/**
* Synchronization object.
*/
- concurrent::Mutex mutex;
+ util::concurrent::Mutex mutex;
public:
@@ -60,7 +60,7 @@
/**
* Destructor
*/
- virtual ~ByteArrayOutputStream() {};
+ virtual ~ByteArrayOutputStream() {};
/**
* Sets the internal buffer. This input stream will wrap around
@@ -97,7 +97,7 @@
* calling.
* @throws Exception
*/
- virtual void lock() throw( Exception ){
+ virtual void lock() throw( lang::Exception ){
mutex.lock();
}
@@ -105,7 +105,7 @@
* Unlocks the object.
* @throws Exception
*/
- virtual void unlock() throw( Exception ){
+ virtual void unlock() throw( lang::Exception ){
mutex.unlock();
}
@@ -115,7 +115,7 @@
* calling.
* @throws Exception
*/
- virtual void wait() throw( Exception ){
+ virtual void wait() throw( lang::Exception ){
mutex.wait();
}
@@ -127,7 +127,7 @@
* @param time in millisecsonds to wait, or WAIT_INIFINITE
* @throws Exception
*/
- virtual void wait( unsigned long millisecs ) throw( Exception ){
+ virtual void wait( unsigned long millisecs ) throw( lang::Exception ){
mutex.wait(millisecs);
}
@@ -137,7 +137,7 @@
* calling.
* @throws Exception
*/
- virtual void notify() throw( Exception ){
+ virtual void notify() throw( lang::Exception ){
mutex.notify();
}
@@ -147,7 +147,7 @@
* calling.
* @throws Exception
*/
- virtual void notifyAll() throw( Exception ){
+ virtual void notifyAll() throw( lang::Exception ){
mutex.notifyAll();
}
@@ -184,7 +184,7 @@
* Invokes close on the target output stream.
* @throws CMSException
*/
- void close() throw( cms::CMSException ){ /* do nothing */ }
+ void close() throw( lang::Exception ){ /* do nothing */ }
};
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/Closeable.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/Closeable.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/Closeable.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/Closeable.h Wed May 30 11:43:33 2007
@@ -40,6 +40,7 @@
virtual void close() throw( lang::Exception ) = 0;
};
-}
+
+}}
#endif /*_DECAF_IO_CLOSEABLE_H_*/
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/DataInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/DataInputStream.cpp?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/DataInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/DataInputStream.cpp Wed May 30 11:43:33 2007
@@ -1,4 +1,4 @@
-/*
+/*
* 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.
@@ -15,14 +15,14 @@
* limitations under the License.
*/
-#include <activemq/io/DataInputStream.h>
-#include <decaf/util/Endian.h>
+#include <decaf/io/DataInputStream.h>
using namespace std;
using namespace decaf;
using namespace decaf::io;
using namespace decaf::util;
using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
////////////////////////////////////////////////////////////////////////////////
DataInputStream::DataInputStream( InputStream* inputStream, bool own )
@@ -32,101 +32,100 @@
DataInputStream::~DataInputStream() {}
////////////////////////////////////////////////////////////////////////////////
-std::size_t DataInputStream::read( std::vector<unsigned char>& buffer )
+std::size_t DataInputStream::read( std::vector<unsigned char>& buffer )
throw ( io::IOException ) {
-
+
try {
return this->read( &buffer[0], 0, buffer.size() );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
-std::size_t DataInputStream::read( unsigned char* buffer,
- std::size_t offset,
- std::size_t length )
- throw ( io::IOException, exceptions::IndexOutOfBoundsException,
- exceptions::NullPointerException ) {
-
+std::size_t DataInputStream::read( unsigned char* buffer,
+ std::size_t offset,
+ std::size_t length )
+ throw ( IOException, IndexOutOfBoundsException, NullPointerException ) {
+
try {
if( buffer == NULL ) {
- throw NullPointerException(
+ throw NullPointerException(
__FILE__, __LINE__,
"DataInputStream::read - Buffer is null" );
}
std::size_t read = 0;
-
+
try {
read = inputStream->read( &buffer[offset], length );
- } catch( io::EOFException& ex ){
- if( read == 0 )
+ } catch( EOFException& ex ){
+ if( read == 0 )
return -1;
}
if( read == 0 ){
- throw IOException(
+ throw IOException(
__FILE__, __LINE__,
"DataInputStream::read - failed to extract data, not EOF." );
}
-
+
return read;
}
- AMQ_CATCH_RETHROW( NullPointerException )
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( NullPointerException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
-bool DataInputStream::readBoolean()
- throw( io::IOException, io::EOFException ) {
+bool DataInputStream::readBoolean()
+ throw( IOException, EOFException ) {
try {
char value = 0;
this->readFully( ( unsigned char* )&value, 0, sizeof( char ) );
return (char)( value != 0 );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
-char DataInputStream::readByte()
- throw ( io::IOException, io::EOFException ) {
-
+char DataInputStream::readByte()
+ throw ( IOException, EOFException ) {
+
try {
char value = 0;
this->readFully( ( unsigned char* )&value, 0, sizeof( char ) );
return (char)( value );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
-unsigned char DataInputStream::readUnsignedByte()
- throw ( io::IOException, io::EOFException ) {
+unsigned char DataInputStream::readUnsignedByte()
+ throw ( IOException, EOFException ) {
try {
unsigned char value = 0;
this->readFully( ( unsigned char* )&value, 0, sizeof( unsigned char ) );
return (char)( value );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
-}
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
+}
////////////////////////////////////////////////////////////////////////////////
-char DataInputStream::readChar() throw ( io::IOException, io::EOFException ) {
+char DataInputStream::readChar() throw ( IOException, EOFException ) {
try {
char value = 0;
this->readFully( ( unsigned char* )&value, 0, sizeof( char ) );
return (char)( value );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -136,17 +135,17 @@
unsigned char byte1 = this->readByte();
unsigned char byte2 = this->readByte();
-
+
value |= (byte1 << 8 | byte2 << 0);
-
+
return value;
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
-unsigned short DataInputStream::readUnsignedShort()
+unsigned short DataInputStream::readUnsignedShort()
throw ( io::IOException, io::EOFException ) {
try {
@@ -154,13 +153,13 @@
unsigned char byte1 = this->readByte();
unsigned char byte2 = this->readByte();
-
+
value |= (byte1 << 8 | byte2 << 0);
-
+
return value;
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -173,13 +172,13 @@
unsigned char byte2 = this->readByte();
unsigned char byte3 = this->readByte();
unsigned char byte4 = this->readByte();
-
+
value |= (byte1 << 24 | byte2 << 16 | byte3 << 8 | byte4 << 0);
-
+
return value;
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -188,11 +187,11 @@
unsigned long long lvalue = this->readLong();
double value = 0.0;
- memcpy( &value, &lvalue, sizeof( unsigned long long ) );
+ memcpy( &value, &lvalue, sizeof( unsigned long long ) );
return value;
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -204,8 +203,8 @@
memcpy( &value, &lvalue, sizeof( unsigned int ) );
return value;
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -229,37 +228,37 @@
return value;
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
-std::string DataInputStream::readString()
+std::string DataInputStream::readString()
throw ( io::IOException, io::EOFException ) {
try {
std::string retVal;
char temp = 0;
-
+
while( true ){
temp = readChar();
-
+
// if null is found we are done.
if( temp == '\0' ){
break;
}
-
+
// Append no matter what
- retVal += temp;
+ retVal += temp;
}
-
+
return retVal;
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
-std::string DataInputStream::readUTF()
+std::string DataInputStream::readUTF()
throw ( io::IOException, io::EOFException ) {
try {
std::string buffer;
@@ -268,37 +267,37 @@
readFully( (unsigned char*)buffer.c_str(), 0, len );
return buffer;
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
-void DataInputStream::readFully( std::vector< unsigned char >& buffer )
+void DataInputStream::readFully( std::vector< unsigned char >& buffer )
throw ( io::IOException, io::EOFException ) {
try {
this->readFully( &buffer[0], 0, buffer.size() );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
-void DataInputStream::readFully( unsigned char* buffer,
- std::size_t offset,
- std::size_t length )
- throw ( io::IOException,
- io::EOFException,
- exceptions::IndexOutOfBoundsException,
- exceptions::NullPointerException )
+void DataInputStream::readFully( unsigned char* buffer,
+ std::size_t offset,
+ std::size_t length )
+ throw ( io::IOException,
+ io::EOFException,
+ lang::exceptions::IndexOutOfBoundsException,
+ lang::exceptions::NullPointerException )
{
try {
-
+
if( buffer == NULL ) {
- throw NullPointerException(
+ throw NullPointerException(
__FILE__, __LINE__,
"DataInputStream::read - Buffer is null" );
}
-
+
std::size_t n = 0;
while( n < length ) {
std::size_t count = inputStream->read( &buffer[offset + n], (length - n) );
@@ -310,25 +309,25 @@
n += count;
}
}
- AMQ_CATCH_RETHROW( NullPointerException )
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( NullPointerException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
-std::size_t DataInputStream::skip( std::size_t num )
-throw( io::IOException, exceptions::UnsupportedOperationException ) {
+std::size_t DataInputStream::skip( std::size_t num )
+throw( io::IOException, lang::exceptions::UnsupportedOperationException ) {
try {
std::size_t total = 0;
std::size_t cur = 0;
- while( ( total < num ) &&
+ while( ( total < num ) &&
( ( cur = inputStream->skip( num-total ) ) > 0 ) ) {
total += cur;
}
return total;
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/DataInputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/DataInputStream.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/DataInputStream.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/DataInputStream.h Wed May 30 11:43:33 2007
@@ -21,8 +21,8 @@
#include <decaf/io/FilterInputStream.h>
#include <decaf/io/IOException.h>
#include <decaf/io/EOFException.h>
-#include <activemq/exceptions/NullPointerException.h>
-#include <activemq/exceptions/IndexOutOfBoundsException.h>
+#include <decaf/lang/exceptions/NullPointerException.h>
+#include <decaf/lang/exceptions/IndexOutOfBoundsException.h>
namespace decaf{
namespace io{
@@ -134,8 +134,8 @@
std::size_t offset,
std::size_t length )
throw ( io::IOException,
- exceptions::IndexOutOfBoundsException,
- exceptions::NullPointerException );
+ lang::exceptions::IndexOutOfBoundsException,
+ lang::exceptions::NullPointerException );
/**
* Reads one input byte and returns true if that byte is nonzero,
@@ -329,8 +329,8 @@
std::size_t length )
throw ( io::IOException,
io::EOFException,
- exceptions::IndexOutOfBoundsException,
- exceptions::NullPointerException );
+ lang::exceptions::IndexOutOfBoundsException,
+ lang::exceptions::NullPointerException );
/**
* Makes an attempt to skip over n bytes of data from the input
@@ -345,7 +345,7 @@
*/
virtual std::size_t skip( std::size_t num )
throw( io::IOException,
- exceptions::UnsupportedOperationException );
+ lang::exceptions::UnsupportedOperationException );
};
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/DataOutputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/DataOutputStream.cpp?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/DataOutputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/DataOutputStream.cpp Wed May 30 11:43:33 2007
@@ -15,8 +15,7 @@
* limitations under the License.
*/
-#include "DataOutputStream.h"
-#include <decaf/util/Endian.h>
+#include <decaf/io/DataOutputStream.h>
#include <decaf/util/Config.h>
using namespace decaf;
@@ -42,8 +41,8 @@
outputStream->write( c );
written++;
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -59,8 +58,8 @@
outputStream->write( &buffer[0], buffer.size() );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -70,8 +69,8 @@
try {
outputStream->write( buffer, len );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -83,8 +82,8 @@
try {
outputStream->write( buffer+offset, len );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -95,8 +94,8 @@
this->write( ivalue );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -104,8 +103,8 @@
try {
this->write( value );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -113,8 +112,8 @@
try {
this->writeUnsignedShort( (unsigned short)value );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -125,8 +124,8 @@
write( (unsigned char)( (value & 0xFF00) >> 8 ) );
write( (unsigned char)( (value & 0x00FF) >> 0 ) );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -134,8 +133,8 @@
try {
write( value );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -146,8 +145,8 @@
this->write( (unsigned char)( (value & 0x0000FF00) >> 8 ) );
this->write( (unsigned char)( (value & 0x000000FF) >> 0 ) );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -162,8 +161,8 @@
this->write( (unsigned char)( (value & 0x000000000000FF00ULL) >> 8 ) );
this->write( (unsigned char)( (value & 0x00000000000000FFULL) >> 0 ) );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -174,8 +173,8 @@
this->writeInt( lvalue );
memcpy( &value, &lvalue, sizeof( unsigned int ) );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -186,8 +185,8 @@
this->writeLong( lvalue );
memcpy( &value, &lvalue, sizeof( unsigned long long ) );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -196,8 +195,8 @@
// do not add one so that we don't write the NULL
this->write( (const unsigned char*)value.c_str(), value.length() );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -206,8 +205,8 @@
// add one so that we write the NULL
this->write( (const unsigned char*)value.c_str(), value.length() + 1 );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -216,6 +215,6 @@
this->writeUnsignedShort( (unsigned short)value.length() );
this->write( (const unsigned char*)value.c_str(), value.length() );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/DataOutputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/DataOutputStream.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/DataOutputStream.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/DataOutputStream.h Wed May 30 11:43:33 2007
@@ -210,7 +210,7 @@
* @param value the value to write.
* @throws IOException
*/
- virtual void writeUTF( const std::string& value ) throw ( io::IOException );
+ virtual void writeUTF( const std::string& value ) throw ( IOException );
};
}}
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/EOFException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/EOFException.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/EOFException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/EOFException.h Wed May 30 11:43:33 2007
@@ -39,10 +39,10 @@
* Copy Constructor
* @param ex the exception to copy
*/
- EOFException( const exceptions::Exception& ex ) throw()
+ EOFException( const lang::Exception& ex ) throw()
: IOException()
{
- *(exceptions::Exception*)this = ex;
+ *(lang::Exception*)this = ex;
}
/**
@@ -52,7 +52,7 @@
EOFException( const EOFException& ex ) throw()
: IOException()
{
- *(exceptions::Exception*)this = ex;
+ *(lang::Exception*)this = ex;
}
/**
@@ -78,7 +78,7 @@
* to preserve the type of the original exception as well as the message.
* All subclasses should override.
*/
- virtual exceptions::Exception* clone() const{
+ virtual EOFException* clone() const{
return new EOFException( *this );
}
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/FilterInputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/FilterInputStream.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/FilterInputStream.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/FilterInputStream.h Wed May 30 11:43:33 2007
@@ -20,7 +20,7 @@
#include <decaf/io/InputStream.h>
#include <decaf/io/IOException.h>
-#include <activemq/concurrent/Mutex.h>
+#include <decaf/util/concurrent/Mutex.h>
namespace decaf{
namespace io{
@@ -42,7 +42,7 @@
InputStream* inputStream;
// Synchronization object.
- concurrent::Mutex mutex;
+ util::concurrent::Mutex mutex;
// Indicates if we own the wrapped stream
bool own;
@@ -63,8 +63,8 @@
try {
if( own == true ) delete inputStream;
}
- AMQ_CATCH_NOTHROW( IOException )
- AMQ_CATCHALL_NOTHROW( )
+ DECAF_CATCH_NOTHROW( IOException )
+ DECAF_CATCHALL_NOTHROW( )
}
/**
@@ -77,8 +77,8 @@
try {
return inputStream->available();
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
/**
@@ -95,8 +95,8 @@
try {
return inputStream->read();
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
/**
@@ -114,21 +114,21 @@
try {
return inputStream->read( buffer, bufferSize );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
/**
* Close the Stream, the FilterOutputStream simply calls the close
* method of the underlying stream
- * @throws CMSException
+ * @throws Exception
*/
- virtual void close() throw ( cms::CMSException ) {
+ virtual void close() throw ( lang::Exception ) {
try {
inputStream->close();
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
/**
@@ -147,13 +147,13 @@
* @returns total butes skipped
* @throws IOException if an error occurs
*/
- virtual std::size_t skip( std::size_t num ) throw ( io::IOException, exceptions::UnsupportedOperationException ) {
+ virtual std::size_t skip( std::size_t num ) throw ( io::IOException, lang::exceptions::UnsupportedOperationException ) {
try {
return inputStream->skip(num);
}
- AMQ_CATCH_RETHROW( exceptions::UnsupportedOperationException )
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( lang::exceptions::UnsupportedOperationException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
public: // Synchronizable
@@ -164,7 +164,7 @@
* calling.
* @throws Exception
*/
- virtual void lock() throw( Exception ){
+ virtual void lock() throw( lang::Exception ){
mutex.lock();
}
@@ -172,7 +172,7 @@
* Unlocks the object.
* @throws Exception
*/
- virtual void unlock() throw( Exception ){
+ virtual void unlock() throw( lang::Exception ){
mutex.unlock();
}
@@ -182,7 +182,7 @@
* calling.
* @throws Exception
*/
- virtual void wait() throw( Exception ){
+ virtual void wait() throw( lang::Exception ){
mutex.wait();
}
@@ -194,7 +194,7 @@
* @param millisecs the time in millisecsonds to wait, or WAIT_INIFINITE
* @throws Exception
*/
- virtual void wait( unsigned long millisecs ) throw( Exception ){
+ virtual void wait( unsigned long millisecs ) throw( lang::Exception ){
mutex.wait(millisecs);
}
@@ -204,7 +204,7 @@
* calling.
* @throws Exception
*/
- virtual void notify() throw( Exception ){
+ virtual void notify() throw( lang::Exception ){
mutex.notify();
}
@@ -214,7 +214,7 @@
* calling.
* @throws Exception
*/
- virtual void notifyAll() throw( exceptions::Exception ){
+ virtual void notifyAll() throw( lang::Exception ){
mutex.notifyAll();
}
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/FilterOutputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/FilterOutputStream.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/FilterOutputStream.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/FilterOutputStream.h Wed May 30 11:43:33 2007
@@ -20,7 +20,7 @@
#include <decaf/io/OutputStream.h>
#include <decaf/io/IOException.h>
-#include <activemq/concurrent/Mutex.h>
+#include <decaf/util/concurrent/Mutex.h>
namespace decaf{
namespace io{
@@ -53,7 +53,7 @@
OutputStream* outputStream;
// Synchronization object.
- concurrent::Mutex mutex;
+ util::concurrent::Mutex mutex;
// Indicates if we own the wrapped stream
bool own;
@@ -75,8 +75,8 @@
try {
if( own == true ) delete outputStream;
}
- AMQ_CATCH_NOTHROW( IOException )
- AMQ_CATCHALL_NOTHROW( )
+ DECAF_CATCH_NOTHROW( IOException )
+ DECAF_CATCHALL_NOTHROW( )
}
/**
@@ -90,8 +90,8 @@
try {
outputStream->write( c );
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
/**
@@ -109,8 +109,8 @@
outputStream->write( buffer[ix] );
}
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
/**
@@ -123,8 +123,8 @@
try {
outputStream->flush();
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
/**
@@ -132,12 +132,12 @@
* method of the underlying stream
* @throws CMSException
*/
- virtual void close() throw ( cms::CMSException ) {
+ virtual void close() throw ( lang::Exception ) {
try {
outputStream->close();
}
- AMQ_CATCH_RETHROW( IOException )
- AMQ_CATCHALL_THROW( IOException )
+ DECAF_CATCH_RETHROW( IOException )
+ DECAF_CATCHALL_THROW( IOException )
}
public: // Synchronizable
@@ -148,7 +148,7 @@
* calling.
* @throws Exception
*/
- virtual void lock() throw( Exception ){
+ virtual void lock() throw( lang::Exception ){
mutex.lock();
}
@@ -156,7 +156,7 @@
* Unlocks the object.
* @throws Exception
*/
- virtual void unlock() throw( Exception ){
+ virtual void unlock() throw( lang::Exception ){
mutex.unlock();
}
@@ -166,7 +166,7 @@
* calling.
* @throws Exception
*/
- virtual void wait() throw( Exception ){
+ virtual void wait() throw( lang::Exception ){
mutex.wait();
}
@@ -178,8 +178,8 @@
* @param millisecs the time in millisecsonds to wait, or WAIT_INIFINITE
* @throws Exception
*/
- virtual void wait( unsigned long millisecs ) throw( Exception ){
- mutex.wait(millisecs);
+ virtual void wait( unsigned long millisecs ) throw( lang::Exception ){
+ mutex.wait( millisecs );
}
/**
@@ -188,7 +188,7 @@
* calling.
* @throws Exception
*/
- virtual void notify() throw( Exception ){
+ virtual void notify() throw( lang::Exception ){
mutex.notify();
}
@@ -198,7 +198,7 @@
* calling.
* @throws Exception
*/
- virtual void notifyAll() throw( Exception ){
+ virtual void notifyAll() throw( lang::Exception ){
mutex.notifyAll();
}
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/IOException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/IOException.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/IOException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/IOException.h Wed May 30 11:43:33 2007
@@ -38,7 +38,7 @@
* Copy Constructor
* @param ex the exception to copy
*/
- IOException( const exceptions::Exception& ex ) throw()
+ IOException( const lang::Exception& ex ) throw()
: lang::Exception()
{
*(lang::Exception*)this = ex;
@@ -77,7 +77,7 @@
* to preserve the type of the original exception as well as the message.
* All subclasses should override.
*/
- virtual lang::IOException* clone() const{
+ virtual IOException* clone() const{
return new IOException( *this );
}
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/InputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/InputStream.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/InputStream.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/InputStream.h Wed May 30 11:43:33 2007
@@ -20,8 +20,8 @@
#include <decaf/io/IOException.h>
#include <decaf/io/Closeable.h>
-#include <activemq/concurrent/Synchronizable.h>
-#include <activemq/exceptions/UnsupportedOperationException.h>
+#include <decaf/util/concurrent/Synchronizable.h>
+#include <decaf/lang/exceptions/UnsupportedOperationException.h>
namespace decaf{
namespace io{
@@ -30,7 +30,7 @@
* Base interface for an input stream.
*/
class InputStream : public Closeable,
- public concurrent::Synchronizable
+ public util::concurrent::Synchronizable
{
public:
@@ -78,7 +78,7 @@
* @returns total butes skipped
* @throws IOException if an error occurs
*/
- virtual std::size_t skip( std::size_t num ) throw ( io::IOException, exceptions::UnsupportedOperationException ) = 0;
+ virtual std::size_t skip( std::size_t num ) throw ( io::IOException, lang::exceptions::UnsupportedOperationException ) = 0;
};
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/OutputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/OutputStream.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/OutputStream.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/OutputStream.h Wed May 30 11:43:33 2007
@@ -20,7 +20,7 @@
#include <decaf/io/Closeable.h>
#include <decaf/io/IOException.h>
-#include <activemq/concurrent/Synchronizable.h>
+#include <decaf/util/concurrent/Synchronizable.h>
namespace decaf{
namespace io{
@@ -29,7 +29,7 @@
* Base interface for an output stream.
*/
class OutputStream : public Closeable,
- public concurrent::Synchronizable
+ public util::concurrent::Synchronizable
{
public:
Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/StandardErrorOutputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/StandardErrorOutputStream.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/StandardErrorOutputStream.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/StandardErrorOutputStream.h Wed May 30 11:43:33 2007
@@ -18,7 +18,7 @@
#define _DECAF_IO_STANDARDERROROUTPUTSTREAM_H_
#include <decaf/io/OutputStream.h>
-#include <activemq/concurrent/Mutex.h>
+#include <decaf/util/concurrent/Mutex.h>
#include <iostream>
@@ -32,7 +32,7 @@
/**
* Synchronization object.
*/
- concurrent::Mutex mutex;
+ util::concurrent::Mutex mutex;
public:
@@ -57,7 +57,7 @@
* Unlocks the object.
* @throws Exception
*/
- virtual void unlock() throw( Exception ){
+ virtual void unlock() throw( lang::Exception ){
mutex.unlock();
}
@@ -67,7 +67,7 @@
* calling.
* @throws Exception
*/
- virtual void wait() throw( Exception ){
+ virtual void wait() throw( lang::Exception ){
mutex.wait();
}
@@ -79,7 +79,7 @@
* @param time in millisecsonds to wait, or WAIT_INIFINITE
* @throws Exception
*/
- virtual void wait( unsigned long millisecs ) throw( Exception ){
+ virtual void wait( unsigned long millisecs ) throw( lang::Exception ){
mutex.wait( millisecs );
}
@@ -89,7 +89,7 @@
* calling.
* @throws Exception
*/
- virtual void notify() throw( Exception ){
+ virtual void notify() throw( lang::Exception ){
mutex.notify();
}
@@ -99,7 +99,7 @@
* calling.
* @throws Exception
*/
- virtual void notifyAll() throw( Exception ){
+ virtual void notifyAll() throw( lang::Exception ){
mutex.notifyAll();
}
@@ -141,7 +141,7 @@
* Invokes close on the target output stream.
* throws CMSException if an error occurs
*/
- void close() throw( cms::CMSException ){
+ void close() throw( lang::Exception ){
std::cerr.flush();
}
Modified: activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.h Wed May 30 11:43:33 2007
@@ -18,7 +18,7 @@
#define _DECAF_LANG_EXCEPTION_EXCEPTION_H_
#include <decaf/lang/Throwable.h>
-#include <activemq/exceptions/ExceptionDefines.h>
+#include <decaf/lang/exceptions/ExceptionDefines.h>
#include <stdarg.h>
#include <sstream>
Modified: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IllegalStateException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IllegalStateException.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IllegalStateException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IllegalStateException.h Wed May 30 11:43:33 2007
@@ -90,6 +90,6 @@
};
-}}
+}}}
#endif /*_DECAF_LANG_EXCEPTIONS_ILLEGALSTATEEXCEPTION_H_*/
Modified: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IndexOutOfBoundsException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IndexOutOfBoundsException.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IndexOutOfBoundsException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/IndexOutOfBoundsException.h Wed May 30 11:43:33 2007
@@ -91,6 +91,6 @@
};
-}}
+}}}
#endif /*_DECAF_LANG_EXCEPTIONS_INDEXOUTOFBOUNDSEXCEPTION_H_*/
Modified: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/InterruptedException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/InterruptedException.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/InterruptedException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/InterruptedException.h Wed May 30 11:43:33 2007
@@ -89,6 +89,6 @@
};
-}}
+}}}
#endif /*_DECAF_LANG_EXCEPTIONS_INTERRUPTEDENTEXCEPTION_H_*/
Modified: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/InvalidStateException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/InvalidStateException.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/InvalidStateException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/InvalidStateException.h Wed May 30 11:43:33 2007
@@ -90,6 +90,6 @@
};
-}}
+}}}
#endif /*_DECAF_LANG_EXCEPTIONS_INVALIDSTATEEXCEPTION_H_*/
Modified: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NoSuchElementException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NoSuchElementException.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NoSuchElementException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NoSuchElementException.h Wed May 30 11:43:33 2007
@@ -90,6 +90,6 @@
};
-}}
+}}}
#endif /*_DECAF_LANG_EXCEPTIONS_NOSUCHELEMENTEXCEPTION_H_*/
Modified: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NullPointerException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NullPointerException.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NullPointerException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/NullPointerException.h Wed May 30 11:43:33 2007
@@ -89,6 +89,6 @@
};
-}}
+}}}
#endif /*_DECAF_LANG_EXCEPTIONS_NULLPOINTERENTEXCEPTION_H_*/
Modified: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/RuntimeException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/RuntimeException.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/RuntimeException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/RuntimeException.h Wed May 30 11:43:33 2007
@@ -91,6 +91,6 @@
};
-}}
+}}}
#endif /*_DECAF_LANG_EXCEPTIONS_RUNTIMEENTEXCEPTION_H_*/
Modified: activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/UnsupportedOperationException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/UnsupportedOperationException.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/UnsupportedOperationException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/exceptions/UnsupportedOperationException.h Wed May 30 11:43:33 2007
@@ -26,7 +26,7 @@
/*
* Thrown when an unsupported method is called.
*/
- class UnsupportedOperationException : public Exception
+ class UnsupportedOperationException : public lang::Exception
{
public:
@@ -40,7 +40,7 @@
* @param An exception that should become this type of Exception
*/
UnsupportedOperationException( const Exception& ex ) throw()
- : ActiveMQException()
+ : Exception()
{
*(Exception*)this = ex;
}
@@ -49,7 +49,7 @@
* Copy Constructor
*/
UnsupportedOperationException( const UnsupportedOperationException& ex ) throw()
- : ActiveMQException()
+ : Exception()
{
*(Exception*)this = ex;
}
@@ -89,6 +89,6 @@
};
-}}
+}}}
#endif /*_DECAF_LANG_EXCEPTIONS_UNSUPPORTEDOPERATIONEXCEPTION_H_*/
Modified: activemq/activemq-cpp/trunk/src/main/decaf/net/BufferedSocket.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/net/BufferedSocket.cpp?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/net/BufferedSocket.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/net/BufferedSocket.cpp Wed May 30 11:43:33 2007
@@ -17,12 +17,13 @@
#include "BufferedSocket.h"
-#include <decaf/lang/IllegalArgumentException.h>
+#include <decaf/lang/exceptions/IllegalArgumentException.h>
using namespace decaf;
using namespace decaf::net;
using namespace decaf::io;
using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
////////////////////////////////////////////////////////////////////////////////
BufferedSocket::BufferedSocket( Socket* socket,
@@ -66,8 +67,8 @@
{
close();
}
- AMQ_CATCH_NOTHROW( Exception )
- AMQ_CATCHALL_NOTHROW()
+ DECAF_CATCH_NOTHROW( Exception )
+ DECAF_CATCHALL_NOTHROW()
}
////////////////////////////////////////////////////////////////////////////////
@@ -91,13 +92,13 @@
outputStream = new BufferedOutputStream(
socket->getOutputStream(), (std::size_t)outputBufferSize );
}
- AMQ_CATCH_RETHROW( SocketException )
- AMQ_CATCH_EXCEPTION_CONVERT( Exception, SocketException )
- AMQ_CATCHALL_THROW( SocketException )
+ DECAF_CATCH_RETHROW( SocketException )
+ DECAF_CATCH_EXCEPTION_CONVERT( Exception, SocketException )
+ DECAF_CATCHALL_THROW( SocketException )
}
////////////////////////////////////////////////////////////////////////////////
-void BufferedSocket::close() throw( cms::CMSException )
+void BufferedSocket::close() throw( lang::Exception )
{
try
{
@@ -119,7 +120,7 @@
// Close the socket
try{
socket->close();
- } catch( cms::CMSException& ex ){ /* Absorb */ }
+ } catch( lang::Exception& ex ){ /* Absorb */ }
// if we own it, delete it.
if( own ) {
@@ -128,7 +129,7 @@
socket = NULL;
}
}
- AMQ_CATCH_RETHROW( SocketException )
- AMQ_CATCH_EXCEPTION_CONVERT( Exception, SocketException )
- AMQ_CATCHALL_THROW( SocketException )
+ DECAF_CATCH_RETHROW( SocketException )
+ DECAF_CATCH_EXCEPTION_CONVERT( Exception, SocketException )
+ DECAF_CATCHALL_THROW( SocketException )
}
Modified: activemq/activemq-cpp/trunk/src/main/decaf/net/BufferedSocket.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/net/BufferedSocket.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/net/BufferedSocket.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/net/BufferedSocket.h Wed May 30 11:43:33 2007
@@ -81,7 +81,7 @@
* Closes this object and deallocates the appropriate resources.
* @throws CMSException
*/
- virtual void close() throw( cms::CMSException );
+ virtual void close() throw( lang::Exception );
/**
* Indicates whether or not this socket is connected to a destination.
Modified: activemq/activemq-cpp/trunk/src/main/decaf/net/ServerSocket.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/net/ServerSocket.cpp?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/net/ServerSocket.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/net/ServerSocket.cpp Wed May 30 11:43:33 2007
@@ -169,7 +169,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-void ServerSocket::close() throw (cms::CMSException){
+void ServerSocket::close() throw ( lang::Exception ){
if( isBound() ) {
Modified: activemq/activemq-cpp/trunk/src/main/decaf/net/ServerSocket.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/net/ServerSocket.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/net/ServerSocket.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/net/ServerSocket.h Wed May 30 11:43:33 2007
@@ -79,7 +79,7 @@
/**
* Closes the server socket.
*/
- virtual void close() throw( cms::CMSException );
+ virtual void close() throw( lang::Exception );
/**
* @return true of the server socket is bound.
Modified: activemq/activemq-cpp/trunk/src/main/decaf/net/SocketException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/net/SocketException.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/net/SocketException.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/net/SocketException.h Wed May 30 11:43:33 2007
@@ -57,7 +57,7 @@
* to preserve the type of the original exception as well as the message.
* All subclasses should override.
*/
- virtual lang::Exception* clone() const{
+ virtual SocketException* clone() const{
return new SocketException( *this );
}
Modified: activemq/activemq-cpp/trunk/src/main/decaf/net/SocketInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/net/SocketInputStream.cpp?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/net/SocketInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/net/SocketInputStream.cpp Wed May 30 11:43:33 2007
@@ -34,11 +34,11 @@
#include <sys/filio.h>
#endif
-#include <decaf/network/SocketInputStream.h>
-#include <decaf/network/SocketError.h>
+#include <decaf/net/SocketInputStream.h>
+#include <decaf/net/SocketError.h>
#include <decaf/io/IOException.h>
-#include <decaf/util/Character.h>
-#include <decaf/exceptions/UnsupportedOperationException.h>
+#include <decaf/lang/Character.h>
+#include <decaf/lang/exceptions/UnsupportedOperationException.h>
#include <stdlib.h>
#include <string>
#include <stdio.h>
@@ -52,7 +52,7 @@
using namespace std;
////////////////////////////////////////////////////////////////////////////////
-SocketInputStream::SocketInputStream( network::Socket::SocketHandle socket )
+SocketInputStream::SocketInputStream( net::Socket::SocketHandle socket )
{
this->socket = socket;
}
@@ -63,7 +63,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-std::size_t SocketInputStream::available() const throw (activemq::io::IOException){
+std::size_t SocketInputStream::available() const throw ( io::IOException ){
// The windows version
#if defined(HAVE_WINSOCK2_H)
@@ -117,7 +117,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-unsigned char SocketInputStream::read() throw (IOException){
+unsigned char SocketInputStream::read() throw ( IOException ){
unsigned char c;
std::size_t len = read( &c, 1 );
@@ -131,7 +131,7 @@
////////////////////////////////////////////////////////////////////////////////
std::size_t SocketInputStream::read( unsigned char* buffer,
- std::size_t bufferSize ) throw (IOException)
+ std::size_t bufferSize ) throw ( IOException )
{
int len = 0;
@@ -163,8 +163,9 @@
////////////////////////////////////////////////////////////////////////////////
std::size_t SocketInputStream::skip( std::size_t num AMQCPP_UNUSED )
-throw ( io::IOException, exceptions::UnsupportedOperationException ) {
- throw exceptions::UnsupportedOperationException(__FILE__, __LINE__,
+throw ( io::IOException, lang::exceptions::UnsupportedOperationException ) {
+ throw lang::exceptions::UnsupportedOperationException(
+ __FILE__, __LINE__,
"skip() method is not supported");
}
Modified: activemq/activemq-cpp/trunk/src/main/decaf/net/SocketInputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/net/SocketInputStream.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/net/SocketInputStream.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/net/SocketInputStream.h Wed May 30 11:43:33 2007
@@ -20,7 +20,7 @@
#include <decaf/io/InputStream.h>
#include <decaf/net/Socket.h>
-#include <decaf/lang/Mutex.h>
+#include <decaf/util/concurrent/Mutex.h>
#include <decaf/lang/Exception.h>
namespace decaf{
@@ -36,7 +36,7 @@
// The socket handle.
Socket::SocketHandle socket;
- concurrent::Mutex mutex;
+ util::concurrent::Mutex mutex;
public:
@@ -117,7 +117,7 @@
* @return The number of bytes currently available to
* be read on the socket.
*/
- virtual std::size_t available() const throw (activemq::io::IOException);
+ virtual std::size_t available() const throw ( io::IOException );
/**
* Reads a single byte from the buffer. If no data
@@ -137,14 +137,14 @@
*/
virtual std::size_t read( unsigned char* buffer,
std::size_t bufferSize )
- throw (io::IOException);
+ throw ( io::IOException );
/**
* Close - does nothing. It is the responsibility of the owner
* of the socket object to close it.
* @throws CMSException
*/
- virtual void close() throw( cms::CMSException ){}
+ virtual void close() throw( lang::Exception ){}
/**
* Not supported.
@@ -152,7 +152,7 @@
*/
virtual std::size_t skip( std::size_t num )
throw ( io::IOException,
- exceptions::UnsupportedOperationException );
+ lang::exceptions::UnsupportedOperationException );
};
Modified: activemq/activemq-cpp/trunk/src/main/decaf/net/SocketOutputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/net/SocketOutputStream.h?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/net/SocketOutputStream.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/net/SocketOutputStream.h Wed May 30 11:43:33 2007
@@ -20,7 +20,7 @@
#include <decaf/io/OutputStream.h>
#include <decaf/net/Socket.h>
-#include <decaf/lang/Mutex.h>
+#include <decaf/util/concurrent/Mutex.h>
namespace decaf{
namespace net{
@@ -35,7 +35,7 @@
// The socket.
Socket::SocketHandle socket;
- lang::Mutex mutex;
+ util::concurrent::Mutex mutex;
public:
Modified: activemq/activemq-cpp/trunk/src/main/decaf/net/TcpSocket.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/net/TcpSocket.cpp?view=diff&rev=542904&r1=542903&r2=542904
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/net/TcpSocket.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/net/TcpSocket.cpp Wed May 30 11:43:33 2007
@@ -51,6 +51,7 @@
using namespace decaf;
using namespace decaf::net;
using namespace decaf::io;
+using namespace decaf::lang;
#if defined(HAVE_WINSOCK2_H)
@@ -92,8 +93,8 @@
}
#endif
}
- AMQ_CATCH_RETHROW( SocketException )
- AMQ_CATCHALL_THROW( SocketException )
+ DECAF_CATCH_RETHROW( SocketException )
+ DECAF_CATCHALL_THROW( SocketException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -115,8 +116,8 @@
this->inputStream = new SocketInputStream( socketHandle );
this->outputStream = new SocketOutputStream( socketHandle );
}
- AMQ_CATCH_RETHROW( SocketException )
- AMQ_CATCHALL_THROW( SocketException )
+ DECAF_CATCH_RETHROW( SocketException )
+ DECAF_CATCHALL_THROW( SocketException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -204,17 +205,17 @@
}
catch( SocketException& ex ) {
ex.setMark( __FILE__, __LINE__);
- try{ close(); } catch( cms::CMSException& cx){ /* Absorb */ }
+ try{ close(); } catch( lang::Exception& cx){ /* Absorb */ }
throw ex;
}
catch( ... ){
- try{ close(); } catch( cms::CMSException& cx){ /* Absorb */ }
+ try{ close(); } catch( lang::Exception& cx){ /* Absorb */ }
throw SocketException( __FILE__, __LINE__, "connect() caught unknown exception");
}
}
////////////////////////////////////////////////////////////////////////////////
-void TcpSocket::close() throw( cms::CMSException )
+void TcpSocket::close() throw( lang::Exception )
{
// Destroy the input stream.
if( inputStream != NULL ){
@@ -252,8 +253,8 @@
return value.l_onoff? value.l_linger : 0;
}
- AMQ_CATCH_RETHROW( SocketException )
- AMQ_CATCHALL_THROW( SocketException )
+ DECAF_CATCH_RETHROW( SocketException )
+ DECAF_CATCHALL_THROW( SocketException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -265,8 +266,8 @@
value.l_linger = dolinger;
checkResult(::setsockopt( socketHandle, SOL_SOCKET, SO_LINGER, (char*)&value, sizeof(value) ));
}
- AMQ_CATCH_RETHROW( SocketException )
- AMQ_CATCHALL_THROW( SocketException )
+ DECAF_CATCH_RETHROW( SocketException )
+ DECAF_CATCHALL_THROW( SocketException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -278,8 +279,8 @@
checkResult(::getsockopt( socketHandle, SOL_SOCKET, SO_KEEPALIVE, (char*)&value, &length ));
return value != 0;
}
- AMQ_CATCH_RETHROW( SocketException )
- AMQ_CATCHALL_THROW( SocketException )
+ DECAF_CATCH_RETHROW( SocketException )
+ DECAF_CATCHALL_THROW( SocketException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -289,8 +290,8 @@
int value = keepAlive? 1 : 0;
checkResult(::setsockopt(socketHandle, SOL_SOCKET, SO_KEEPALIVE, (char*)&value, sizeof(int)) );
}
- AMQ_CATCH_RETHROW( SocketException )
- AMQ_CATCHALL_THROW( SocketException )
+ DECAF_CATCH_RETHROW( SocketException )
+ DECAF_CATCHALL_THROW( SocketException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -302,8 +303,8 @@
checkResult(::getsockopt( socketHandle, SOL_SOCKET, SO_RCVBUF, (char*)&value, &length ));
return value;
}
- AMQ_CATCH_RETHROW( SocketException )
- AMQ_CATCHALL_THROW( SocketException )
+ DECAF_CATCH_RETHROW( SocketException )
+ DECAF_CATCHALL_THROW( SocketException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -312,8 +313,8 @@
try{
checkResult(::setsockopt( socketHandle, SOL_SOCKET, SO_RCVBUF, (char*)&size, sizeof(size) ));
}
- AMQ_CATCH_RETHROW( SocketException )
- AMQ_CATCHALL_THROW( SocketException )
+ DECAF_CATCH_RETHROW( SocketException )
+ DECAF_CATCHALL_THROW( SocketException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -325,8 +326,8 @@
checkResult(::getsockopt( socketHandle, SOL_SOCKET, SO_REUSEADDR, (char*)&value, &length ));
return value != 0;
}
- AMQ_CATCH_RETHROW( SocketException )
- AMQ_CATCHALL_THROW( SocketException )
+ DECAF_CATCH_RETHROW( SocketException )
+ DECAF_CATCHALL_THROW( SocketException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -336,8 +337,8 @@
int value = reuse? 1 : 0;
checkResult(::setsockopt( socketHandle, SOL_SOCKET, SO_REUSEADDR, (char*)&value, sizeof(int) ));
}
- AMQ_CATCH_RETHROW( SocketException )
- AMQ_CATCHALL_THROW( SocketException )
+ DECAF_CATCH_RETHROW( SocketException )
+ DECAF_CATCHALL_THROW( SocketException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -349,8 +350,8 @@
checkResult(::getsockopt( socketHandle, SOL_SOCKET, SO_SNDBUF, (char*)&value, &length ));
return value;
}
- AMQ_CATCH_RETHROW( SocketException )
- AMQ_CATCHALL_THROW( SocketException )
+ DECAF_CATCH_RETHROW( SocketException )
+ DECAF_CATCHALL_THROW( SocketException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -359,8 +360,8 @@
try{
checkResult(::setsockopt( socketHandle, SOL_SOCKET, SO_SNDBUF, (char*)&size, sizeof(size) ));
}
- AMQ_CATCH_RETHROW( SocketException )
- AMQ_CATCHALL_THROW( SocketException )
+ DECAF_CATCH_RETHROW( SocketException )
+ DECAF_CATCHALL_THROW( SocketException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -379,8 +380,8 @@
checkResult(::setsockopt( socketHandle, SOL_SOCKET, SO_RCVTIMEO, (const char*) &timot, sizeof (timot) ));
checkResult(::setsockopt( socketHandle, SOL_SOCKET, SO_SNDTIMEO, (const char*) &timot, sizeof (timot) ));
}
- AMQ_CATCH_RETHROW( SocketException )
- AMQ_CATCHALL_THROW( SocketException )
+ DECAF_CATCH_RETHROW( SocketException )
+ DECAF_CATCHALL_THROW( SocketException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -407,13 +408,13 @@
#endif
}
- AMQ_CATCH_RETHROW( SocketException )
- AMQ_CATCHALL_THROW( SocketException )
+ DECAF_CATCH_RETHROW( SocketException )
+ DECAF_CATCHALL_THROW( SocketException )
}
////////////////////////////////////////////////////////////////////////////////
-bool TcpSocket::getTcpNoDelay() const throw ( cms::CMSException ) {
+bool TcpSocket::getTcpNoDelay() const throw ( lang::Exception ) {
try{
int value;
@@ -421,19 +422,19 @@
checkResult(::getsockopt( socketHandle, IPPROTO_TCP, TCP_NODELAY, (char*)&value, &length ));
return value != 0;
}
- AMQ_CATCH_RETHROW( SocketException )
- AMQ_CATCHALL_THROW( SocketException )
+ DECAF_CATCH_RETHROW( SocketException )
+ DECAF_CATCHALL_THROW( SocketException )
}
////////////////////////////////////////////////////////////////////////////////
-void TcpSocket::setTcpNoDelay( bool value ) throw ( cms::CMSException ) {
+void TcpSocket::setTcpNoDelay( bool value ) throw ( lang::Exception ) {
try{
int ivalue = value ? 1 : 0;
checkResult(::setsockopt( socketHandle, IPPROTO_TCP, TCP_NODELAY, (char*)&ivalue, sizeof(int) ));
}
- AMQ_CATCH_RETHROW( SocketException )
- AMQ_CATCHALL_THROW( SocketException )
+ DECAF_CATCH_RETHROW( SocketException )
+ DECAF_CATCHALL_THROW( SocketException )
}
////////////////////////////////////////////////////////////////////////////////