* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.mdsal.singleton.dom.impl;
+import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Verify.verify;
import static com.google.common.base.Verify.verifyNotNull;
+import static java.util.Objects.requireNonNull;
import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
-import com.google.common.base.Verify;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.mdsal.eos.common.api.CandidateAlreadyRegisteredException;
import org.opendaylight.mdsal.eos.common.api.GenericEntity;
import org.opendaylight.mdsal.eos.common.api.GenericEntityOwnershipChange;
*
* @param entityOwnershipService relevant EOS
*/
- protected AbstractClusterSingletonServiceProviderImpl(@Nonnull final S entityOwnershipService) {
- this.entityOwnershipService = Preconditions.checkNotNull(entityOwnershipService);
+ protected AbstractClusterSingletonServiceProviderImpl(final @NonNull S entityOwnershipService) {
+ this.entityOwnershipService = requireNonNull(entityOwnershipService);
}
/**
@Override
public final synchronized ClusterSingletonServiceRegistration registerClusterSingletonService(
- @CheckForNull final ClusterSingletonService service) {
+ final ClusterSingletonService service) {
LOG.debug("Call registrationService {} method for ClusterSingletonService Provider {}", service, this);
final String serviceIdentifier = service.getIdentifier().getValue();
- Preconditions.checkArgument(!Strings.isNullOrEmpty(serviceIdentifier),
- "ClusterSingletonService identifier may not be null nor empty");
+ checkArgument(!Strings.isNullOrEmpty(serviceIdentifier),
+ "ClusterSingletonService identifier may not be null nor empty");
final ClusterSingletonServiceGroup<P, E, C> serviceGroup;
ClusterSingletonServiceGroup<P, E, C> existing = serviceGroupMap.get(serviceIdentifier);
// Placeholder is being retired, we are reusing its services as the seed for the group.
final ClusterSingletonServiceGroup<P, E, C> group = createGroup(identifier, services);
- Verify.verify(serviceGroupMap.replace(identifier, placeHolder, group));
+ verify(serviceGroupMap.replace(identifier, placeHolder, group));
placeHolder.setSuccessor(group);
LOG.debug("Service group upgraded from {} to {}", placeHolder, group);
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicReference;
-import javax.annotation.CheckReturnValue;
import javax.annotation.concurrent.GuardedBy;
import javax.annotation.concurrent.ThreadSafe;
import org.eclipse.jdt.annotation.NonNull;
import org.slf4j.LoggerFactory;
/**
- * Implementation of {@link ClusterSingletonServiceGroup} on top of the Entitiy Ownership Service. Since EOS is atomic
+ * Implementation of {@link ClusterSingletonServiceGroup} on top of the Entity Ownership Service. Since EOS is atomic
* in its operation and singleton services incur startup and most notably cleanup, we need to do something smart here.
*
* <p>
reconcileState();
}
- @CheckReturnValue
@Override
ListenableFuture<?> unregisterService(final ClusterSingletonServiceRegistration reg) {
final ClusterSingletonService service = reg.getInstance();
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.mdsal.singleton.dom.impl.util;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.mdsal.eos.common.api.GenericEntity;
import org.opendaylight.yangtools.yang.common.QName;
* @param type the entity type
* @param id the entity id.
*/
- public TestEntity(@Nonnull final String type, @Nonnull final TestInstanceIdentifier id) {
+ public TestEntity(final @NonNull String type, final @NonNull TestInstanceIdentifier id) {
super(type, id);
}
* @param type the type of the entity
* @param entityName the name of the entity used to construct a general-entity YangInstanceIdentifier
*/
- public TestEntity(@Nonnull final String type, @Nonnull final String entityName) {
+ public TestEntity(final @NonNull String type, final @NonNull String entityName) {
super(type, new TestInstanceIdentifier(entityName));
}
}