Rename xxx.lttng to xxx.lttng.core
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.core / src / org / eclipse / linuxtools / lttng / signal / StateExperimentListener.java
1 /*******************************************************************************
2 * Copyright (c) 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 * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation
11 *******************************************************************************/
12 package org.eclipse.linuxtools.lttng.signal;
13
14 import org.eclipse.linuxtools.lttng.event.LttngEvent;
15 import org.eclipse.linuxtools.tmf.component.TmfComponent;
16 import org.eclipse.linuxtools.tmf.event.TmfEvent;
17 import org.eclipse.linuxtools.tmf.experiment.TmfExperiment;
18 import org.eclipse.linuxtools.tmf.signal.TmfExperimentRangeUpdatedSignal;
19 import org.eclipse.linuxtools.tmf.signal.TmfExperimentSelectedSignal;
20 import org.eclipse.linuxtools.tmf.signal.TmfSignalHandler;
21
22 /**
23 * @author alvaro
24 *
25 */
26 public class StateExperimentListener extends TmfComponent {
27
28 private final ILttExperimentSelectedListener fhandler;
29
30 public StateExperimentListener(String name, ILttExperimentSelectedListener handler) {
31 super(name);
32 fhandler = handler;
33 }
34
35 @SuppressWarnings("unchecked")
36 @TmfSignalHandler
37 public void experimentSelected(
38 TmfExperimentSelectedSignal<? extends TmfEvent> signal) {
39 TmfExperiment<LttngEvent> experiment = (TmfExperiment<LttngEvent>) signal
40 .getExperiment();
41
42 // notify handler
43 fhandler.experimentSelected(signal.getSource(), experiment);
44 }
45
46 @TmfSignalHandler
47 public void experimentRangeUpdated(TmfExperimentRangeUpdatedSignal signal) {
48 // notify handler
49 fhandler.experimentRangeUpdated(signal);
50 }
51 }
This page took 0.030881 seconds and 5 git commands to generate.