1 /*******************************************************************************
2 * Copyright (c) 2009, 2014 Ericsson
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
10 * Francois Chouinard - Initial API and implementation
11 * Bernd Hufmann - Add interface for broadcasting signals asynchronously
12 *******************************************************************************/
14 package org
.eclipse
.linuxtools
.tmf
.core
.component
;
16 import org
.eclipse
.linuxtools
.internal
.tmf
.core
.TmfCoreTracer
;
17 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfSignal
;
18 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfSignalManager
;
21 * This is the base class of the TMF components.
23 * Currently, it only addresses the inter-component signaling.
26 * @author Francois Chouinard
28 public abstract class TmfComponent
implements ITmfComponent
{
30 // ------------------------------------------------------------------------
32 // ------------------------------------------------------------------------
36 // ------------------------------------------------------------------------
38 // ------------------------------------------------------------------------
41 * Default constructor. To be used in conjunction with init()
43 public TmfComponent() {
44 this(""); //$NON-NLS-1$
48 * Perform component initialization and register it as a signal listener.
49 * Need to be called when the default constructor was used.
54 public void init(String name
) {
55 TmfCoreTracer
.traceComponent(this, "created"); //$NON-NLS-1$
57 TmfSignalManager
.register(this);
61 * The standard constructor
66 public TmfComponent(String name
) {
71 * The copy constructor
76 public TmfComponent(TmfComponent other
) {
80 // ------------------------------------------------------------------------
82 // ------------------------------------------------------------------------
85 public String
getName() {
91 * the new component name
93 protected void setName(String name
) {
97 // ------------------------------------------------------------------------
99 // ------------------------------------------------------------------------
102 public void dispose() {
103 TmfSignalManager
.deregister(this);
104 TmfCoreTracer
.traceComponent(this, "disposed"); //$NON-NLS-1$
108 public void broadcast(TmfSignal signal
) {
109 TmfSignalManager
.dispatchSignal(signal
);
116 public void broadcastAsync(TmfSignal signal
) {
117 TmfSignalManager
.dispatchSignalAsync(signal
);
This page took 0.032078 seconds and 5 git commands to generate.