2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.sal.dom.broker.osgi;
10 import java.util.Hashtable;
12 import org.opendaylight.controller.sal.core.api.model.SchemaService;
13 import org.opendaylight.controller.sal.dom.broker.GlobalBundleScanningSchemaServiceImpl;
14 import org.osgi.framework.BundleActivator;
15 import org.osgi.framework.BundleContext;
16 import org.osgi.framework.ServiceRegistration;
18 public class SchemaServiceActivator implements BundleActivator {
21 private ServiceRegistration<SchemaService> schemaServiceReg;
22 private GlobalBundleScanningSchemaServiceImpl schemaService;
25 public void start(BundleContext context) throws Exception {
26 schemaService = new GlobalBundleScanningSchemaServiceImpl();
27 schemaService.setContext(context);
28 schemaService.start();
29 schemaServiceReg = context.registerService(SchemaService.class, schemaService, new Hashtable<String,String>());
33 public void stop(BundleContext context) throws Exception {
34 schemaServiceReg.unregister();
35 schemaService.close();