- AbstractClientConnection(final ClientActorContext context, final Long cookie,
- final TransmitQueue queue) {
- this.context = Preconditions.checkNotNull(context);
- this.cookie = Preconditions.checkNotNull(cookie);
- this.queue = Preconditions.checkNotNull(queue);
- this.lastReceivedTicks = currentTime();
+ AbstractClientConnection(final ClientActorContext context, final Long cookie, final String backendName,
+ final int queueDepth) {
+ this.context = requireNonNull(context);
+ this.cookie = requireNonNull(cookie);
+ this.backendName = requireNonNull(backendName);
+ queue = new TransmitQueue.Halted(queueDepth);
+ lastReceivedTicks = currentTime();
+ }
+
+ // This constructor is only to be called (indirectly) by ReconnectingClientConnection constructor.
+ // Do not allow subclassing outside of this package
+ AbstractClientConnection(final AbstractClientConnection<T> oldConn) {
+ this(oldConn, new TransmitQueue.Halted(oldConn.queue, oldConn.currentTime()), oldConn.backendName);