* @author Francois Chouinard
*/
@SuppressWarnings("nls")
-public class TmfCoreTracer {
+public final class TmfCoreTracer {
// ------------------------------------------------------------------------
// Constants
// ------------------------------------------------------------------------
// Classes tracing flags
- private static boolean fComponentClassEnabled = false;
- private static boolean fRequestClassEnabled = false;
- private static boolean fSignalClassEnabled = false;
- private static boolean fEventClassEnabled = false;
- private static boolean fAnalysisClassEnabled = false;
+ private static volatile boolean fComponentClassEnabled = false;
+ private static volatile boolean fRequestClassEnabled = false;
+ private static volatile boolean fSignalClassEnabled = false;
+ private static volatile boolean fEventClassEnabled = false;
+ private static volatile boolean fAnalysisClassEnabled = false;
// Trace log file
private static BufferedWriter fTraceFile;
+ // ------------------------------------------------------------------------
+ // Constructor
+ // ------------------------------------------------------------------------
+ /**
+ * Constructor
+ */
+ private TmfCoreTracer() {
+ // Do nothing
+ }
+
// ------------------------------------------------------------------------
// Start/stop tracing - controlled by the plug-in
// ------------------------------------------------------------------------
/**
* Set the tracing flags according to the launch configuration
*/
- public static void init() {
+ public static synchronized void init() {
String traceKey;
boolean isTracing = false;
/**
* Close the trace log file
*/
- public static void stop() {
+ public static synchronized void stop() {
if (fTraceFile != null) {
try {
fTraceFile.close();
/**
* Update the default time and default interval formats
*/
- public static void updateDefaultFormats() {
+ public static synchronized void updateDefaultFormats() {
fDefaultTimeFormat = new TmfTimestampFormat(
TmfTimePreferences.getTimePattern(),
TmfTimePreferences.getTimeZone(),
/**
* @return the default time format pattern
*/
- public static TmfTimestampFormat getDefaulTimeFormat() {
+ public static synchronized TmfTimestampFormat getDefaulTimeFormat() {
if (fDefaultTimeFormat == null) {
fDefaultTimeFormat = new TmfTimestampFormat(
TmfTimePreferences.getTimePattern(),
/**
* @return the default interval format pattern
*/
- public static TmfTimestampFormat getDefaulIntervalFormat() {
+ public static synchronized TmfTimestampFormat getDefaulIntervalFormat() {
if (fDefaultIntervalFormat == null) {
fDefaultIntervalFormat = new TmfTimestampFormat(TmfTimePreferences.getIntervalPattern());
}