Commit | Line | Data |
---|---|---|
af3275f8 AM |
1 | /******************************************************************************* |
2 | * Copyright (c) 2015 Ericsson | |
3 | * | |
4 | * All rights reserved. This program and the accompanying materials | |
5 | * are made available under the terms of the Eclipse Public License v1.0 | |
6 | * which accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
8 | * | |
9 | * Contributors: | |
10 | * Matthew Khouzam - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
13 | package org.lttng.scope.lttng.kernel.core.analysis.os.handlers.internal; | |
14 | ||
15 | import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; | |
16 | import org.lttng.scope.lttng.kernel.core.trace.layout.ILttngKernelEventLayout; | |
17 | ||
18 | import ca.polymtl.dorsal.libdelorean.ITmfStateSystemBuilder; | |
19 | import ca.polymtl.dorsal.libdelorean.exceptions.AttributeNotFoundException; | |
20 | ||
21 | /** | |
22 | * Base class for all kernel event handlers. | |
23 | */ | |
24 | public abstract class KernelEventHandler { | |
25 | ||
26 | private final ILttngKernelEventLayout fLayout; | |
27 | ||
28 | /** | |
29 | * Constructor | |
30 | * | |
31 | * @param layout | |
32 | * the analysis layout | |
33 | */ | |
34 | public KernelEventHandler(ILttngKernelEventLayout layout) { | |
35 | fLayout = layout; | |
36 | } | |
37 | ||
38 | /** | |
39 | * Get the analysis layout | |
40 | * | |
41 | * @return the analysis layout | |
42 | */ | |
43 | protected ILttngKernelEventLayout getLayout() { | |
44 | return fLayout; | |
45 | } | |
46 | ||
47 | /** | |
48 | * Handle a specific kernel event. | |
49 | * | |
50 | * @param ss | |
51 | * the state system to write to | |
52 | * @param event | |
53 | * the event | |
54 | * @throws AttributeNotFoundException | |
55 | * if the attribute is not yet create | |
56 | */ | |
57 | public abstract void handleEvent(ITmfStateSystemBuilder ss, ITmfEvent event) throws AttributeNotFoundException; | |
58 | ||
59 | } |