Fix license header violations in sal-dom-broker
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / sal / dom / broker / osgi / SchemaServiceActivator.java
index 344b3f32763c2fcb9c45047ae7c4e34f0b6e087d..37093c7d13fbe5d402f41bf56d758b980818e0a4 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.controller.sal.dom.broker.osgi;
 
 import java.util.Hashtable;
-
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
 import org.opendaylight.controller.sal.dom.broker.GlobalBundleScanningSchemaServiceImpl;
 import org.osgi.framework.BundleActivator;
@@ -17,20 +16,18 @@ import org.osgi.framework.ServiceRegistration;
 
 public class SchemaServiceActivator implements BundleActivator {
 
-    
+
     private ServiceRegistration<SchemaService> schemaServiceReg;
     private GlobalBundleScanningSchemaServiceImpl schemaService;
 
     @Override
-    public void start(BundleContext context) throws Exception {
-        schemaService = new GlobalBundleScanningSchemaServiceImpl();
-        schemaService.setContext(context);
-        schemaService.start();
+    public void start(final BundleContext context) {
+        schemaService = GlobalBundleScanningSchemaServiceImpl.createInstance(context);
         schemaServiceReg = context.registerService(SchemaService.class, schemaService, new Hashtable<String,String>());
     }
-    
+
     @Override
-    public void stop(BundleContext context) throws Exception {
+    public void stop(final BundleContext context) throws Exception {
         schemaServiceReg.unregister();
         schemaService.close();
     }