X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fcds-access-client%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Faccess%2Fclient%2FAbstractClientActorBehavior.java;h=4188a41fd5720894ffefc2351c2dd803d315352b;hb=refs%2Fchanges%2F11%2F80211%2F6;hp=79b876f626800106bb8d3885710a0a8bb60fde48;hpb=b0067e0a4bfa955f15c6259e019f954687264eff;p=controller.git diff --git a/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/AbstractClientActorBehavior.java b/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/AbstractClientActorBehavior.java index 79b876f626..4188a41fd5 100644 --- a/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/AbstractClientActorBehavior.java +++ b/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/AbstractClientActorBehavior.java @@ -7,27 +7,27 @@ */ package org.opendaylight.controller.cluster.access.client; +import static java.util.Objects.requireNonNull; + import akka.actor.ActorRef; import com.google.common.annotations.Beta; -import com.google.common.base.Preconditions; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; /** - * Base behavior attached to {@link AbstractClientActor}. Exposes - * @author user + * Base behavior attached to {@link AbstractClientActor}. * * @param Type of associated context * * @author Robert Varga */ @Beta -public abstract class AbstractClientActorBehavior { - private final C context; +public abstract class AbstractClientActorBehavior implements AutoCloseable { + private final @NonNull C context; - AbstractClientActorBehavior(final @Nonnull C context) { + AbstractClientActorBehavior(final @NonNull C context) { // Hidden to prevent outside subclasses. Users instantiated this via ClientActorBehavior - this.context = Preconditions.checkNotNull(context); + this.context = requireNonNull(context); } /** @@ -35,7 +35,7 @@ public abstract class AbstractClientActorBehavior onReceiveCommand(@Nonnull Object command); + abstract @Nullable AbstractClientActorBehavior onReceiveCommand(@NonNull Object command); /** * Implementation-internal method for handling an incoming recovery message coming from persistence. @@ -72,5 +76,5 @@ public abstract class AbstractClientActorBehavior onReceiveRecover(@Nonnull Object recover); + abstract @Nullable AbstractClientActorBehavior onReceiveRecover(@NonNull Object recover); }