Rename xxx.lttng to xxx.lttng.core
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf / src / org / eclipse / linuxtools / tmf / component / TmfComponent.java
index fbedd776f16e19aaeb124df7486109e50e00d156..62d863fc703cd9aaba0caac06693c47099dd6124 100644 (file)
@@ -24,35 +24,57 @@ import org.eclipse.linuxtools.tmf.signal.TmfSignalManager;
  */
 public abstract class TmfComponent implements ITmfComponent {
 
+    // ------------------------------------------------------------------------
+    // Attributes
+    // ------------------------------------------------------------------------
+
+       private String fName;
+       
        // ------------------------------------------------------------------------
        // Constructor
        // ------------------------------------------------------------------------
 
-       public TmfComponent() {
-               register();
+    public TmfComponent() {
+           this(""); //$NON-NLS-1$
+    }
+
+    public void init(String name) {
+        fName = name;
+        TmfSignalManager.register(this);
+    }
+
+       public TmfComponent(String name) {
+               init(name);
+       }
+       
+       public TmfComponent(TmfComponent other) {
+        init(other.fName);
+       }
+       
+    // ------------------------------------------------------------------------
+    // Accessors
+    // ------------------------------------------------------------------------
+
+       protected void setName(String name) {
+               fName = name;
        }
 
        // ------------------------------------------------------------------------
        // ITmfComponent
        // ------------------------------------------------------------------------
 
-       /* (non-Javadoc)
-        * @see org.eclipse.linuxtools.tmf.component.ITmfComponent#register()
-        */
-       public void register() {
-               TmfSignalManager.register(this);
+       @Override
+       public String getName() {
+               return fName;
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.linuxtools.tmf.component.ITmfComponent#deregister()
-        */
-       public void deregister() {
+       @Override
+       public void dispose() {
                TmfSignalManager.deregister(this);
+//             if (Tracer.isComponentTraced()) Tracer.traceComponent(this, "terminated");
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.linuxtools.tmf.component.ITmfComponent#broadcast(org.eclipse.linuxtools.tmf.signal.TmfSignal)
-        */
+       @Override
        public void broadcast(TmfSignal signal) {
                TmfSignalManager.dispatchSignal(signal);
        }
This page took 0.024158 seconds and 5 git commands to generate.