diff options
author | Håvard Pettersen <havardpe@oath.com> | 2019-05-13 13:41:10 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2019-05-13 13:41:10 +0000 |
commit | 670410fec9e06686f49ee2e6c7b304f52f340cd9 (patch) | |
tree | e5c17f8a3c159a56a6fd62eeb005297127956c14 /jrt/src | |
parent | 032ec0ed6f65a355c5c6402f2e2daae1f6ea5b00 (diff) |
add some more final in Connection
Diffstat (limited to 'jrt/src')
-rw-r--r-- | jrt/src/com/yahoo/jrt/Connection.java | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/jrt/src/com/yahoo/jrt/Connection.java b/jrt/src/com/yahoo/jrt/Connection.java index 9a3a7cd083f..c24cd145f67 100644 --- a/jrt/src/com/yahoo/jrt/Connection.java +++ b/jrt/src/com/yahoo/jrt/Connection.java @@ -17,7 +17,7 @@ import java.util.logging.Logger; class Connection extends Target { - private static Logger log = Logger.getLogger(Connection.class.getName()); + private static final Logger log = Logger.getLogger(Connection.class.getName()); private static final int READ_SIZE = 32768; private static final int READ_REDO = 10; @@ -29,27 +29,27 @@ class Connection extends Target { private static final int CONNECTED = 2; private static final int CLOSED = 3; - private int state = INITIAL; - private Queue queue = new Queue(); - private Queue myQueue = new Queue(); - private Buffer input = new Buffer(READ_SIZE * 2); - private Buffer output = new Buffer(WRITE_SIZE * 2); - private int maxInputSize = 64*1024; - private int maxOutputSize = 64*1024; - private Map<Integer, ReplyHandler> replyMap = new HashMap<>(); - private Map<TargetWatcher, TargetWatcher> watchers = new IdentityHashMap<>(); - private int activeReqs = 0; - private int writeWork = 0; - private boolean pendingHandshakeWork = false; + private int state = INITIAL; + private final Queue queue = new Queue(); + private final Queue myQueue = new Queue(); + private final Buffer input = new Buffer(READ_SIZE * 2); + private final Buffer output = new Buffer(WRITE_SIZE * 2); + private int maxInputSize = 64*1024; + private int maxOutputSize = 64*1024; + private final Map<Integer, ReplyHandler> replyMap = new HashMap<>(); + private final Map<TargetWatcher, TargetWatcher> watchers = new IdentityHashMap<>(); + private int activeReqs = 0; + private int writeWork = 0; + private boolean pendingHandshakeWork = false; private final TransportThread parent; - private Supervisor owner; - private Spec spec; - private CryptoSocket socket; - private int readSize = READ_SIZE; - private boolean server; - private AtomicLong requestId = new AtomicLong(0); - private SelectionKey selectionKey; - private Exception lostReason = null; + private final Supervisor owner; + private final Spec spec; + private CryptoSocket socket; + private int readSize = READ_SIZE; + private final boolean server; + private final AtomicLong requestId = new AtomicLong(0); + private SelectionKey selectionKey; + private Exception lostReason = null; private void setState(int state) { if (state <= this.state) { @@ -94,6 +94,7 @@ class Connection extends Target { this.parent = parent; this.owner = owner; this.socket = parent.transport().createCryptoSocket(channel, true); + this.spec = null; server = true; owner.sessionInit(this); } |