Commit | Line | Data |
---|---|---|
d18dd09b | 1 | /******************************************************************************* |
ed902a2b | 2 | * Copyright (c) 2009, 2014 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 | ||
2bdf0193 | 13 | package org.eclipse.tracecompass.tmf.core.tests; |
d18dd09b ASL |
14 | |
15 | import org.eclipse.core.runtime.Plugin; | |
2bdf0193 | 16 | import org.eclipse.tracecompass.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 | 29 | |
d5efe032 AF |
30 | // The plug-in ID |
31 | @SuppressWarnings("javadoc") | |
c77a695a | 32 | public static final String PLUGIN_ID = "org.eclipse.tracecompass.tmf.tests"; |
d18dd09b | 33 | |
d5efe032 AF |
34 | // The shared instance |
35 | private static TmfCoreTestPlugin fPlugin; | |
54a7a54c | 36 | |
cbd4ad82 | 37 | // ------------------------------------------------------------------------ |
d18dd09b | 38 | // Constructors |
cbd4ad82 | 39 | // ------------------------------------------------------------------------ |
d18dd09b | 40 | |
d5efe032 AF |
41 | /** |
42 | * The constructor | |
43 | */ | |
44 | public TmfCoreTestPlugin() { | |
45 | setDefault(this); | |
46 | } | |
d18dd09b | 47 | |
d5efe032 | 48 | // ------------------------------------------------------------------------ |
d18dd09b | 49 | // Accessors |
d5efe032 | 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 | ||
d5efe032 AF |
59 | /** |
60 | * @param plugin the shared instance | |
61 | */ | |
62 | private static void setDefault(TmfCoreTestPlugin plugin) { | |
63 | fPlugin = plugin; | |
64 | } | |
cbd4ad82 | 65 | |
d5efe032 | 66 | // ------------------------------------------------------------------------ |
cbd4ad82 | 67 | // Operations |
d5efe032 | 68 | // ------------------------------------------------------------------------ |
cbd4ad82 | 69 | |
d5efe032 AF |
70 | @Override |
71 | public void start(BundleContext context) throws Exception { | |
72 | super.start(context); | |
73 | setDefault(this); | |
74 | TmfCoreTracer.init(); | |
75 | } | |
cbd4ad82 | 76 | |
d5efe032 AF |
77 | @Override |
78 | public void stop(BundleContext context) throws Exception { | |
79 | TmfCoreTracer.stop(); | |
80 | setDefault(null); | |
81 | super.stop(context); | |
82 | } | |
cbd4ad82 | 83 | |
d18dd09b | 84 | } |