blob: 04426f6177e47438011a3a98b65ae0d1c96f56e7 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2015 1C-Soft LLC.
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Vladimir Piskarev (1C) - initial API and implementation
*******************************************************************************/
package org.eclipse.handly.internal.examples.adapter;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator
extends Plugin
{
public static final String PLUGIN_ID =
"org.eclipse.handly.examples.adapter"; //$NON-NLS-1$
private static Activator plugin;
public static Activator getDefault()
{
return plugin;
}
public static void log(IStatus status)
{
plugin.getLog().log(status);
}
public static IStatus createErrorStatus(String msg, Throwable e)
{
return new Status(IStatus.ERROR, PLUGIN_ID, 0, msg, e);
}
public Activator()
{
plugin = this;
}
@Override
public void start(BundleContext context) throws Exception
{
super.start(context);
AdapterModelManager.INSTANCE.startup();
}
@Override
public void stop(BundleContext context) throws Exception
{
try
{
AdapterModelManager.INSTANCE.shutdown();
}
finally
{
plugin = null;
super.stop(context);
}
}
}