Commit | Line | Data |
---|---|---|
8c8bf09f | 1 | /******************************************************************************* |
ed902a2b | 2 | * Copyright (c) 2009, 2014 Ericsson |
4f8ca6a1 | 3 | * |
8c8bf09f 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 | |
4f8ca6a1 | 8 | * |
8c8bf09f ASL |
9 | * Contributors: |
10 | * Francois Chouinard - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
2bdf0193 | 13 | package org.eclipse.tracecompass.tmf.core.signal; |
8c8bf09f ASL |
14 | |
15 | /** | |
8c8bf09f | 16 | * This object (singleton) traces all TmfSignals in the application. |
4f8ca6a1 | 17 | * |
4b7b3670 FC |
18 | * @version 1.0 |
19 | * @author Francois Chouinard | |
8c8bf09f ASL |
20 | */ |
21 | public class TmfSignalTracer { | |
22 | ||
d5efe032 | 23 | static TmfSignalTracer fInstance; |
8c8bf09f | 24 | |
4f8ca6a1 AM |
25 | /** |
26 | * @return The single instance of the signal tracer object | |
27 | */ | |
d5efe032 AF |
28 | static public TmfSignalTracer getInstance() { |
29 | if (fInstance == null) { | |
30 | fInstance = new TmfSignalTracer(); | |
31 | } | |
32 | return fInstance; | |
33 | } | |
8c8bf09f | 34 | |
d5efe032 AF |
35 | private TmfSignalTracer() { |
36 | } | |
8c8bf09f | 37 | |
4f8ca6a1 AM |
38 | /** |
39 | * Handler for all TMF signal types | |
40 | * | |
41 | * @param signal | |
42 | * Incoming signal | |
43 | */ | |
d5efe032 AF |
44 | @TmfSignalHandler |
45 | public void traceSignal(TmfSignal signal) { | |
46 | System.out.println(signal.getSource().toString() + ": " + signal.toString()); //$NON-NLS-1$ | |
47 | } | |
8c8bf09f | 48 | } |