Fix NLS-related Javadoc warnings
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / component / TmfComponent.java
1 /*******************************************************************************
2 * Copyright (c) 2009, 2012 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.core.component;
14
15 import org.eclipse.linuxtools.internal.tmf.core.TmfCoreTracer;
16 import org.eclipse.linuxtools.tmf.core.signal.TmfSignal;
17 import org.eclipse.linuxtools.tmf.core.signal.TmfSignalManager;
18
19 /**
20 * This is the base class of the TMF components.
21 * <p>
22 * Currently, it only addresses the inter-component signaling.
23 *
24 * @version 1.0
25 * @author Francois Chouinard
26 */
27 public abstract class TmfComponent implements ITmfComponent {
28
29 // ------------------------------------------------------------------------
30 // Attributes
31 // ------------------------------------------------------------------------
32
33 private String fName;
34
35 // ------------------------------------------------------------------------
36 // Constructor
37 // ------------------------------------------------------------------------
38
39 /**
40 * Default constructor. To be used in conjunction with init()
41 */
42 public TmfComponent() {
43 this(""); //$NON-NLS-1$
44 }
45
46 /**
47 * Perform component initialization and register it as a signal listener.
48 * Need to be called when the default constructor was used.
49 *
50 * @param name the component name
51 */
52 public void init(String name) {
53 TmfCoreTracer.traceComponent(this, "created"); //$NON-NLS-1$
54 fName = name;
55 TmfSignalManager.register(this);
56 }
57
58 /**
59 * The standard constructor
60 *
61 * @param name the component name
62 */
63 public TmfComponent(String name) {
64 init(name);
65 }
66
67 /**
68 * The copy constructor
69 *
70 * @param other the other component
71 */
72 public TmfComponent(TmfComponent other) {
73 init(other.fName);
74 }
75
76 // ------------------------------------------------------------------------
77 // Getters/setters
78 // ------------------------------------------------------------------------
79
80 /* (non-Javadoc)
81 * @see org.eclipse.linuxtools.tmf.core.component.ITmfComponent#getName()
82 */
83 @Override
84 public String getName() {
85 return fName;
86 }
87
88 /**
89 * @param name the new component name
90 */
91 protected void setName(String name) {
92 fName = name;
93 }
94
95 // ------------------------------------------------------------------------
96 // ITmfComponent
97 // ------------------------------------------------------------------------
98
99 /* (non-Javadoc)
100 * @see org.eclipse.linuxtools.tmf.core.component.ITmfComponent#dispose()
101 */
102 @Override
103 public void dispose() {
104 TmfSignalManager.deregister(this);
105 TmfCoreTracer.traceComponent(this, "disposed"); //$NON-NLS-1$
106 }
107
108 /* (non-Javadoc)
109 * @see org.eclipse.linuxtools.tmf.core.component.ITmfComponent#broadcast(org.eclipse.linuxtools.tmf.core.signal.TmfSignal)
110 */
111 @Override
112 public void broadcast(TmfSignal signal) {
113 TmfSignalManager.dispatchSignal(signal);
114 }
115
116 }
This page took 0.032981 seconds and 5 git commands to generate.