2010-11-09 Francois Chouinard <fchouinard@gmail.com> Contribution for Bug315307
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf / src / org / eclipse / linuxtools / tmf / TmfCorePlugin.java
1 /*******************************************************************************
2 * Copyright (c) 2009, 2010 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;
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 /**
41 * The constructor
42 */
43 public TmfCorePlugin() {
44 setDefault(this);
45 }
46
47 // ------------------------------------------------------------------------
48 // Accessors
49 // ------------------------------------------------------------------------
50
51 /**
52 * @return the shared instance
53 */
54 public static TmfCorePlugin getDefault() {
55 return fPlugin;
56 }
57
58 /**
59 * @param plugin the shared instance
60 */
61 private static void setDefault(TmfCorePlugin plugin) {
62 fPlugin = plugin;
63 }
64
65 // ------------------------------------------------------------------------
66 // Operations
67 // ------------------------------------------------------------------------
68
69 @Override
70 public void start(BundleContext context) throws Exception {
71 super.start(context);
72 setDefault(this);
73 Tracer.init();
74 }
75
76 @Override
77 public void stop(BundleContext context) throws Exception {
78 Tracer.stop();
79 setDefault(null);
80 super.stop(context);
81 }
82
83 }
This page took 0.032185 seconds and 5 git commands to generate.