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_TRANSPORT_H_ 00019 #define ACTIVEMQ_TRANSPORT_TRANSPORT_H_ 00020 00021 #include <decaf/io/InputStream.h> 00022 #include <decaf/io/OutputStream.h> 00023 #include <decaf/io/IOException.h> 00024 #include <decaf/io/Closeable.h> 00025 #include <decaf/util/List.h> 00026 #include <decaf/net/URI.h> 00027 #include <decaf/lang/Pointer.h> 00028 #include <decaf/lang/exceptions/UnsupportedOperationException.h> 00029 #include <activemq/util/Config.h> 00030 #include <activemq/transport/ResponseCallback.h> 00031 #include <activemq/transport/FutureResponse.h> 00032 #include <activemq/commands/Command.h> 00033 #include <activemq/commands/Response.h> 00034 #include <typeinfo> 00035 00036 namespace activemq{ 00037 namespace wireformat{ 00038 class WireFormat; 00039 } 00040 namespace transport{ 00041 00042 // Forward declarations. 00043 class TransportListener; 00044 00045 using decaf::lang::Pointer; 00046 using activemq::commands::Command; 00047 using activemq::commands::Response; 00048 00059 class AMQCPP_API Transport: public decaf::io::Closeable { 00060 public: 00061 00062 virtual ~Transport(); 00063 00070 virtual void start() = 0; 00071 00077 virtual void stop() = 0; 00078 00090 virtual void oneway(const Pointer<Command> command) = 0; 00091 00107 virtual Pointer<FutureResponse> asyncRequest(const Pointer<Command> command, 00108 const Pointer<ResponseCallback> responseCallback) = 0; 00109 00121 virtual Pointer<Response> request(const Pointer<Command> command) = 0; 00122 00137 virtual Pointer<Response> request(const Pointer<Command> command, unsigned int timeout) = 0; 00138 00146 virtual Pointer<wireformat::WireFormat> getWireFormat() const = 0; 00147 00153 virtual void setWireFormat(const Pointer<wireformat::WireFormat> wireFormat) = 0; 00154 00159 virtual void setTransportListener(TransportListener* listener) = 0; 00160 00165 virtual TransportListener* getTransportListener() const = 0; 00166 00176 virtual Transport* narrow(const std::type_info& typeId) = 0; 00177 00184 virtual bool isFaultTolerant() const = 0; 00185 00191 virtual bool isConnected() const = 0; 00192 00198 virtual bool isClosed() const = 0; 00199 00203 virtual bool isReconnectSupported() const = 0; 00204 00208 virtual bool isUpdateURIsSupported() const = 0; 00209 00213 virtual std::string getRemoteAddress() const = 0; 00214 00223 virtual void reconnect(const decaf::net::URI& uri) = 0; 00224 00236 virtual void updateURIs(bool rebalance, const decaf::util::List<decaf::net::URI>& uris) = 0; 00237 00238 }; 00239 00240 }} 00241 00242 #endif /*_ACTIVEMQ_TRANSPORT_TRANSPORT_H_*/
1.6.1