Commit | Line | Data |
---|---|---|
d18dd09b | 1 | /******************************************************************************* |
11252342 | 2 | * Copyright (c) 2009, 2013 Ericsson |
54a7a54c | 3 | * |
d18dd09b ASL |
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 | |
54a7a54c | 8 | * |
d18dd09b ASL |
9 | * Contributors: |
10 | * Francois Chouinard - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
6c13869b | 13 | package org.eclipse.linuxtools.tmf.core.tests; |
d18dd09b ASL |
14 | |
15 | import org.eclipse.core.runtime.Plugin; | |
5500a7f0 | 16 | import org.eclipse.linuxtools.internal.tmf.core.TmfCoreTracer; |
cbd4ad82 | 17 | import org.osgi.framework.BundleContext; |
d18dd09b ASL |
18 | |
19 | /** | |
20 | * <b><u>TmfTestPlugin</u></b> | |
21 | * <p> | |
22 | * The activator class controls the plug-in life cycle | |
23 | */ | |
24 | public class TmfCoreTestPlugin extends Plugin { | |
25 | ||
cbd4ad82 | 26 | // ------------------------------------------------------------------------ |
d18dd09b | 27 | // Attributes |
cbd4ad82 | 28 | // ------------------------------------------------------------------------ |
d18dd09b ASL |
29 | |
30 | // The plug-in ID | |
54a7a54c FC |
31 | @SuppressWarnings("javadoc") |
32 | public static final String PLUGIN_ID = "org.eclipse.linuxtools.tmf.tests"; | |
d18dd09b ASL |
33 | |
34 | // The shared instance | |
cbd4ad82 | 35 | private static TmfCoreTestPlugin fPlugin; |
54a7a54c | 36 | |
cbd4ad82 | 37 | // ------------------------------------------------------------------------ |
d18dd09b | 38 | // Constructors |
cbd4ad82 | 39 | // ------------------------------------------------------------------------ |
d18dd09b ASL |
40 | |
41 | /** | |
42 | * The constructor | |
43 | */ | |
44 | public TmfCoreTestPlugin() { | |
cbd4ad82 | 45 | setDefault(this); |
d18dd09b ASL |
46 | } |
47 | ||
cbd4ad82 | 48 | // ------------------------------------------------------------------------ |
d18dd09b | 49 | // Accessors |
cbd4ad82 | 50 | // ------------------------------------------------------------------------ |
d18dd09b ASL |
51 | |
52 | /** | |
53 | * @return the shared instance | |
54 | */ | |
cbd4ad82 FC |
55 | public static TmfCoreTestPlugin getDefault() { |
56 | return fPlugin; | |
d18dd09b ASL |
57 | } |
58 | ||
cbd4ad82 FC |
59 | /** |
60 | * @param plugin the shared instance | |
61 | */ | |
62 | private static void setDefault(TmfCoreTestPlugin plugin) { | |
63 | fPlugin = plugin; | |
64 | } | |
65 | ||
66 | // ------------------------------------------------------------------------ | |
67 | // Operations | |
68 | // ------------------------------------------------------------------------ | |
69 | ||
70 | @Override | |
71 | public void start(BundleContext context) throws Exception { | |
72 | super.start(context); | |
73 | setDefault(this); | |
5500a7f0 | 74 | TmfCoreTracer.init(); |
cbd4ad82 FC |
75 | } |
76 | ||
77 | @Override | |
78 | public void stop(BundleContext context) throws Exception { | |
5500a7f0 | 79 | TmfCoreTracer.stop(); |
cbd4ad82 FC |
80 | setDefault(null); |
81 | super.stop(context); | |
82 | } | |
83 | ||
d18dd09b | 84 | } |