+
+ @Override
+ public RaftActorBehavior getCurrentBehavior() {
+ return currentBehavior;
+ }
+
+ void setCurrentBehavior(final RaftActorBehavior behavior) {
+ this.currentBehavior = Preconditions.checkNotNull(behavior);
+ }
+
+ void close() {
+ if (currentBehavior != null) {
+ try {
+ currentBehavior.close();
+ } catch (Exception e) {
+ LOG.debug("{}: Error closing behavior {}", getId(), currentBehavior.state());
+ }
+ }
+ }