activemq-cpp-3.8.2
Transport.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef ACTIVEMQ_TRANSPORT_TRANSPORT_H_
19 #define ACTIVEMQ_TRANSPORT_TRANSPORT_H_
20 
21 #include <decaf/io/InputStream.h>
22 #include <decaf/io/OutputStream.h>
23 #include <decaf/io/IOException.h>
24 #include <decaf/io/Closeable.h>
25 #include <decaf/util/List.h>
26 #include <decaf/net/URI.h>
27 #include <decaf/lang/Pointer.h>
29 #include <activemq/util/Config.h>
34 #include <typeinfo>
35 
36 namespace activemq{
37 namespace wireformat{
38  class WireFormat;
39 }
40 namespace transport{
41 
42  // Forward declarations.
43  class TransportListener;
44 
48 
60  public:
61 
62  virtual ~Transport();
63 
70  virtual void start() = 0;
71 
77  virtual void stop() = 0;
78 
90  virtual void oneway(const Pointer<Command> command) = 0;
91 
107  virtual Pointer<FutureResponse> asyncRequest(const Pointer<Command> command,
108  const Pointer<ResponseCallback> responseCallback) = 0;
109 
121  virtual Pointer<Response> request(const Pointer<Command> command) = 0;
122 
137  virtual Pointer<Response> request(const Pointer<Command> command, unsigned int timeout) = 0;
138 
146  virtual Pointer<wireformat::WireFormat> getWireFormat() const = 0;
147 
153  virtual void setWireFormat(const Pointer<wireformat::WireFormat> wireFormat) = 0;
154 
159  virtual void setTransportListener(TransportListener* listener) = 0;
160 
165  virtual TransportListener* getTransportListener() const = 0;
166 
176  virtual Transport* narrow(const std::type_info& typeId) = 0;
177 
184  virtual bool isFaultTolerant() const = 0;
185 
191  virtual bool isConnected() const = 0;
192 
198  virtual bool isClosed() const = 0;
199 
203  virtual bool isReconnectSupported() const = 0;
204 
208  virtual bool isUpdateURIsSupported() const = 0;
209 
213  virtual std::string getRemoteAddress() const = 0;
214 
223  virtual void reconnect(const decaf::net::URI& uri) = 0;
224 
236  virtual void updateURIs(bool rebalance, const decaf::util::List<decaf::net::URI>& uris) = 0;
237 
238  };
239 
240 }}
241 
242 #endif /*_ACTIVEMQ_TRANSPORT_TRANSPORT_H_*/
#define AMQCPP_API
Definition: Config.h:30
Definition: Response.h:46
Interface for a transport layer for command objects.
Definition: Transport.h:59
Interface for a class that implements the close method.
Definition: Closeable.h:30
This class represents an instance of a URI as defined by RFC 2396.
Definition: URI.h:36
Definition: Command.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: CachedConsumer.h:24
Decaf&#39;s implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition: Pointer.h:53
A listener of asynchronous exceptions from a command transport object.
Definition: TransportListener.h:38