1 /*******************************************************************************
2 * Copyright (c) 2009, 2012 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 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.tmf
.core
;
15 import org
.eclipse
.core
.runtime
.IStatus
;
16 import org
.eclipse
.core
.runtime
.Plugin
;
17 import org
.eclipse
.core
.runtime
.Status
;
18 import org
.osgi
.framework
.BundleContext
;
21 * The activator class controls the plug-in life cycle. No more than one such
22 * plug-in can exist at any time.
24 * It also provides the plug-in's general logging facility and manages the
27 public class Activator
extends Plugin
{
29 // ------------------------------------------------------------------------
31 // ------------------------------------------------------------------------
36 public static final String PLUGIN_ID
= "org.eclipse.linuxtools.tmf.core"; //$NON-NLS-1$
41 private static Activator fPlugin
;
43 // ------------------------------------------------------------------------
45 // ------------------------------------------------------------------------
54 // ------------------------------------------------------------------------
56 // ------------------------------------------------------------------------
59 * Returns the TMF Core plug-in instance.
61 * @return the TMF Core plug-in instance.
63 public static Activator
getDefault() {
67 // Sets plug-in instance
68 private static void setDefault(Activator plugin
) {
72 // ------------------------------------------------------------------------
74 // ------------------------------------------------------------------------
78 * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
81 public void start(BundleContext context
) throws Exception
{
89 * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
92 public void stop(BundleContext context
) throws Exception
{
98 // ------------------------------------------------------------------------
100 // ------------------------------------------------------------------------
103 * Logs a message with severity INFO in the runtime log of the plug-in.
105 * @param message A message to log
107 public static void logInfo(String message
) {
108 fPlugin
.getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
));
112 * Logs a message and exception with severity INFO in the runtime log of the plug-in.
114 * @param message A message to log
115 * @param exception The corresponding exception
117 public static void logInfo(String message
, Throwable exception
) {
118 fPlugin
.getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
, exception
));
121 // ------------------------------------------------------------------------
123 // ------------------------------------------------------------------------
126 * Logs a message and exception with severity WARNING in the runtime log of the plug-in.
128 * @param message A message to log
130 public static void logWarning(String message
) {
131 fPlugin
.getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
));
135 * Logs a message and exception with severity WARNING in the runtime log of the plug-in.
137 * @param message A message to log
138 * @param exception The corresponding exception
140 public static void logWarning(String message
, Throwable exception
) {
141 fPlugin
.getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
, exception
));
144 // ------------------------------------------------------------------------
146 // ------------------------------------------------------------------------
149 * Logs a message and exception with severity ERROR in the runtime log of the plug-in.
151 * @param message A message to log
153 public static void logError(String message
) {
154 fPlugin
.getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
));
158 * Logs a message and exception with severity ERROR in the runtime log of the plug-in.
160 * @param message A message to log
161 * @param exception The corresponding exception
163 public static void logError(String message
, Throwable exception
) {
164 fPlugin
.getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
, exception
));
This page took 0.033213 seconds and 5 git commands to generate.