| /*******************************************************************************
|
| * Copyright (c) 2011, 2019 Mia-Software and others.
|
| * All rights reserved. This program and the accompanying materials
|
| * are made available under the terms of the Eclipse Public License v2.0
|
| * which accompanies this distribution, and is available at
|
| * http://www.eclipse.org/legal/epl-v20.html
|
| *
|
| * Contributors:
|
| * Nicolas Bros (Mia-Software) - Bug 335003 - [Discoverer] : Existing Discoverers Refactoring based on new framework
|
| *******************************************************************************/ |
| package org.eclipse.modisco.kdm.source.discoverer.internal;
|
|
|
| import org.eclipse.core.runtime.Plugin;
|
| import org.osgi.framework.BundleContext;
|
|
|
| public class Activator extends Plugin {
|
|
|
| public static final String PLUGIN_ID = "org.eclipse.modisco.kdm.source.discoverer"; //$NON-NLS-1$
|
| private static Plugin plugin;
|
|
|
| private static BundleContext context;
|
|
|
| static BundleContext getContext() {
|
| return Activator.context;
|
| }
|
|
|
| /*
|
| * (non-Javadoc)
|
| *
|
| * @see
|
| * org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext
|
| * )
|
| */
|
| @Override
|
| public void start(final BundleContext bundleContext) throws Exception {
|
| super.start(bundleContext);
|
| Activator.context = bundleContext;
|
| Activator.plugin = this;
|
| }
|
|
|
| /*
|
| * (non-Javadoc)
|
| *
|
| * @see
|
| * org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
|
| */
|
| @Override
|
| public void stop(final BundleContext bundleContext) throws Exception {
|
| Activator.context = null;
|
| Activator.plugin = null;
|
| super.stop(bundleContext);
|
| }
|
|
|
| public static Plugin getPlugin() {
|
| return Activator.plugin;
|
| }
|
| }
|