Migrate pcep-spi to OSGi DS
[bgpcep.git] / pcep / spi / src / main / java / org / opendaylight / protocol / pcep / spi / pojo / AbstractPCEPExtensionProviderActivator.java
diff --git a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/AbstractPCEPExtensionProviderActivator.java b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/AbstractPCEPExtensionProviderActivator.java
deleted file mode 100644 (file)
index e865c27..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.protocol.pcep.spi.pojo;
-
-import static com.google.common.base.Preconditions.checkState;
-import static java.util.Objects.requireNonNull;
-
-import java.util.List;
-import org.checkerframework.checker.lock.qual.GuardedBy;
-import org.checkerframework.checker.lock.qual.Holding;
-import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator;
-import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
-import org.opendaylight.yangtools.concepts.Registration;
-
-public abstract class AbstractPCEPExtensionProviderActivator implements AutoCloseable, PCEPExtensionProviderActivator {
-    @GuardedBy("this")
-    private List<? extends Registration> registrations;
-
-    @Holding("this")
-    protected abstract List<? extends Registration> startImpl(PCEPExtensionProviderContext context);
-
-    @Override
-    public final synchronized void start(final PCEPExtensionProviderContext context) {
-        checkState(this.registrations == null);
-
-        this.registrations = requireNonNull(startImpl(context));
-    }
-
-    @Override
-    public final synchronized void stop() {
-        if (this.registrations == null) {
-            return;
-        }
-
-        this.registrations.forEach(Registration::close);
-        this.registrations = null;
-    }
-
-    @Override
-    public final void close() {
-        stop();
-    }
-}