Re-structure LTTng sub-project as per the Linux Tools guidelines
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / TmfCorePlugin.java
1 /*******************************************************************************
2 * Copyright (c) 2009, 2010, 2011 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.core;
14
15 import org.eclipse.core.runtime.Plugin;
16 import org.osgi.framework.BundleContext;
17
18 /**
19 * <b><u>TmfCorePlugin</u></b>
20 * <p>
21 * The activator class controls the plug-in life cycle. No more than one such
22 * plug-in can exist at any time.
23 */
24 public class TmfCorePlugin extends Plugin {
25
26 // ------------------------------------------------------------------------
27 // Attributes
28 // ------------------------------------------------------------------------
29
30 // The plug-in ID
31 public static final String PLUGIN_ID = "org.eclipse.linuxtools.tmf"; //$NON-NLS-1$
32
33 // The shared instance
34 private static TmfCorePlugin fPlugin;
35
36 // ------------------------------------------------------------------------
37 // Constructors
38 // ------------------------------------------------------------------------
39
40 public TmfCorePlugin() {
41 setDefault(this);
42 }
43
44 // ------------------------------------------------------------------------
45 // Accessors
46 // ------------------------------------------------------------------------
47
48 public static TmfCorePlugin getDefault() {
49 return fPlugin;
50 }
51
52 private static void setDefault(TmfCorePlugin plugin) {
53 fPlugin = plugin;
54 }
55
56 // ------------------------------------------------------------------------
57 // Plugin
58 // ------------------------------------------------------------------------
59
60 @Override
61 public void start(BundleContext context) throws Exception {
62 super.start(context);
63 setDefault(this);
64 Tracer.init();
65 }
66
67 @Override
68 public void stop(BundleContext context) throws Exception {
69 Tracer.stop();
70 setDefault(null);
71 super.stop(context);
72 }
73
74 }
This page took 0.051563 seconds and 5 git commands to generate.