activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1397341 [4/4] - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/ main/activemq/core/ main/activemq/transport/ main/activemq/transport/correlator/ main/activemq/transport/failover/ main/activemq/transport/inactivity/ main/activemq/tr...
Date Thu, 11 Oct 2012 22:39:49 GMT
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/AsyncCallback.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/AsyncCallback.h?rev=1397341&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/AsyncCallback.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/AsyncCallback.h Thu Oct 11 22:39:46
2012
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _CMS_ASYNCCALLBACK_H_
+#define _CMS_ASYNCCALLBACK_H_
+
+#include <cms/Config.h>
+
+#include <cms/ExceptionListener.h>
+
+namespace cms {
+
+    /**
+     * Asynchronous event interface for CMS asynchronous operations.
+     *
+     * For operations in CMS that allow for Asynchronous execution the caller
+     * provides an instance of this interface.  If the asynchronous action is
+     * successful the onSuccess method is invoked, otherwise the onException
+     * method of cms::ExceptionListener is called.
+     *
+     * @since 3.0
+     */
+    class CMS_API AsyncCallback : public ExceptionListener {
+    public:
+
+        virtual ~AsyncCallback();
+
+        /**
+         * Called when the asynchronous operation has completed successfully.
+         */
+        virtual void onSuccess() = 0;
+
+    };
+
+}
+
+#endif /* ASYNCCALLBACK_H_ */

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

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQConnectionFactoryTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQConnectionFactoryTest.cpp?rev=1397341&r1=1397340&r2=1397341&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQConnectionFactoryTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQConnectionFactoryTest.cpp
Thu Oct 11 22:39:46 2012
@@ -61,7 +61,7 @@ namespace core{
             return this->resumed;
         }
 
-        virtual void onCommand( const Pointer<Command>& command ) {
+        virtual void onCommand( const Pointer<Command> command ) {
 
         }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/IOTransportTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/IOTransportTest.cpp?rev=1397341&r1=1397340&r2=1397341&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/IOTransportTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/IOTransportTest.cpp
Thu Oct 11 22:39:46 2012
@@ -180,7 +180,7 @@ public:
     }
 
     std::string str;
-    virtual void onCommand( const Pointer<commands::Command>& command ){
+    virtual void onCommand( const Pointer<commands::Command> command ){
         const MyCommand* cmd = dynamic_cast<const MyCommand*>(command.get());
         str += cmd->c;
         latch.countDown();

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp?rev=1397341&r1=1397340&r2=1397341&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp
Thu Oct 11 22:39:46 2012
@@ -82,7 +82,7 @@ namespace correlator{
             close();
         }
 
-        virtual void oneway( const Pointer<Command>& command )
+        virtual void oneway( const Pointer<Command> command )
         {
             synchronized( &mutex ){
                 requests.push( command );
@@ -90,15 +90,19 @@ namespace correlator{
             }
         }
 
-        virtual Pointer<Response> request( const Pointer<Command>& command
AMQCPP_UNUSED )
-        {
+        virtual Pointer<FutureResponse> asyncRequest(const Pointer<Command> command,
+                                                     const Pointer<ResponseCallback>
responseCallback) {
             throw decaf::lang::exceptions::UnsupportedOperationException(
                 __FILE__, __LINE__, "stuff" );
         }
 
-        virtual Pointer<Response> request( const Pointer<Command>& command
AMQCPP_UNUSED,
-                                             unsigned int timeout AMQCPP_UNUSED )
-        {
+        virtual Pointer<Response> request( const Pointer<Command> command AMQCPP_UNUSED
) {
+            throw decaf::lang::exceptions::UnsupportedOperationException(
+                __FILE__, __LINE__, "stuff" );
+        }
+
+        virtual Pointer<Response> request( const Pointer<Command> command AMQCPP_UNUSED,
+                                           unsigned int timeout AMQCPP_UNUSED ) {
             throw decaf::lang::exceptions::UnsupportedOperationException(
                 __FILE__, __LINE__, "stuff" );
         }
@@ -108,7 +112,7 @@ namespace correlator{
         }
 
         virtual void setWireFormat(
-            const Pointer<wireformat::WireFormat>& wireFormat AMQCPP_UNUSED ) {}
+            const Pointer<wireformat::WireFormat> wireFormat AMQCPP_UNUSED ) {}
 
         virtual void setTransportListener( TransportListener* listener ) {
             this->listener = listener;
@@ -143,7 +147,7 @@ namespace correlator{
             }
         }
 
-        virtual Pointer<Response> createResponse( const Pointer<Command>&
command ){
+        virtual Pointer<Response> createResponse( const Pointer<Command> command
){
 
             Pointer<Response> resp( new commands::Response() );
             resp->setCorrelationId( command->getCommandId() );
@@ -252,7 +256,7 @@ namespace correlator{
         MyBrokenTransport(){}
         virtual ~MyBrokenTransport(){}
 
-        virtual Pointer<Response> createResponse( const Pointer<Command>&
command ){
+        virtual Pointer<Response> createResponse( const Pointer<Command> command
){
             throw exceptions::ActiveMQException( __FILE__, __LINE__,
                 "bad stuff" );
         }
@@ -271,7 +275,7 @@ namespace correlator{
             exCount = 0;
         }
         virtual ~MyListener(){}
-        virtual void onCommand( const Pointer<Command>& command ){
+        virtual void onCommand( const Pointer<Command> command ){
 
             synchronized( &mutex ){
                 commands.insert( command->getCommandId() );

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/inactivity/InactivityMonitorTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/inactivity/InactivityMonitorTest.cpp?rev=1397341&r1=1397340&r2=1397341&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/inactivity/InactivityMonitorTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/inactivity/InactivityMonitorTest.cpp
Thu Oct 11 22:39:46 2012
@@ -55,7 +55,7 @@ namespace {
         MyTransportListener() : exceptionFired( false ), commandsReceived( 0 ) {
         }
 
-        virtual void onCommand( const Pointer<Command>& command ) {
+        virtual void onCommand( const Pointer<Command> command ) {
             this->commandsReceived++;
         }
 



Mime
View raw message