activemq-cpp-3.6.0
Main Page
Namespaces
Data Structures
Files
File List
Globals
IOTransport.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_IOTRANSPORT_H_
19
#define _ACTIVEMQ_TRANSPORT_IOTRANSPORT_H_
20
21
#include <
activemq/util/Config.h
>
22
#include <
activemq/transport/Transport.h
>
23
#include <
activemq/transport/TransportListener.h
>
24
#include <
activemq/commands/Command.h
>
25
#include <
activemq/commands/Response.h
>
26
#include <
activemq/wireformat/WireFormat.h
>
27
28
#include <
decaf/lang/Runnable.h
>
29
#include <
decaf/lang/Thread.h
>
30
#include <
decaf/io/DataInputStream.h
>
31
#include <
decaf/io/DataOutputStream.h
>
32
#include <
decaf/util/logging/LoggerDefines.h
>
33
34
namespace
activemq {
35
namespace
transport {
36
37
using
decaf::lang::Pointer
;
38
using
activemq::commands::Command
;
39
using
activemq::commands::Response
;
40
41
class
IOTransportImpl;
42
58
class
AMQCPP_API
IOTransport
:
public
Transport
,
59
public
decaf::lang::Runnable
{
60
61
LOGDECAF_DECLARE
(logger)
62
63
private
:
64
65
IOTransportImpl* impl;
66
67
private
:
68
69
IOTransport
(
const
IOTransport
&);
70
IOTransport
& operator=(
const
IOTransport
&);
71
72
private
:
73
80
void
fire(
decaf::lang::Exception
& ex);
81
88
void
fire(
const
Pointer<Command>
command);
89
90
public
:
91
95
IOTransport
();
96
104
IOTransport
(
const
Pointer<wireformat::WireFormat>
wireFormat);
105
106
virtual
~
IOTransport
();
107
114
virtual
void
setInputStream(
decaf::io::DataInputStream
* is);
115
122
virtual
void
setOutputStream(
decaf::io::DataOutputStream
* os);
123
124
public
:
// Transport methods
125
126
virtual
void
oneway(
const
Pointer<Command>
command);
127
133
virtual
Pointer<FutureResponse>
asyncRequest(
const
Pointer<Command>
command,
134
const
Pointer<ResponseCallback>
responseCallback);
135
141
virtual
Pointer<Response>
request(
const
Pointer<Command>
command);
142
148
virtual
Pointer<Response>
request(
const
Pointer<Command>
command,
unsigned
int
timeout);
149
150
virtual
Pointer<wireformat::WireFormat>
getWireFormat()
const
;
151
152
virtual
void
setWireFormat(
const
Pointer<wireformat::WireFormat>
wireFormat);
153
154
virtual
void
setTransportListener(
TransportListener
* listener);
155
156
virtual
TransportListener
* getTransportListener()
const
;
157
158
virtual
void
start();
159
160
virtual
void
stop();
161
162
virtual
void
close();
163
164
virtual
Transport
*
narrow
(
const
std::type_info& typeId) {
165
if
(
typeid
(*
this
) == typeId) {
166
return
this
;
167
}
168
169
return
NULL
;
170
}
171
172
virtual
bool
isFaultTolerant
()
const
{
173
return
false
;
174
}
175
176
virtual
bool
isConnected()
const
;
177
178
virtual
bool
isClosed()
const
;
179
180
virtual
std::string
getRemoteAddress
()
const
{
181
return
""
;
182
}
183
184
virtual
bool
isReconnectSupported
()
const
{
185
return
false
;
186
}
187
188
virtual
bool
isUpdateURIsSupported
()
const
{
189
return
false
;
190
}
191
192
virtual
void
updateURIs
(
bool
rebalance AMQCPP_UNUSED,
const
decaf::util::List<decaf::net::URI>
& uris AMQCPP_UNUSED) {
193
throw
decaf::io::IOException
();
194
}
195
201
virtual
void
reconnect
(
const
decaf::net::URI
& uri AMQCPP_UNUSED) {}
202
203
public
:
// Runnable methods.
204
205
virtual
void
run();
206
207
};
208
209
}}
210
211
#endif
/*_ACTIVEMQ_TRANSPORT_IOTRANSPORT_H_*/
src
main
activemq
transport
IOTransport.h
Generated on Mon Mar 4 2013 10:25:45 for activemq-cpp-3.6.0 by
1.8.1.2