00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one or more 00003 * contributor license agreements. See the NOTICE file distributed with 00004 * this work for additional information regarding copyright ownership. 00005 * The ASF licenses this file to You under the Apache License, Version 2.0 00006 * (the "License"); you may not use this file except in compliance with 00007 * the License. You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 00018 #ifndef _ACTIVEMQ_TRANSPORT_CORRELATOR_RESPONSECORRELATOR_H_ 00019 #define _ACTIVEMQ_TRANSPORT_CORRELATOR_RESPONSECORRELATOR_H_ 00020 00021 #include <activemq/util/Config.h> 00022 #include <activemq/transport/TransportFilter.h> 00023 #include <activemq/transport/ResponseCallback.h> 00024 #include <activemq/transport/FutureResponse.h> 00025 #include <activemq/commands/Command.h> 00026 #include <activemq/commands/Response.h> 00027 00028 #include <decaf/lang/Exception.h> 00029 #include <decaf/lang/Pointer.h> 00030 00031 namespace activemq { 00032 namespace transport { 00033 namespace correlator { 00034 00035 using decaf::lang::Pointer; 00036 using activemq::commands::Command; 00037 using activemq::commands::Response; 00038 00039 class CorrelatorData; 00040 00046 class AMQCPP_API ResponseCorrelator : public TransportFilter { 00047 private: 00048 00049 CorrelatorData* impl; 00050 00051 private: 00052 00053 ResponseCorrelator(const ResponseCorrelator&); 00054 ResponseCorrelator& operator= (const ResponseCorrelator&); 00055 00056 public: 00057 00066 ResponseCorrelator(Pointer<Transport> next); 00067 00068 virtual ~ResponseCorrelator(); 00069 00070 public: // Transport Methods 00071 00072 virtual void oneway(const Pointer<Command> command); 00073 00074 virtual Pointer<FutureResponse> asyncRequest(const Pointer<Command> command, 00075 const Pointer<ResponseCallback> responseCallback); 00076 00077 virtual Pointer<Response> request(const Pointer<Command> command); 00078 00079 virtual Pointer<Response> request(const Pointer<Command> command, unsigned int timeout); 00080 00090 virtual void onCommand(const Pointer<Command> command); 00091 00100 virtual void onException(const decaf::lang::Exception& ex); 00101 00102 protected: 00103 00104 virtual void doClose(); 00105 00106 private: 00107 00108 void dispose(Pointer<decaf::lang::Exception> ex); 00109 00110 }; 00111 00112 }}} 00113 00114 #endif /*_ACTIVEMQ_TRANSPORT_CORRELATOR_RESPONSECORRELATOR_H_*/
1.6.1