Properly inject Ticker into PCEPSessionImpl 21/100721/4
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 22 Apr 2022 14:35:14 +0000 (16:35 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 22 Apr 2022 16:23:17 +0000 (18:23 +0200)
commit5f7ccf8acbfcfae2191f9713bf7594d65d11b16d
tree62fad5d7c7ac70de45b2b433cdb67dd76edeae83
parent6a02b47e6eb8baeb1ac6a67cdd1224c5633bf403
Properly inject Ticker into PCEPSessionImpl

Rather than having a mutable static field with the potential pitfalls
from that, use an explicit field to hold the associated ticker and
inject it from tests. Also cleanup the class and do not leak
ChannelFuture. The new field's overhead is eliminating by using a shared
constant for the keepalive message.

Change-Id: Id6f5cd263ea71b50e8a942c804a26ebb047edcc2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionImpl.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/FiniteStateMachineTest.java