1 /*******************************************************************************
2 * Copyright (c) 2009, 2014 Ericsson
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
10 * Francois Chouinard - Initial API and implementation
11 * Bernd Hufmann - Add signal manager disposal
12 *******************************************************************************/
14 package org
.eclipse
.linuxtools
.internal
.tmf
.core
;
16 import org
.eclipse
.core
.runtime
.IStatus
;
17 import org
.eclipse
.core
.runtime
.Plugin
;
18 import org
.eclipse
.core
.runtime
.Status
;
19 import org
.eclipse
.linuxtools
.tmf
.core
.analysis
.TmfAnalysisManager
;
20 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfSignalManager
;
21 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.TmfTraceManager
;
22 import org
.osgi
.framework
.BundleContext
;
25 * The activator class controls the plug-in life cycle. No more than one such
26 * plug-in can exist at any time.
28 * It also provides the plug-in's general logging facility and manages the
31 public class Activator
extends Plugin
{
33 // ------------------------------------------------------------------------
35 // ------------------------------------------------------------------------
40 public static final String PLUGIN_ID
= "org.eclipse.linuxtools.tmf.core"; //$NON-NLS-1$
45 private static Activator fPlugin
;
47 // ------------------------------------------------------------------------
49 // ------------------------------------------------------------------------
58 // ------------------------------------------------------------------------
60 // ------------------------------------------------------------------------
63 * Returns the TMF Core plug-in instance.
65 * @return the TMF Core plug-in instance.
67 public static Activator
getDefault() {
71 // Sets plug-in instance
72 private static void setDefault(Activator plugin
) {
76 // ------------------------------------------------------------------------
78 // ------------------------------------------------------------------------
81 public void start(BundleContext context
) throws Exception
{
85 /* Initialize the trace manager */
86 TmfTraceManager
.getInstance();
87 /* Initialize the analysis module sources */
88 TmfAnalysisManager
.initializeModuleSources();
92 public void stop(BundleContext context
) throws Exception
{
94 TmfSignalManager
.dispose();
100 // ------------------------------------------------------------------------
102 // ------------------------------------------------------------------------
105 * Log an IStatus object directly
110 public static void log(IStatus status
) {
111 fPlugin
.getLog().log(status
);
114 // ------------------------------------------------------------------------
116 // ------------------------------------------------------------------------
119 * Logs a message with severity INFO in the runtime log of the plug-in.
124 public static void logInfo(String message
) {
125 fPlugin
.getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
));
129 * Logs a message and exception with severity INFO in the runtime log of the
135 * The corresponding exception
137 public static void logInfo(String message
, Throwable exception
) {
138 fPlugin
.getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
, exception
));
141 // ------------------------------------------------------------------------
143 // ------------------------------------------------------------------------
146 * Logs a message and exception with severity WARNING in the runtime log of
152 public static void logWarning(String message
) {
153 fPlugin
.getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
));
157 * Logs a message and exception with severity WARNING in the runtime log of
163 * The corresponding exception
165 public static void logWarning(String message
, Throwable exception
) {
166 fPlugin
.getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
, exception
));
169 // ------------------------------------------------------------------------
171 // ------------------------------------------------------------------------
174 * Logs a message and exception with severity ERROR in the runtime log of
180 public static void logError(String message
) {
181 fPlugin
.getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
));
185 * Logs a message and exception with severity ERROR in the runtime log of
191 * The corresponding exception
193 public static void logError(String message
, Throwable exception
) {
194 fPlugin
.getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
, exception
));
This page took 0.040689 seconds and 5 git commands to generate.