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(final BundleContext context) {
26 schemaService = GlobalBundleScanningSchemaServiceImpl.createInstance(context);
27 schemaService.start();
28 schemaServiceReg = context.registerService(SchemaService.class, schemaService, new Hashtable<String,String>());
32 public void stop(final BundleContext context) throws Exception {
33 schemaServiceReg.unregister();
34 schemaService.close();