activemq-cpp-3.9.5
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>
30 #include <activemq/util/Service.h>
35 #include <typeinfo>
36 
37 namespace activemq{
38 namespace wireformat{
39  class WireFormat;
40 }
41 namespace transport{
42 
43  // Forward declarations.
44  class TransportListener;
45 
49 
61  public:
62 
63  virtual ~Transport();
64 
71  virtual void start() = 0;
72 
78  virtual void stop() = 0;
79 
91  virtual void oneway(const Pointer<Command> command) = 0;
92 
108  virtual Pointer<FutureResponse> asyncRequest(const Pointer<Command> command,
109  const Pointer<ResponseCallback> responseCallback) = 0;
110 
122  virtual Pointer<Response> request(const Pointer<Command> command) = 0;
123 
138  virtual Pointer<Response> request(const Pointer<Command> command, unsigned int timeout) = 0;
139 
147  virtual Pointer<wireformat::WireFormat> getWireFormat() const = 0;
148 
154  virtual void setWireFormat(const Pointer<wireformat::WireFormat> wireFormat) = 0;
155 
160  virtual void setTransportListener(TransportListener* listener) = 0;
161 
166  virtual TransportListener* getTransportListener() const = 0;
167 
177  virtual Transport* narrow(const std::type_info& typeId) = 0;
178 
185  virtual bool isFaultTolerant() const = 0;
186 
192  virtual bool isConnected() const = 0;
193 
199  virtual bool isClosed() const = 0;
200 
204  virtual bool isReconnectSupported() const = 0;
205 
209  virtual bool isUpdateURIsSupported() const = 0;
210 
214  virtual std::string getRemoteAddress() const = 0;
215 
224  virtual void reconnect(const decaf::net::URI& uri) = 0;
225 
237  virtual void updateURIs(bool rebalance, const decaf::util::List<decaf::net::URI>& uris) = 0;
238 
239  };
240 
241 }}
242 
243 #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:60
Base interface for all classes that run as a Service inside the application.
Definition: Service.h:31
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:37
Definition: Command.h:33
Decaf'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