*/
package org.opendaylight.controller.cluster.datastore;
+import static com.google.common.base.Preconditions.checkState;
import static com.google.common.base.Verify.verify;
+import static java.util.Objects.requireNonNull;
import akka.actor.ActorRef;
import akka.actor.ActorSelection;
import akka.serialization.JavaSerializer;
import akka.serialization.Serialization;
import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
import com.google.common.base.Ticker;
import com.google.common.base.Verify;
import com.google.common.collect.ImmutableList;
}
@Override
- public void postStop() {
+ public void postStop() throws Exception {
LOG.info("Stopping Shard {}", persistenceId());
super.postStop();
}
protected void checkSealed() {
- Preconditions.checkState(!sealed, "Builder isalready sealed - further modifications are not allowed");
+ checkState(!sealed, "Builder isalready sealed - further modifications are not allowed");
}
@SuppressWarnings("unchecked")
public T schemaContextProvider(final SchemaContextProvider newSchemaContextProvider) {
checkSealed();
- this.schemaContextProvider = Preconditions.checkNotNull(newSchemaContextProvider);
+ this.schemaContextProvider = requireNonNull(newSchemaContextProvider);
return self();
}
}
protected void verify() {
- Preconditions.checkNotNull(id, "id should not be null");
- Preconditions.checkNotNull(peerAddresses, "peerAddresses should not be null");
- Preconditions.checkNotNull(datastoreContext, "dataStoreContext should not be null");
- Preconditions.checkNotNull(schemaContextProvider, "schemaContextProvider should not be null");
+ requireNonNull(id, "id should not be null");
+ requireNonNull(peerAddresses, "peerAddresses should not be null");
+ requireNonNull(datastoreContext, "dataStoreContext should not be null");
+ requireNonNull(schemaContextProvider, "schemaContextProvider should not be null");
}
public Props props() {
this(Shard.class);
}
- Builder(Class<? extends Shard> shardClass) {
+ Builder(final Class<? extends Shard> shardClass) {
super(shardClass);
}
}