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
24#include <decaf/io/Closeable.h>
25#include <decaf/util/List.h>
26#include <decaf/net/URI.h>
27#include <decaf/lang/Pointer.h>
35#include <typeinfo>
36
37namespace activemq{
38namespace wireformat{
39 class WireFormat;
40}
41namespace transport{
42
43 // Forward declarations.
45
46 using decaf::lang::Pointer;
47 using activemq::commands::Command;
48 using activemq::commands::Response;
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
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
148
154 virtual void setWireFormat(const Pointer<wireformat::WireFormat> wireFormat) = 0;
155
160 virtual void setTransportListener(TransportListener* listener) = 0;
161
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
Interface for a transport layer for command objects.
Definition Transport.h:60
virtual bool isFaultTolerant() const =0
Is this Transport fault tolerant, meaning that it will reconnect to a broker on disconnect.
virtual void reconnect(const decaf::net::URI &uri)=0
reconnect to another location
virtual Pointer< Response > request(const Pointer< Command > command)=0
Sends the given command to the broker and then waits for the response.
virtual Pointer< FutureResponse > asyncRequest(const Pointer< Command > command, const Pointer< ResponseCallback > responseCallback)=0
Sends a commands asynchronously, returning a FutureResponse object that the caller can use to check t...
virtual bool isReconnectSupported() const =0
virtual Pointer< Response > request(const Pointer< Command > command, unsigned int timeout)=0
Sends the given command to the broker and then waits for the response.
virtual void start()=0
Starts the Transport, the send methods of a Transport will throw an exception if used before the Tran...
virtual Transport * narrow(const std::type_info &typeId)=0
Narrows down a Chain of Transports to a specific Transport to allow a higher level transport to skip ...
virtual void updateURIs(bool rebalance, const decaf::util::List< decaf::net::URI > &uris)=0
Updates the set of URIs the Transport can connect to.
virtual Pointer< wireformat::WireFormat > getWireFormat() const =0
Gets the WireFormat instance that is in use by this transport.
virtual std::string getRemoteAddress() const =0
virtual bool isUpdateURIsSupported() const =0
virtual void setTransportListener(TransportListener *listener)=0
Sets the observer of asynchronous events from this transport.
virtual bool isConnected() const =0
Is the Transport Connected to its Broker.
virtual TransportListener * getTransportListener() const =0
Gets the observer of asynchronous events from this transport.
virtual void stop()=0
Stops the Transport.
virtual bool isClosed() const =0
Has the Transport been shutdown and no longer usable.
virtual void setWireFormat(const Pointer< wireformat::WireFormat > wireFormat)=0
Sets the WireFormat instance to use.
virtual void oneway(const Pointer< Command > command)=0
Sends a one-way command.
A listener of asynchronous exceptions from a command transport object.
Definition TransportListener.h:38
Base interface for all classes that run as a Service inside the application.
Definition Service.h:31
Provides a mechanism to marshal commands into and out of packets or into and out of streams,...
Definition WireFormat.h:43
Interface for a class that implements the close method.
Definition Closeable.h:30
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
This class represents an instance of a URI as defined by RFC 2396.
Definition URI.h:37
An ordered collection (also known as a sequence).
Definition List.h:47
Definition AbstractTransportFactory.h:30
Definition BaseDataStructure.h:28
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition CachedConsumer.h:24