2010-10-26 Francois Chouinard <fchouinard@gmail.com> Contribution for Bug309042
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf / src / org / eclipse / linuxtools / tmf / component / TmfComponent.java
1 /*******************************************************************************
2 * Copyright (c) 2009, 2010 Ericsson
3 *
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
8 *
9 * Contributors:
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.component;
14
15 import org.eclipse.linuxtools.tmf.signal.TmfSignal;
16 import org.eclipse.linuxtools.tmf.signal.TmfSignalManager;
17
18 /**
19 * <b><u>TmfComponent</u></b>
20 * <p>
21 * This is the base class of the TMF components.
22 * <p>
23 * Currently, it only addresses the inter-component signaling.
24 */
25 public abstract class TmfComponent implements ITmfComponent {
26
27 private String fName;
28
29 // ------------------------------------------------------------------------
30 // Constructor
31 // ------------------------------------------------------------------------
32
33 public TmfComponent(String name) {
34 fName = name;
35 // if (Tracer.isComponentTraced()) Tracer.traceComponent(this, "created");
36 TmfSignalManager.register(this);
37 }
38
39 public TmfComponent(TmfComponent oldComponent) {
40 this.fName = oldComponent.fName;
41
42 // Should we register? Probably not but I'm not quite sure what this does
43 //register();
44 }
45
46 /* (non-Javadoc)
47 * @see org.eclipse.linuxtools.tmf.component.ITmfComponent#getName()
48 */
49 protected void setName(String name) {
50 fName = name;
51 }
52
53 // ------------------------------------------------------------------------
54 // ITmfComponent
55 // ------------------------------------------------------------------------
56
57 /* (non-Javadoc)
58 * @see org.eclipse.linuxtools.tmf.component.ITmfComponent#getName()
59 */
60 @Override
61 public String getName() {
62 return fName;
63 }
64
65 /* (non-Javadoc)
66 * @see org.eclipse.linuxtools.tmf.component.ITmfComponent#dispose()
67 */
68 @Override
69 public void dispose() {
70 TmfSignalManager.deregister(this);
71 // if (Tracer.isComponentTraced()) Tracer.traceComponent(this, "terminated");
72 }
73
74 /* (non-Javadoc)
75 * @see org.eclipse.linuxtools.tmf.component.ITmfComponent#broadcast(org.eclipse.linuxtools.tmf.signal.TmfSignal)
76 */
77 @Override
78 public void broadcast(TmfSignal signal) {
79 TmfSignalManager.dispatchSignal(signal);
80 }
81
82 }
This page took 0.031869 seconds and 5 git commands to generate.