Skip to content

Commit f8199c5

Browse files
author
Vlad Alexandru Ionescu
committed
renaming Heartbeater.java to HeartbeatSender.java; using naming conventions in AMQConnection
1 parent 6ab22a7 commit f8199c5

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/com/rabbitmq/client/impl/AMQConnection.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public static Map<String, Object> defaultClientProperties() {
9292
new Version(AMQP.PROTOCOL.MAJOR, AMQP.PROTOCOL.MINOR);
9393

9494
/** Initialization parameters */
95-
private final ConnectionFactory factory;
95+
private final ConnectionFactory _factory;
9696

9797
/** The special channel 0 */
9898
private final AMQChannel _channel0 = new AMQChannel(this, 0) {
@@ -125,8 +125,8 @@ public static Map<String, Object> defaultClientProperties() {
125125
/** Flag indicating whether the client received Connection.Close message from the broker */
126126
private boolean _brokerInitiatedShutdown = false;
127127

128-
/** Manages heartbeats for this connection */
129-
private final Heartbeater heartbeater;
128+
/** Manages heartbeat sending for this connection */
129+
private final HeartbeatSender _heartbeatSender;
130130

131131
/**
132132
* Protected API - respond, in the driver thread, to a ShutdownSignal.
@@ -210,8 +210,8 @@ public AMQConnection(ConnectionFactory factory,
210210
_requestedHeartbeat = factory.getRequestedHeartbeat();
211211
_clientProperties = new HashMap<String, Object>(factory.getClientProperties());
212212

213-
this.factory = factory;
214-
this.heartbeater = new Heartbeater(frameHandler);
213+
_factory = factory;
214+
_heartbeatSender = new HeartbeatSender(frameHandler);
215215
_frameHandler = frameHandler;
216216
_running = true;
217217
_frameMax = 0;
@@ -289,17 +289,17 @@ public void start()
289289
}
290290

291291
int channelMax =
292-
negotiatedMaxValue(factory.getRequestedChannelMax(),
292+
negotiatedMaxValue(_factory.getRequestedChannelMax(),
293293
connTune.getChannelMax());
294294
_channelManager = new ChannelManager(channelMax);
295295

296296
int frameMax =
297-
negotiatedMaxValue(factory.getRequestedFrameMax(),
297+
negotiatedMaxValue(_factory.getRequestedFrameMax(),
298298
connTune.getFrameMax());
299299
setFrameMax(frameMax);
300300

301301
int heartbeat =
302-
negotiatedMaxValue(factory.getRequestedHeartbeat(),
302+
negotiatedMaxValue(_factory.getRequestedHeartbeat(),
303303
connTune.getHeartbeat());
304304
setHeartbeat(heartbeat);
305305

@@ -350,7 +350,7 @@ public int getHeartbeat() {
350350
*/
351351
public void setHeartbeat(int heartbeat) {
352352
try {
353-
this.heartbeater.setHeartbeat(heartbeat);
353+
_heartbeatSender.setHeartbeat(heartbeat);
354354

355355
// Divide by four to make the maximum unwanted delay in
356356
// sending a timeout be less than a quarter of the
@@ -397,7 +397,7 @@ public Frame readFrame() throws IOException {
397397
*/
398398
public void writeFrame(Frame f) throws IOException {
399399
_frameHandler.writeFrame(f);
400-
this.heartbeater.signalActivity();
400+
_heartbeatSender.signalActivity();
401401
}
402402

403403
private static int negotiatedMaxValue(int clientValue, int serverValue) {
@@ -592,7 +592,7 @@ public ShutdownSignalException shutdown(Object reason,
592592
}
593593

594594
// stop any heartbeating
595-
this.heartbeater.shutdown();
595+
_heartbeatSender.shutdown();
596596

597597
_channel0.processShutdownSignal(sse, !initiatedByApplication, notifyRpc);
598598
_channelManager.handleSignal(sse);

src/com/rabbitmq/client/impl/Heartbeater.java renamed to src/com/rabbitmq/client/impl/HeartbeatSender.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@
4242
import static java.util.concurrent.TimeUnit.*;
4343

4444
/**
45-
* Manages heartbeats for a {@link AMQConnection}.
45+
* Manages heartbeat sending for a {@link AMQConnection}.
4646
* <p/>
4747
* Heartbeats are sent in a dedicated thread that is separate
4848
* from the main loop thread used for the connection.
4949
*/
50-
final class Heartbeater {
50+
final class HeartbeatSender {
5151

5252
private final Object monitor = new Object();
5353

@@ -59,7 +59,7 @@ final class Heartbeater {
5959

6060
private volatile long lastActivityTime;
6161

62-
Heartbeater(FrameHandler frameHandler) {
62+
HeartbeatSender(FrameHandler frameHandler) {
6363
this.frameHandler = frameHandler;
6464
}
6565

0 commit comments

Comments
 (0)