Add blueprint wiring to opendaylight-archetype
[controller.git] / opendaylight / archetypes / opendaylight-startup / src / main / resources / archetype-resources / impl / src / main / java / __packageInPathFormat__ / impl / __classPrefix__Provider.java
index b913f58ed44d77ca6d7ed4434273d81f145e9e03..4d0a82041867a2c49c4e61997f4e60a9b4bde80f 100644 (file)
@@ -2,7 +2,7 @@
 #set( $symbol_dollar = '$' )
 #set( $symbol_escape = '\' )
 /*
- * ${copyright} and others.  All rights reserved.
+ * Copyright © ${copyrightYear} ${copyright} 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,
  */
 package ${package}.impl;
 
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class ${classPrefix}Provider implements BindingAwareProvider, AutoCloseable {
+public class ${classPrefix}Provider {
 
     private static final Logger LOG = LoggerFactory.getLogger(${classPrefix}Provider.class);
 
-    @Override
-    public void onSessionInitiated(ProviderContext session) {
+    private final DataBroker dataBroker;
+
+    public ${classPrefix}Provider(final DataBroker dataBroker) {
+        this.dataBroker = dataBroker;
+    }
+
+    /**
+     * Method called when the blueprint container is created.
+     */
+    public void init() {
         LOG.info("${classPrefix}Provider Session Initiated");
     }
 
-    @Override
-    public void close() throws Exception {
+    /**
+     * Method called when the blueprint container is destroyed.
+     */
+    public void close() {
         LOG.info("${classPrefix}Provider Closed");
     }
-
-}
+}
\ No newline at end of file