2 * Copyright (c) 2018 Pantheon Technologies, s.r.o. 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.yangtools.yang.data.jaxen.osgi;
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yangtools.yang.data.jaxen.JaxenSchemaContextFactory;
12 import org.opendaylight.yangtools.yang.data.jaxen.api.XPathSchemaContextFactory;
13 import org.osgi.framework.BundleActivator;
14 import org.osgi.framework.BundleContext;
15 import org.osgi.framework.ServiceRegistration;
18 * YANG Jaxen XPath implementation activator. Publishes a {@link XPathSchemaContextFactory} implementation on bundle
21 * @author Robert Varga
23 public final class Activator implements BundleActivator {
24 private ServiceRegistration<@NonNull XPathSchemaContextFactory> registration;
27 public void start(final BundleContext context) throws Exception {
28 registration = context.registerService(XPathSchemaContextFactory.class, new JaxenSchemaContextFactory(), null);
32 public void stop(final BundleContext context) throws Exception {
33 if (registration != null) {
34 registration.unregister();