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 2009/01/28 21:59:10 UTC
svn commit: r738619 [3/3] - in /activemq/activemq-cpp/trunk/src: main/
main/activemq/commands/ main/activemq/core/ main/activemq/state/
main/activemq/transport/ main/activemq/transport/correlator/
main/activemq/transport/failover/ main/activemq/transpo...
Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransport.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransport.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransport.h Wed Jan 28 20:59:07 2009
@@ -21,7 +21,7 @@
#include <activemq/util/Config.h>
#include <activemq/transport/Transport.h>
#include <activemq/transport/TransportListener.h>
-#include <activemq/transport/Command.h>
+#include <activemq/commands/Command.h>
#include <activemq/exceptions/ActiveMQException.h>
#include <decaf/lang/Runnable.h>
@@ -96,7 +96,7 @@
* Notify the command listener.
* @param command the command the send
*/
- void fire( Command* command );
+ void fire( commands::Command* command );
public:
@@ -124,7 +124,7 @@
* @throws UnsupportedOperationException if this method is not implemented
* by this transport.
*/
- virtual void oneway( Command* command )
+ virtual void oneway( commands::Command* command )
throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException );
/**
@@ -133,7 +133,7 @@
* @returns the response to the command sent.
* @throws UnsupportedOperationException.
*/
- virtual Response* request( Command* command )
+ virtual commands::Response* request( commands::Command* command )
throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException );
/**
@@ -143,7 +143,7 @@
* @returns the response to the command sent.
* @throws UnsupportedOperationException.
*/
- virtual Response* request( Command* command, unsigned int timeout )
+ virtual commands::Response* request( commands::Command* command, unsigned int timeout )
throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException );
/**
Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/Transport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/Transport.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/Transport.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/Transport.h Wed Jan 28 20:59:07 2009
@@ -23,8 +23,8 @@
#include <decaf/lang/exceptions/UnsupportedOperationException.h>
#include <activemq/util/Config.h>
#include <activemq/transport/CommandIOException.h>
-#include <activemq/transport/Command.h>
-#include <activemq/transport/Response.h>
+#include <activemq/commands/Command.h>
+#include <activemq/commands/Response.h>
#include <cms/Startable.h>
#include <cms/Closeable.h>
#include <typeinfo>
@@ -63,7 +63,7 @@
* @throws UnsupportedOperationException if this method is not implemented
* by this transport.
*/
- virtual void oneway( Command* command )
+ virtual void oneway( commands::Command* command )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException ) = 0;
@@ -76,7 +76,7 @@
* @throws UnsupportedOperationException if this method is not implemented
* by this transport.
*/
- virtual Response* request( Command* command )
+ virtual commands::Response* request( commands::Command* command )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException ) = 0;
@@ -90,7 +90,7 @@
* @throws UnsupportedOperationException if this method is not implemented
* by this transport.
*/
- virtual Response* request( Command* command, unsigned int timeout )
+ virtual commands::Response* request( commands::Command* command, unsigned int timeout )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException ) = 0;
Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFilter.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFilter.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFilter.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFilter.h Wed Jan 28 20:59:07 2009
@@ -21,7 +21,7 @@
#include <activemq/util/Config.h>
#include <activemq/exceptions/ActiveMQException.h>
#include <activemq/transport/Transport.h>
-#include <activemq/transport/Command.h>
+#include <activemq/commands/Command.h>
#include <activemq/transport/TransportListener.h>
#include <typeinfo>
@@ -33,10 +33,8 @@
* filters implement the Transport interface and
* optionally delegate calls to another Transport object.
*/
- class AMQCPP_API TransportFilter :
- public Transport,
- public TransportListener {
-
+ class AMQCPP_API TransportFilter : public Transport,
+ public TransportListener {
protected:
/**
@@ -74,7 +72,7 @@
* Notify the command listener.
* @param command - the command to send to the listener
*/
- void fire( Command* command ){
+ void fire( commands::Command* command ){
try{
if( listener != NULL ){
listener->onCommand( command );
@@ -99,7 +97,7 @@
* Event handler for the receipt of a command.
* @param command - the received command object.
*/
- virtual void onCommand( Command* command ){
+ virtual void onCommand( commands::Command* command ){
fire( command );
}
@@ -130,7 +128,7 @@
* @throws UnsupportedOperationException if this method is not implemented
* by this transport.
*/
- virtual void oneway( Command* command )
+ virtual void oneway( commands::Command* command )
throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException ){
next->oneway( command );
@@ -142,7 +140,7 @@
* @throws CommandIOException
* @throws UnsupportedOperationException.
*/
- virtual Response* request( Command* command )
+ virtual commands::Response* request( commands::Command* command )
throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException ){
return next->request( command );
@@ -155,7 +153,7 @@
* @throws CommandIOException
* @throws UnsupportedOperationException.
*/
- virtual Response* request( Command* command, unsigned int timeout )
+ virtual commands::Response* request( commands::Command* command, unsigned int timeout )
throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException ){
return next->request( command, timeout );
Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportListener.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportListener.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportListener.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportListener.h Wed Jan 28 20:59:07 2009
@@ -22,11 +22,13 @@
#include <decaf/lang/Exception.h>
namespace activemq{
+namespace commands{
+ class Command;
+}
namespace transport{
// Forward declarations.
class Transport;
- class Command;
/**
* A listener of asynchronous exceptions from a command transport object.
@@ -44,7 +46,7 @@
*
* @param command the received command object.
*/
- virtual void onCommand( Command* command ) = 0;
+ virtual void onCommand( commands::Command* command ) = 0;
/**
* Event handler for an exception from a command transport.
Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/FutureResponse.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/FutureResponse.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/FutureResponse.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/FutureResponse.h Wed Jan 28 20:59:07 2009
@@ -21,7 +21,7 @@
#include <activemq/util/Config.h>
#include <decaf/util/concurrent/Mutex.h>
#include <decaf/util/concurrent/CountDownLatch.h>
-#include <activemq/transport/Response.h>
+#include <activemq/commands/Response.h>
#include <activemq/exceptions/ActiveMQException.h>
@@ -38,7 +38,7 @@
private:
mutable decaf::util::concurrent::CountDownLatch responseLatch;
- Response* response;
+ commands::Response* response;
public:
@@ -52,11 +52,11 @@
* Getters for the response property. Infinite Wait.
* @return the response object for the request
*/
- virtual const Response* getResponse() const{
+ virtual const commands::Response* getResponse() const{
this->responseLatch.await();
return response;
}
- virtual Response* getResponse(){
+ virtual commands::Response* getResponse(){
this->responseLatch.await();
return response;
}
@@ -66,11 +66,11 @@
* @param timeout - time to wait in milliseconds
* @return the response object for the request
*/
- virtual const Response* getResponse( unsigned timeout ) const{
+ virtual const commands::Response* getResponse( unsigned timeout ) const{
this->responseLatch.await( timeout );
return response;
}
- virtual Response* getResponse( unsigned int timeout ){
+ virtual commands::Response* getResponse( unsigned int timeout ){
this->responseLatch.await( timeout );
return response;
}
@@ -79,7 +79,7 @@
* Setter for the response property.
* @param response the response object for the request.
*/
- virtual void setResponse( Response* response ){
+ virtual void setResponse( commands::Response* response ){
this->response = response;
this->responseLatch.countDown();
}
Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.cpp Wed Jan 28 20:59:07 2009
@@ -44,7 +44,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-void ResponseCorrelator::oneway( Command* command )
+void ResponseCorrelator::oneway( commands::Command* command )
throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException ) {
try{
@@ -66,7 +66,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-Response* ResponseCorrelator::request( Command* command )
+commands::Response* ResponseCorrelator::request( commands::Command* command )
throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException ) {
try{
@@ -84,7 +84,7 @@
// Wait to be notified of the response via the futureResponse
// object.
- Response* response = NULL;
+ commands::Response* response = NULL;
// Send the request.
next->oneway( command );
@@ -124,7 +124,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-Response* ResponseCorrelator::request( Command* command, unsigned int timeout )
+commands::Response* ResponseCorrelator::request( commands::Command* command, unsigned int timeout )
throw( CommandIOException, decaf::lang::exceptions::UnsupportedOperationException ) {
try{
@@ -142,7 +142,7 @@
// Wait to be notified of the response via the futureResponse
// object.
- Response* response = NULL;
+ commands::Response* response = NULL;
// Send the request.
next->oneway( command );
@@ -182,10 +182,10 @@
}
////////////////////////////////////////////////////////////////////////////////
-void ResponseCorrelator::onCommand( Command* command ) {
+void ResponseCorrelator::onCommand( commands::Command* command ) {
// Let's see if the incoming command is a response.
- Response* response = dynamic_cast<Response*>( command );
+ commands::Response* response = dynamic_cast<commands::Response*>( command );
if( response == NULL ){
Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.h Wed Jan 28 20:59:07 2009
@@ -21,7 +21,8 @@
#include <activemq/util/Config.h>
#include <activemq/transport/TransportFilter.h>
#include <activemq/transport/correlator/FutureResponse.h>
-#include <activemq/transport/Command.h>
+#include <activemq/commands/Command.h>
+#include <activemq/commands/Response.h>
#include <decaf/util/concurrent/Mutex.h>
#include <decaf/util/concurrent/Concurrent.h>
#include <decaf/util/concurrent/atomic/AtomicInteger.h>
@@ -81,7 +82,7 @@
* @throws UnsupportedOperationException if this method is not implemented
* by this transport.
*/
- virtual void oneway( Command* command )
+ virtual void oneway( commands::Command* command )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException );
@@ -91,7 +92,7 @@
* @return the response from the server.
* @throws CommandIOException if an error occurs with the request.
*/
- virtual Response* request( Command* command )
+ virtual commands::Response* request( commands::Command* command )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException );
@@ -102,7 +103,7 @@
* @return the response from the server.
* @throws CommandIOException if an error occurs with the request.
*/
- virtual Response* request( Command* command, unsigned int timeout )
+ virtual commands::Response* request( commands::Command* command, unsigned int timeout )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException );
@@ -114,7 +115,7 @@
* the command listener.
* @param command the received from the nested transport.
*/
- virtual void onCommand( Command* command );
+ virtual void onCommand( commands::Command* command );
/**
* Starts this transport object and creates the thread for
Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.cpp Wed Jan 28 20:59:07 2009
@@ -62,14 +62,14 @@
}
////////////////////////////////////////////////////////////////////////////////
-void FailoverTransport::oneway( Command* command )
+void FailoverTransport::oneway( commands::Command* command )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException ) {
}
////////////////////////////////////////////////////////////////////////////////
-Response* FailoverTransport::request( Command* command AMQCPP_UNUSED )
+commands::Response* FailoverTransport::request( commands::Command* command AMQCPP_UNUSED )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException ) {
@@ -78,7 +78,8 @@
}
////////////////////////////////////////////////////////////////////////////////
-Response* FailoverTransport::request( Command* command AMQCPP_UNUSED, unsigned int timeout AMQCPP_UNUSED )
+commands::Response* FailoverTransport::request( commands::Command* command AMQCPP_UNUSED,
+ unsigned int timeout AMQCPP_UNUSED )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException ) {
Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.h Wed Jan 28 20:59:07 2009
@@ -20,6 +20,7 @@
#include <activemq/util/Config.h>
+#include <activemq/commands/Command.h>
#include <activemq/transport/CompositeTransport.h>
#include <decaf/util/Set.h>
@@ -124,7 +125,7 @@
* @throws UnsupportedOperationException if this method is not implemented
* by this transport.
*/
- virtual void oneway( Command* command )
+ virtual void oneway( commands::Command* command )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException );
@@ -137,7 +138,7 @@
* @throws UnsupportedOperationException if this method is not implemented
* by this transport.
*/
- virtual Response* request( Command* command )
+ virtual commands::Response* request( commands::Command* command )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException );
@@ -151,7 +152,7 @@
* @throws UnsupportedOperationException if this method is not implemented
* by this transport.
*/
- virtual Response* request( Command* command, unsigned int timeout )
+ virtual commands::Response* request( commands::Command* command, unsigned int timeout )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException );
@@ -159,13 +160,13 @@
* Sets the WireFormat instance to use.
* @param WireFormat the object used to encode / decode commands.
*/
- virtual void setWireFormat( wireformat::WireFormat* wireFormat );
+ virtual void setWireFormat( wireformat::WireFormat* wireFormat ) {}
/**
* Sets the observer of asynchronous events from this transport.
* @param listener the listener of transport events.
*/
- virtual void setTransportListener( TransportListener* listener );
+ virtual void setTransportListener( TransportListener* listener ) {}
/**
* Is this Transport fault tolerant, meaning that it will reconnect to
Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.cpp Wed Jan 28 20:59:07 2009
@@ -34,7 +34,7 @@
{}
////////////////////////////////////////////////////////////////////////////////
-void LoggingTransport::onCommand( Command* command ) {
+void LoggingTransport::onCommand( commands::Command* command ) {
ostringstream ostream;
ostream << "*** BEGIN RECEIVED ASYNCHRONOUS COMMAND ***" << endl;
@@ -48,7 +48,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-void LoggingTransport::oneway( Command* command )
+void LoggingTransport::oneway( commands::Command* command )
throw(CommandIOException, decaf::lang::exceptions::UnsupportedOperationException) {
try {
@@ -70,13 +70,13 @@
}
////////////////////////////////////////////////////////////////////////////////
-Response* LoggingTransport::request( Command* command )
+commands::Response* LoggingTransport::request( commands::Command* command )
throw(CommandIOException, decaf::lang::exceptions::UnsupportedOperationException) {
try {
// Delegate to the base class.
- Response* response = TransportFilter::request( command );
+ commands::Response* response = TransportFilter::request( command );
ostringstream ostream;
ostream << "*** SENDING REQUEST COMMAND ***" << endl;
@@ -95,13 +95,13 @@
}
////////////////////////////////////////////////////////////////////////////////
-Response* LoggingTransport::request( Command* command, unsigned int timeout )
+commands::Response* LoggingTransport::request( commands::Command* command, unsigned int timeout )
throw(CommandIOException, decaf::lang::exceptions::UnsupportedOperationException) {
try {
// Delegate to the base class.
- Response* response = TransportFilter::request( command, timeout );
+ commands::Response* response = TransportFilter::request( command, timeout );
ostringstream ostream;
ostream << "*** SENDING REQUEST COMMAND: Timeout = " << timeout << " ***" << endl;
Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.h Wed Jan 28 20:59:07 2009
@@ -49,7 +49,7 @@
* Event handler for the receipt of a command.
* @param command - the received command object.
*/
- virtual void onCommand( Command* command );
+ virtual void onCommand( commands::Command* command );
/**
* Sends a one-way command. Does not wait for any response from the
@@ -60,7 +60,7 @@
* @throws UnsupportedOperationException if this method is not implemented
* by this transport.
*/
- virtual void oneway( Command* command )
+ virtual void oneway( commands::Command* command )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException);
@@ -69,7 +69,7 @@
* @param command the command that is sent as a request
* @throws UnsupportedOperationException.
*/
- virtual Response* request( Command* command )
+ virtual commands::Response* request( commands::Command* command )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException);
@@ -79,7 +79,7 @@
* @param timeout the time to wait for a response.
* @throws UnsupportedOperationException.
*/
- virtual Response* request( Command* command, unsigned int timeout )
+ virtual commands::Response* request( commands::Command* command, unsigned int timeout )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException);
Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransport.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransport.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransport.cpp Wed Jan 28 20:59:07 2009
@@ -57,7 +57,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-void MockTransport::oneway( Command* command )
+void MockTransport::oneway( commands::Command* command )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException) {
@@ -80,7 +80,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-Response* MockTransport::request( Command* command )
+commands::Response* MockTransport::request( commands::Command* command )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException)
{
@@ -110,7 +110,8 @@
}
////////////////////////////////////////////////////////////////////////////////
-Response* MockTransport::request( Command* command, unsigned int timeout AMQCPP_UNUSED )
+commands::Response* MockTransport::request( commands::Command* command,
+ unsigned int timeout AMQCPP_UNUSED )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException)
{
Modified: activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransport.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransport.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransport.h Wed Jan 28 20:59:07 2009
@@ -70,7 +70,7 @@
* @param command - The command to build a response for
* @return A Response object pointer, or NULL if no response.
*/
- virtual Response* buildResponse( const Command* command ) = 0;
+ virtual commands::Response* buildResponse( const commands::Command* command ) = 0;
/**
* When called the ResponseBuilder must construct all the
@@ -80,7 +80,8 @@
* @param queue - Queue of Command sent back from the broker.
*/
virtual void buildIncomingCommands(
- const Command* cmd, decaf::util::Queue<Command*>& queue ) = 0;
+ const commands::Command* cmd,
+ decaf::util::Queue<commands::Command*>& queue ) = 0;
};
@@ -101,7 +102,7 @@
ResponseBuilder* responseBuilder;
bool done;
decaf::util::concurrent::CountDownLatch startedLatch;
- decaf::util::Queue<Command*> inboundQueue;
+ decaf::util::Queue<commands::Command*> inboundQueue;
public:
@@ -134,7 +135,7 @@
this->responseBuilder = responseBuilder;
}
- virtual void onCommand( Command* command ) {
+ virtual void onCommand( commands::Command* command ) {
synchronized( &inboundQueue )
{
// Create a response now before the caller has a
@@ -203,15 +204,15 @@
this->responseBuilder = responseBuilder;
}
- virtual void oneway( Command* command )
+ virtual void oneway( commands::Command* command )
throw(CommandIOException, decaf::lang::exceptions::UnsupportedOperationException);
- virtual Response* request( Command* command )
+ virtual commands::Response* request( commands::Command* command )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException);
- virtual Response* request( Command* command, unsigned int timeout )
+ virtual commands::Response* request( commands::Command* command, unsigned int timeout )
throw( CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException);
@@ -240,7 +241,7 @@
* CommandListener if there is one.
* @param command - Command to send to the Listener.
*/
- virtual void fireCommand( Command* command ){
+ virtual void fireCommand( commands::Command* command ){
if( listener != NULL ){
listener->onCommand( command );
}
Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormat.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormat.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormat.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormat.h Wed Jan 28 20:59:07 2009
@@ -25,7 +25,7 @@
#include <decaf/io/IOException.h>
#include <activemq/util/Config.h>
-#include <activemq/transport/Command.h>
+#include <activemq/commands/Command.h>
#include <activemq/transport/Transport.h>
#include <decaf/lang/exceptions/UnsupportedOperationException.h>
@@ -50,7 +50,7 @@
* @param out - the output stream to write the command to.
* @throws IOException
*/
- virtual void marshal( transport::Command* command, decaf::io::DataOutputStream* out )
+ virtual void marshal( commands::Command* command, decaf::io::DataOutputStream* out )
throw ( decaf::io::IOException ) = 0;
/**
@@ -59,7 +59,7 @@
* @returns the newly marshaled Command, caller owns the pointer
* @throws IOException
*/
- virtual transport::Command* unmarshal( decaf::io::DataInputStream* in )
+ virtual commands::Command* unmarshal( decaf::io::DataInputStream* in )
throw ( decaf::io::IOException ) = 0;
/**
Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormat.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormat.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormat.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormat.cpp Wed Jan 28 20:59:07 2009
@@ -155,7 +155,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-void OpenWireFormat::marshal( transport::Command* command,
+void OpenWireFormat::marshal( commands::Command* command,
decaf::io::DataOutputStream* dataOut )
throw ( decaf::io::IOException ) {
@@ -226,7 +226,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-transport::Command* OpenWireFormat::unmarshal( decaf::io::DataInputStream* dis )
+commands::Command* OpenWireFormat::unmarshal( decaf::io::DataInputStream* dis )
throw ( decaf::io::IOException ) {
try {
@@ -246,10 +246,10 @@
}
// Now all unmarshals from this level should result in an object
- // that is a transport::Command type, if its not then we throw an
+ // that is a commands::Command type, if its not then we throw an
// exception.
- transport::Command* command =
- dynamic_cast< transport::Command* >( data );
+ commands::Command* command =
+ dynamic_cast< commands::Command* >( data );
if( command == NULL ) {
delete data;
Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormat.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormat.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormat.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormat.h Wed Jan 28 20:59:07 2009
@@ -77,7 +77,7 @@
* @param out - the output stream to write the command to.
* @throws IOException
*/
- virtual void marshal( transport::Command* command,
+ virtual void marshal( commands::Command* command,
decaf::io::DataOutputStream* dataOut )
throw ( decaf::io::IOException );
@@ -87,7 +87,7 @@
* @returns the newly marshaled Command, caller owns the pointer
* @throws IOException
*/
- virtual transport::Command* unmarshal( decaf::io::DataInputStream* dis )
+ virtual commands::Command* unmarshal( decaf::io::DataInputStream* dis )
throw ( decaf::io::IOException );
/**
Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormatNegotiator.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormatNegotiator.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormatNegotiator.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormatNegotiator.cpp Wed Jan 28 20:59:07 2009
@@ -52,7 +52,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-void OpenWireFormatNegotiator::oneway( Command* command )
+void OpenWireFormatNegotiator::oneway( commands::Command* command )
throw( CommandIOException, UnsupportedOperationException ) {
try{
@@ -81,7 +81,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-Response* OpenWireFormatNegotiator::request( Command* command )
+commands::Response* OpenWireFormatNegotiator::request( commands::Command* command )
throw( CommandIOException, UnsupportedOperationException ) {
try{
@@ -110,7 +110,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-Response* OpenWireFormatNegotiator::request( Command* command, unsigned int timeout )
+commands::Response* OpenWireFormatNegotiator::request( commands::Command* command, unsigned int timeout )
throw( CommandIOException, UnsupportedOperationException ) {
try{
@@ -139,7 +139,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-void OpenWireFormatNegotiator::onCommand( Command* command ) {
+void OpenWireFormatNegotiator::onCommand( commands::Command* command ) {
DataStructure* dataStructure =
dynamic_cast<DataStructure*>( command );
Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormatNegotiator.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormatNegotiator.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormatNegotiator.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormatNegotiator.h Wed Jan 28 20:59:07 2009
@@ -20,7 +20,6 @@
#include <activemq/util/Config.h>
#include <activemq/transport/TransportFilter.h>
-#include <activemq/transport/Command.h>
#include <activemq/wireformat/openwire/OpenWireFormat.h>
#include <activemq/wireformat/WireFormatNegotiator.h>
#include <decaf/util/concurrent/Mutex.h>
@@ -86,7 +85,7 @@
* @throws UnsupportedOperationException if this method is not implemented
* by this transport.
*/
- virtual void oneway( transport::Command* command )
+ virtual void oneway( commands::Command* command )
throw( transport::CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException );
@@ -98,7 +97,7 @@
* @return the response from the server.
* @throws CommandIOException if an error occurs with the request.
*/
- virtual transport::Response* request( transport::Command* command )
+ virtual commands::Response* request( commands::Command* command )
throw( transport::CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException );
@@ -111,7 +110,7 @@
* @return the response from the server.
* @throws CommandIOException if an error occurs with the request.
*/
- virtual transport::Response* request( transport::Command* command, unsigned int timeout )
+ virtual commands::Response* request( commands::Command* command, unsigned int timeout )
throw( transport::CommandIOException,
decaf::lang::exceptions::UnsupportedOperationException );
@@ -123,7 +122,7 @@
* the command listener.
* @param command the received from the nested transport.
*/
- virtual void onCommand( transport::Command* command );
+ virtual void onCommand( commands::Command* command );
/**
* Event handler for an exception from a command transport.
Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireResponseBuilder.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireResponseBuilder.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireResponseBuilder.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireResponseBuilder.cpp Wed Jan 28 20:59:07 2009
@@ -43,8 +43,8 @@
using namespace activemq::transport::mock;
////////////////////////////////////////////////////////////////////////////////
-Response* OpenWireResponseBuilder::buildResponse(
- const transport::Command* command ){
+commands::Response* OpenWireResponseBuilder::buildResponse(
+ const commands::Command* command ){
if( typeid( *command ) == typeid( commands::ActiveMQBytesMessage ) ||
typeid( *command ) == typeid( commands::ActiveMQMapMessage ) ||
@@ -78,7 +78,7 @@
////////////////////////////////////////////////////////////////////////////////
void OpenWireResponseBuilder::buildIncomingCommands(
- const transport::Command* command, decaf::util::Queue<transport::Command*>& queue ){
+ const commands::Command* command, decaf::util::Queue<commands::Command*>& queue ){
// Delegate this to buildResponse
if( command->isResponseRequired() ) {
@@ -89,6 +89,6 @@
// Return a copy of the callers own requested WireFormatInfo
// so they get exactly the settings they asked for.
- queue.push( command->cloneCommand() );
+ queue.push( dynamic_cast<commands::Command*>( command->cloneDataStructure() ) );
}
}
Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireResponseBuilder.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireResponseBuilder.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireResponseBuilder.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireResponseBuilder.h Wed Jan 28 20:59:07 2009
@@ -32,11 +32,11 @@
OpenWireResponseBuilder() {}
virtual ~OpenWireResponseBuilder() {}
- virtual transport::Response* buildResponse( const transport::Command* command );
+ virtual commands::Response* buildResponse( const commands::Command* command );
virtual void buildIncomingCommands(
- const transport::Command* command,
- decaf::util::Queue<transport::Command*>& queue );
+ const commands::Command* command,
+ decaf::util::Queue<commands::Command*>& queue );
};
Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/marshal/v1/BaseCommandMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/marshal/v1/BaseCommandMarshaller.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/marshal/v1/BaseCommandMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/marshal/v1/BaseCommandMarshaller.cpp Wed Jan 28 20:59:07 2009
@@ -45,8 +45,8 @@
BaseDataStreamMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
- transport::Command* info =
- dynamic_cast<transport::Command*>( dataStructure );
+ commands::Command* info =
+ dynamic_cast<commands::Command*>( dataStructure );
info->setCommandId( dataIn->readInt() );
info->setResponseRequired( bs->readBoolean() );
}
@@ -60,8 +60,8 @@
try {
- transport::Command* info =
- dynamic_cast<transport::Command*>( dataStructure );
+ commands::Command* info =
+ dynamic_cast<commands::Command*>( dataStructure );
int rc = BaseDataStreamMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
bs->writeBoolean( info->isResponseRequired() );
@@ -80,8 +80,8 @@
BaseDataStreamMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
- transport::Command* info =
- dynamic_cast<transport::Command*>( dataStructure );
+ commands::Command* info =
+ dynamic_cast<commands::Command*>( dataStructure );
dataOut->writeInt( info->getCommandId() );
bs->readBoolean();
}
@@ -96,8 +96,8 @@
try {
BaseDataStreamMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
- transport::Command* info =
- dynamic_cast<transport::Command*>( dataStructure );
+ commands::Command* info =
+ dynamic_cast<commands::Command*>( dataStructure );
info->setCommandId( dataIn->readInt() );
info->setResponseRequired( dataIn->readBoolean() );
}
@@ -111,8 +111,8 @@
try {
- transport::Command* info =
- dynamic_cast<transport::Command*>( dataStructure );
+ commands::Command* info =
+ dynamic_cast<commands::Command*>( dataStructure );
BaseDataStreamMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
dataOut->writeInt( info->getCommandId() );
Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/marshal/v2/BaseCommandMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/marshal/v2/BaseCommandMarshaller.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/marshal/v2/BaseCommandMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/marshal/v2/BaseCommandMarshaller.cpp Wed Jan 28 20:59:07 2009
@@ -45,8 +45,8 @@
BaseDataStreamMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
- transport::Command* info =
- dynamic_cast<transport::Command*>( dataStructure );
+ commands::Command* info =
+ dynamic_cast<commands::Command*>( dataStructure );
info->setCommandId( dataIn->readInt() );
info->setResponseRequired( bs->readBoolean() );
}
@@ -60,8 +60,8 @@
try {
- transport::Command* info =
- dynamic_cast<transport::Command*>( dataStructure );
+ commands::Command* info =
+ dynamic_cast<commands::Command*>( dataStructure );
int rc = BaseDataStreamMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
bs->writeBoolean( info->isResponseRequired() );
@@ -80,8 +80,8 @@
BaseDataStreamMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
- transport::Command* info =
- dynamic_cast<transport::Command*>( dataStructure );
+ commands::Command* info =
+ dynamic_cast<commands::Command*>( dataStructure );
dataOut->writeInt( info->getCommandId() );
bs->readBoolean();
}
@@ -96,8 +96,8 @@
try {
BaseDataStreamMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
- transport::Command* info =
- dynamic_cast<transport::Command*>( dataStructure );
+ commands::Command* info =
+ dynamic_cast<commands::Command*>( dataStructure );
info->setCommandId( dataIn->readInt() );
info->setResponseRequired( dataIn->readBoolean() );
}
@@ -111,8 +111,8 @@
try {
- transport::Command* info =
- dynamic_cast<transport::Command*>( dataStructure );
+ commands::Command* info =
+ dynamic_cast<commands::Command*>( dataStructure );
BaseDataStreamMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
dataOut->writeInt( info->getCommandId() );
Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/marshal/v3/BaseCommandMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/marshal/v3/BaseCommandMarshaller.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/marshal/v3/BaseCommandMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/marshal/v3/BaseCommandMarshaller.cpp Wed Jan 28 20:59:07 2009
@@ -45,8 +45,8 @@
BaseDataStreamMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
- transport::Command* info =
- dynamic_cast<transport::Command*>( dataStructure );
+ BaseCommand* info =
+ dynamic_cast<BaseCommand*>( dataStructure );
info->setCommandId( dataIn->readInt() );
info->setResponseRequired( bs->readBoolean() );
}
@@ -60,8 +60,8 @@
try {
- transport::Command* info =
- dynamic_cast<transport::Command*>( dataStructure );
+ BaseCommand* info =
+ dynamic_cast<BaseCommand*>( dataStructure );
int rc = BaseDataStreamMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
bs->writeBoolean( info->isResponseRequired() );
@@ -80,8 +80,8 @@
BaseDataStreamMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
- transport::Command* info =
- dynamic_cast<transport::Command*>( dataStructure );
+ BaseCommand* info =
+ dynamic_cast<BaseCommand*>( dataStructure );
dataOut->writeInt( info->getCommandId() );
bs->readBoolean();
}
@@ -96,8 +96,8 @@
try {
BaseDataStreamMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
- transport::Command* info =
- dynamic_cast<transport::Command*>( dataStructure );
+ BaseCommand* info =
+ dynamic_cast<BaseCommand*>( dataStructure );
info->setCommandId( dataIn->readInt() );
info->setResponseRequired( dataIn->readBoolean() );
}
@@ -111,8 +111,8 @@
try {
- transport::Command* info =
- dynamic_cast<transport::Command*>( dataStructure );
+ BaseCommand* info =
+ dynamic_cast<BaseCommand*>( dataStructure );
BaseDataStreamMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
dataOut->writeInt( info->getCommandId() );
Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompResponseBuilder.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompResponseBuilder.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompResponseBuilder.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompResponseBuilder.cpp Wed Jan 28 20:59:07 2009
@@ -33,13 +33,13 @@
using namespace decaf::util;
////////////////////////////////////////////////////////////////////////////////
-Response* StompResponseBuilder::buildResponse( const transport::Command* cmd ){
+Response* StompResponseBuilder::buildResponse( const commands::Command* cmd ){
// If this command requires a response we don't know what it is
// so we throw an exception.
if( cmd->isResponseRequired() ) {
- throw transport::CommandIOException( __FILE__, __LINE__,
+ throw commands::CommandIOException( __FILE__, __LINE__,
"StompResponseBuilder - unrecognized command" );
}
@@ -48,7 +48,7 @@
////////////////////////////////////////////////////////////////////////////////
void StompResponseBuilder::buildIncomingCommands(
- const transport::Command* command, decaf::util::Queue<transport::Command*>& queue ){
+ const commands::Command* command, decaf::util::Queue<commands::Command*>& queue ){
const connector::stomp::commands::ConnectCommand* connectCommand =
dynamic_cast<const connector::stomp::commands::ConnectCommand*>( command );
Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompResponseBuilder.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompResponseBuilder.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompResponseBuilder.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompResponseBuilder.h Wed Jan 28 20:59:07 2009
@@ -32,9 +32,9 @@
StompResponseBuilder() {}
virtual ~StompResponseBuilder() {}
- virtual transport::Response* buildResponse( const transport::Command* cmd );
+ virtual commands::Response* buildResponse( const commands::Command* cmd );
virtual void buildIncomingCommands(
- const transport::Command* cmd, decaf::util::Queue<transport::Command*>& queue );
+ const commands::Command* cmd, decaf::util::Queue<commands::Command*>& queue );
};
Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompWireFormat.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompWireFormat.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompWireFormat.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompWireFormat.cpp Wed Jan 28 20:59:07 2009
@@ -43,7 +43,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-void StompWireFormat::marshal( transport::Command* command, decaf::io::DataOutputStream* out )
+void StompWireFormat::marshal( commands::Command* command, decaf::io::DataOutputStream* out )
throw ( decaf::io::IOException ) {
try{
@@ -102,7 +102,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-transport::Command* StompWireFormat::unmarshal( decaf::io::DataInputStream* in )
+commands::Command* StompWireFormat::unmarshal( decaf::io::DataInputStream* in )
throw ( decaf::io::IOException ) {
auto_ptr<StompFrame> frame;
Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompWireFormat.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompWireFormat.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompWireFormat.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompWireFormat.h Wed Jan 28 20:59:07 2009
@@ -52,7 +52,7 @@
* @param out - the output stream to write the command to.
* @throws IOException
*/
- virtual void marshal( transport::Command* command, decaf::io::DataOutputStream* out )
+ virtual void marshal( commands::Command* command, decaf::io::DataOutputStream* out )
throw ( decaf::io::IOException );
/**
@@ -61,7 +61,7 @@
* @returns the newly marshaled Command, caller owns the pointer
* @throws IOException
*/
- virtual transport::Command* unmarshal( decaf::io::DataInputStream* in )
+ virtual commands::Command* unmarshal( decaf::io::DataInputStream* in )
throw ( decaf::io::IOException );
/**
Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshaler.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshaler.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshaler.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshaler.cpp Wed Jan 28 20:59:07 2009
@@ -44,14 +44,14 @@
using namespace decaf::lang;
////////////////////////////////////////////////////////////////////////////////
-transport::Command* Marshaler::marshal( StompFrame* frame )
+commands::Command* Marshaler::marshal( StompFrame* frame )
throw ( MarshalException ) {
try {
CommandConstants::CommandId commandId =
CommandConstants::toCommandId(frame->getCommand().c_str());
- transport::Command* command = NULL;
+ commands::Command* command = NULL;
if(commandId == CommandConstants::CONNECTED){
command = new ConnectedCommand( frame );
@@ -90,7 +90,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-const StompFrame& Marshaler::marshal( transport::Command* command )
+const StompFrame& Marshaler::marshal( commands::Command* command )
throw ( MarshalException ) {
try{
Modified: activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshaler.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshaler.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshaler.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshaler.h Wed Jan 28 20:59:07 2009
@@ -44,7 +44,7 @@
* @return Newly Marshaled Stomp Message
* @throws MarshalException
*/
- virtual transport::Command* marshal( StompFrame* frame )
+ virtual commands::Command* marshal( StompFrame* frame )
throw ( MarshalException );
/**
@@ -56,7 +56,7 @@
* @throws MarshalException
*/
virtual const StompFrame& marshal(
- transport::Command* command )
+ commands::Command* command )
throw ( MarshalException );
};
Modified: activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppClassesGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppClassesGenerator.java?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppClassesGenerator.java (original)
+++ activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppClassesGenerator.java Wed Jan 28 20:59:07 2009
@@ -53,24 +53,6 @@
return ".cpp";
}
- protected String getProperBaseClassName( String className, String baseClass ) {
-
- if( baseClass == null || className == null ) {
- return null;
- }
-
- // The C++ BaseCommand class is a template, which requires either
- // transport::Command, or transport::Response.
- if( className.equals( "Response" ) ) {
- return "BaseCommand<transport::Response>";
- } else if( baseClass.equals( "BaseCommand" ) ) {
- return "BaseCommand<transport::Command>";
- }
-
- // No change.
- return baseClass;
- }
-
public String toCppType(JClass type) {
String name = type.getSimpleName();
if (name.equals("String")) {
@@ -153,6 +135,7 @@
protected void generateFile(PrintWriter out) throws Exception {
generateLicence(out);
out.println("#include <activemq/commands/"+className+".h>");
+out.println("#include <activemq/state/CommandVisitor.h>");
out.println("#include <activemq/exceptions/ActiveMQException.h>");
out.println("#include <decaf/lang/exceptions/NullPointerException.h>");
out.println("");
@@ -236,7 +219,7 @@
if( baseClass != null ) {
out.println(" // Copy the data of the base class or classes");
-out.println(" "+getProperBaseClassName( className, baseClass )+"::copyDataStructure( src );");
+out.println(" "+ baseClass +"::copyDataStructure( src );");
out.println("");
}
@@ -364,7 +347,7 @@
}
if( baseClass != null ) {
-out.println(" stream << "+getProperBaseClassName( className, baseClass )+"::toString();");
+out.println(" stream << "+ baseClass +"::toString();");
}
out.println(" stream << \"End Class = "+className+"\" << std::endl;" );
@@ -441,7 +424,7 @@
}
if( baseClass != null ) {
-out.println(" if( !"+getProperBaseClassName( className, baseClass )+"::equals( value ) ) {");
+out.println(" if( !"+ baseClass +"::equals( value ) ) {");
out.println(" return false;");
out.println(" }");
}
@@ -463,6 +446,16 @@
out.println("}");
}
+ if( baseClass.equals( "BaseCommand" ) ) {
+out.println("");
+out.println("////////////////////////////////////////////////////////////////////////////////");
+out.println("commands::Command* "+className+"::visit( activemq::state::CommandVisitor* visitor ) ");
+out.println(" throw( exceptions::ActiveMQException ) {");
+out.println("");
+out.println(" return visitor->process"+className+"( this );");
+out.println("}");
+ }
+
for( Iterator iter = properties.iterator(); iter.hasNext(); ) {
JProperty property = (JProperty) iter.next();
String type = toCppType(property.getType());
Modified: activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppHeadersGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppHeadersGenerator.java?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppHeadersGenerator.java (original)
+++ activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppHeadersGenerator.java Wed Jan 28 20:59:07 2009
@@ -88,7 +88,7 @@
out.println(" * in the activemq-openwire-generator module");
out.println(" *");
out.println(" */");
-out.println(" class AMQCPP_API "+className+" : public "+getProperBaseClassName( className, baseClass )+" {" );
+out.println(" class AMQCPP_API "+className+" : public "+ baseClass +" {" );
out.println(" protected:");
out.println("");
@@ -175,6 +175,21 @@
out.println("");
}
+
+ if( baseClass.equals( "BaseCommand" ) ) {
+
+out.println(" /**" );
+out.println(" * Allows a Visitor to visit this command and return a response to the" );
+out.println(" * command based on the command type being visited. The command will call" );
+out.println(" * the proper processXXX method in the visitor." );
+out.println(" * " );
+out.println(" * @return a Response to the visitor being called or NULL if no response." );
+out.println(" */" );
+out.println(" virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )" );
+out.println(" throw( exceptions::ActiveMQException );" );
+out.println("");
+
+ }
for( Iterator iter = properties.iterator(); iter.hasNext(); ) {
JProperty property = (JProperty) iter.next();
Modified: activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppMarshallingClassesGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppMarshallingClassesGenerator.java?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppMarshallingClassesGenerator.java (original)
+++ activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppMarshallingClassesGenerator.java Wed Jan 28 20:59:07 2009
@@ -41,10 +41,6 @@
protected String getProperClassName( String className ) {
- if( className.equals( "BaseCommand") ) {
- return "transport::Command";
- }
-
return className;
}
Modified: activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.h Wed Jan 28 20:59:07 2009
@@ -49,7 +49,7 @@
class MyCommandListener : public transport::DefaultTransportListener{
public:
- transport::Command* cmd;
+ commands::Command* cmd;
public:
@@ -58,7 +58,7 @@
}
virtual ~MyCommandListener(){}
- virtual void onCommand( transport::Command* command ){
+ virtual void onCommand( commands::Command* command ){
cmd = command;
}
};
Modified: activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.cpp Wed Jan 28 20:59:07 2009
@@ -18,9 +18,9 @@
#include "IOTransportTest.h"
#include <activemq/transport/IOTransport.h>
-#include <activemq/transport/Command.h>
#include <activemq/transport/TransportListener.h>
#include <activemq/wireformat/WireFormat.h>
+#include <activemq/commands/BaseCommand.h>
#include <decaf/util/concurrent/Concurrent.h>
#include <decaf/util/concurrent/CountDownLatch.h>
#include <decaf/util/concurrent/Mutex.h>
@@ -37,20 +37,20 @@
using namespace activemq::exceptions;
////////////////////////////////////////////////////////////////////////////////
-class MyCommand : public Command{
+class MyCommand : public commands::BaseCommand{
public:
MyCommand(){ c = 0; }
virtual ~MyCommand(){}
char c;
- virtual void setCommandId( int id AMQCPP_UNUSED){}
- virtual int getCommandId() const{ return 0; }
+ virtual unsigned char getDataStructureType() const { return 1; }
+
+ virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+ throw( exceptions::ActiveMQException ) { return NULL; }
- virtual void setResponseRequired( const bool required AMQCPP_UNUSED){}
- virtual bool isResponseRequired() const{ return false; }
virtual std::string toString() const{ return ""; }
- virtual Command* cloneCommand() const{
+ virtual MyCommand* cloneDataStructure() const{
MyCommand* command = new MyCommand;
command->c = c;
return command;
@@ -75,7 +75,7 @@
virtual wireformat::WireFormatNegotiator* createNegotiator( transport::Transport* transport )
throw( decaf::lang::exceptions::UnsupportedOperationException ) { return NULL; }
- virtual Command* unmarshal( decaf::io::DataInputStream* inputStream )
+ virtual commands::Command* unmarshal( decaf::io::DataInputStream* inputStream )
throw ( CommandIOException ){
try{
@@ -128,7 +128,7 @@
}
}
- virtual void marshal( Command* command, decaf::io::DataOutputStream* outputStream )
+ virtual void marshal( commands::Command* command, decaf::io::DataOutputStream* outputStream )
throw (CommandIOException)
{
try{
@@ -170,7 +170,7 @@
}
std::string str;
- virtual void onCommand( Command* command ){
+ virtual void onCommand( commands::Command* command ){
const MyCommand* cmd = dynamic_cast<const MyCommand*>(command);
str += cmd->c;
delete command;
Modified: activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp Wed Jan 28 20:59:07 2009
@@ -42,7 +42,7 @@
// Send one request.
MyCommand cmd;
- Response* resp = correlator.request( &cmd );
+ commands::Response* resp = correlator.request( &cmd );
CPPUNIT_ASSERT( resp != NULL );
CPPUNIT_ASSERT( resp->getCorrelationId() == cmd.getCommandId() );
Modified: activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.h Wed Jan 28 20:59:07 2009
@@ -22,6 +22,7 @@
#include <cppunit/extensions/HelperMacros.h>
#include <activemq/util/Config.h>
+#include <activemq/commands/BaseCommand.h>
#include <activemq/transport/DefaultTransportListener.h>
#include <activemq/transport/correlator/ResponseCorrelator.h>
#include <decaf/lang/Thread.h>
@@ -45,75 +46,24 @@
public:
- class MyCommand : public Command{
+ class MyCommand : public commands::BaseCommand{
private:
unsigned int commandId;
- bool responseRequired;
public:
- virtual void setCommandId( int id ){
- commandId = id;
- }
- virtual int getCommandId() const{
- return commandId;
- }
-
- virtual void setResponseRequired( const bool required ){
- responseRequired = required;
- }
- virtual bool isResponseRequired() const{
- return responseRequired;
- }
-
virtual std::string toString() const{ return ""; }
- virtual Command* cloneCommand() const{
- MyCommand* command = new MyCommand;
- command->commandId = commandId;
- command->responseRequired = responseRequired;
- return command;
- }
- };
-
- class MyResponse : public Response{
- private:
+ virtual unsigned char getDataStructureType() const { return 1; }
- unsigned int commandId;
- bool responseRequired;
- unsigned int corrId;
+ virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+ throw( exceptions::ActiveMQException ) { return NULL; }
- public:
-
- virtual void setCommandId( int id ){
- commandId = id;
- }
- virtual int getCommandId() const{
- return commandId;
- }
-
- virtual void setResponseRequired( const bool required ){
- responseRequired = required;
- }
- virtual bool isResponseRequired() const{
- return responseRequired;
- }
-
- virtual int getCorrelationId() const{
- return corrId;
- }
- virtual void setCorrelationId( int corrId ){
- this->corrId = corrId;
- }
-
- virtual std::string toString() const{ return ""; }
-
- virtual Command* cloneCommand() const{
- MyResponse* command = new MyResponse;
- command->commandId = commandId;
- command->responseRequired = responseRequired;
- command->corrId = corrId;
+ virtual MyCommand* cloneDataStructure() const{
+ MyCommand* command = new MyCommand;
+ command->setCommandId( this->getCommandId() );
+ command->setResponseRequired( this->isResponseRequired() );
return command;
}
};
@@ -128,7 +78,7 @@
decaf::util::concurrent::Mutex mutex;
decaf::util::concurrent::Mutex startedMutex;
bool done;
- std::queue<Command*> requests;
+ std::queue<commands::Command*> requests;
public:
@@ -143,7 +93,7 @@
close();
}
- virtual void oneway( Command* command )
+ virtual void oneway( commands::Command* command )
throw(CommandIOException, decaf::lang::exceptions::UnsupportedOperationException)
{
synchronized( &mutex ){
@@ -152,7 +102,7 @@
}
}
- virtual Response* request( Command* command AMQCPP_UNUSED)
+ virtual commands::Response* request( commands::Command* command AMQCPP_UNUSED)
throw(CommandIOException, decaf::lang::exceptions::UnsupportedOperationException)
{
throw decaf::lang::exceptions::UnsupportedOperationException(
@@ -161,8 +111,8 @@
"stuff" );
}
- virtual Response* request( Command* command AMQCPP_UNUSED,
- unsigned int timeout AMQCPP_UNUSED )
+ virtual commands::Response* request( commands::Command* command AMQCPP_UNUSED,
+ unsigned int timeout AMQCPP_UNUSED )
throw(CommandIOException, decaf::lang::exceptions::UnsupportedOperationException)
{
throw decaf::lang::exceptions::UnsupportedOperationException(
@@ -202,9 +152,9 @@
}
}
- virtual Response* createResponse( Command* command ){
+ virtual commands::Response* createResponse( commands::Command* command ){
- MyResponse* resp = new MyResponse();
+ commands::Response* resp = new commands::Response();
resp->setCorrelationId( command->getCommandId() );
resp->setResponseRequired( false );
return resp;
@@ -227,11 +177,11 @@
mutex.wait();
}else{
- Command* cmd = requests.front();
+ commands::Command* cmd = requests.front();
requests.pop();
// Only send a response if one is required.
- Response* resp = NULL;
+ commands::Response* resp = NULL;
if( cmd->isResponseRequired() ){
resp = createResponse( cmd );
}
@@ -308,7 +258,7 @@
MyBrokenTransport(){}
virtual ~MyBrokenTransport(){}
- virtual Response* createResponse( Command* command AMQCPP_UNUSED){
+ virtual commands::Response* createResponse(commands:: Command* command AMQCPP_UNUSED){
throw exceptions::ActiveMQException( __FILE__, __LINE__,
"bad stuff" );
}
@@ -327,7 +277,7 @@
exCount = 0;
}
virtual ~MyListener(){}
- virtual void onCommand( Command* command ){
+ virtual void onCommand( commands::Command* command ){
synchronized( &mutex ){
commands.insert( command->getCommandId() );
@@ -352,7 +302,7 @@
Transport* transport;
MyCommand cmd;
- Response* resp;
+ commands::Response* resp;
public:
RequestThread(){