Merge "Initial implementation of the ClusteredDataStore"
[controller.git] / opendaylight / md-sal / sal-dom-api / src / main / java / org / opendaylight / controller / sal / core / api / AbstractConsumer.java
index 5e13aad49918ccf6c4e79a08f5411abd31066c10..1fb73bc9a9fd9a1799a502051bcd1548c3917a1b 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * 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.controller.sal.core.api;
 
 import java.util.Collection;
@@ -13,25 +20,30 @@ public abstract class AbstractConsumer implements Consumer, BundleActivator {
     ServiceReference<Broker> brokerRef;
     @Override
     public final void start(BundleContext context) throws Exception {
+        this.startImpl(context);
         brokerRef = context.getServiceReference(Broker.class);
         broker = context.getService(brokerRef);
-
-        this.startImpl(context);
-
         broker.registerConsumer(this,context);
     }
 
-    public abstract void startImpl(BundleContext context);
+
 
     @Override
     public final void stop(BundleContext context) throws Exception {
+        stopImpl(context);
         broker = null;
         if(brokerRef != null) {
             context.ungetService(brokerRef);
         }
     }
 
-    
+    protected void startImpl(BundleContext context) {
+        // NOOP
+    }
+    protected void stopImpl(BundleContext context) {
+        // NOOP
+    }
+
     @Override
     public Collection<ConsumerFunctionality> getConsumerFunctionality() {
         return Collections.emptySet();