Commit | Line | Data |
---|---|---|
8c8bf09f | 1 | /******************************************************************************* |
12c155f5 | 2 | * Copyright (c) 2009, 2010, 2011 Ericsson |
8c8bf09f ASL |
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 | ||
e1ab8984 | 15 | import org.eclipse.core.runtime.Plugin; |
cbd4ad82 | 16 | import org.osgi.framework.BundleContext; |
8c8bf09f ASL |
17 | |
18 | /** | |
19 | * <b><u>TmfCorePlugin</u></b> | |
20 | * <p> | |
cbd4ad82 FC |
21 | * The activator class controls the plug-in life cycle. No more than one such |
22 | * plug-in can exist at any time. | |
8c8bf09f | 23 | */ |
e1ab8984 | 24 | public class TmfCorePlugin extends Plugin { |
8c8bf09f | 25 | |
e31e01e8 | 26 | // ------------------------------------------------------------------------ |
8c8bf09f | 27 | // Attributes |
e31e01e8 | 28 | // ------------------------------------------------------------------------ |
8c8bf09f ASL |
29 | |
30 | // The plug-in ID | |
3b38ea61 | 31 | public static final String PLUGIN_ID = "org.eclipse.linuxtools.tmf"; //$NON-NLS-1$ |
8c8bf09f ASL |
32 | |
33 | // The shared instance | |
cbd4ad82 | 34 | private static TmfCorePlugin fPlugin; |
8c8bf09f | 35 | |
e31e01e8 | 36 | // ------------------------------------------------------------------------ |
8c8bf09f | 37 | // Constructors |
e31e01e8 | 38 | // ------------------------------------------------------------------------ |
8c8bf09f | 39 | |
8c8bf09f | 40 | public TmfCorePlugin() { |
cbd4ad82 | 41 | setDefault(this); |
8c8bf09f ASL |
42 | } |
43 | ||
e31e01e8 | 44 | // ------------------------------------------------------------------------ |
8c8bf09f | 45 | // Accessors |
e31e01e8 | 46 | // ------------------------------------------------------------------------ |
8c8bf09f | 47 | |
8c8bf09f | 48 | public static TmfCorePlugin getDefault() { |
cbd4ad82 | 49 | return fPlugin; |
8c8bf09f ASL |
50 | } |
51 | ||
cbd4ad82 FC |
52 | private static void setDefault(TmfCorePlugin plugin) { |
53 | fPlugin = plugin; | |
54 | } | |
55 | ||
56 | // ------------------------------------------------------------------------ | |
12c155f5 | 57 | // Plugin |
cbd4ad82 FC |
58 | // ------------------------------------------------------------------------ |
59 | ||
60 | @Override | |
61 | public void start(BundleContext context) throws Exception { | |
62 | super.start(context); | |
63 | setDefault(this); | |
36548af3 | 64 | Tracer.init(); |
cbd4ad82 FC |
65 | } |
66 | ||
67 | @Override | |
68 | public void stop(BundleContext context) throws Exception { | |
9b635e61 | 69 | Tracer.stop(); |
cbd4ad82 FC |
70 | setDefault(null); |
71 | super.stop(context); | |
72 | } | |
73 | ||
8c8bf09f | 74 | } |