Commit | Line | Data |
---|---|---|
5d10d135 ASL |
1 | /******************************************************************************* |
2 | * Copyright (c) 2009, 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 | *******************************************************************************/ | |
6c13869b | 12 | package org.eclipse.linuxtools.lttng.core.state.resource; |
5d10d135 | 13 | |
6c13869b | 14 | import org.eclipse.linuxtools.lttng.core.model.ILTTngTreeNode; |
5d10d135 ASL |
15 | |
16 | /** | |
17 | * @author alvaro | |
18 | * | |
19 | */ | |
20 | public interface ILTTngStateResource<E extends ILTTngStateResource<E>> extends | |
21 | ILTTngTreeNode<E> { | |
22 | ||
23 | // ======================================================================== | |
24 | // Interface methods | |
25 | // ======================================================================= | |
26 | /** | |
27 | * @return | |
28 | */ | |
29 | public GlobalStateMode getStateMode(); | |
30 | ||
31 | /** | |
32 | * @return | |
33 | */ | |
34 | public ILttngStateContext getContext(); | |
35 | ||
36 | // ======================================================================== | |
37 | // Interface Enums | |
38 | // ======================================================================= | |
39 | /** | |
40 | * <p> | |
41 | * Represents the specific type of resources known by the application | |
42 | * </p> | |
43 | * | |
44 | */ | |
45 | public enum ResourceType { | |
9c4eb5f7 FC |
46 | LTT_RESOURCE_PROCESS("process"), /* */ //$NON-NLS-1$ |
47 | LTT_RESOURCE_CPU("cpu"), /* */ //$NON-NLS-1$ | |
48 | LTT_RESOURCE_BDEV("bdev"), /* */ //$NON-NLS-1$ | |
49 | LTT_RESOURCE_IRQ("irq"), /* */ //$NON-NLS-1$ | |
50 | LTT_RESOURCE_SOFTIRQ("softIrq"), /* */ //$NON-NLS-1$ | |
51 | LTT_RESOURCE_TRAP("trap"), /* */ //$NON-NLS-1$ | |
52 | LTT_RESOURCE_RUNNING_PROCESS("running"); /* */ //$NON-NLS-1$ | |
5d10d135 ASL |
53 | |
54 | String inName; | |
55 | ||
56 | private ResourceType(String name) { | |
57 | this.inName = name; | |
58 | } | |
59 | ||
60 | public String getInName() { | |
61 | return this.inName; | |
62 | } | |
63 | } | |
64 | ||
65 | /** | |
66 | * <p>unifies the possible states of the state resources known by the application</p> | |
67 | * | |
68 | */ | |
69 | public enum GlobalStateMode { | |
9c4eb5f7 FC |
70 | LTT_STATEMODE_UNNAMED("unnamed"), /* */ //$NON-NLS-1$ |
71 | LTT_STATEMODE_UNKNOWN("unknown"), /* */ //$NON-NLS-1$ | |
72 | LTT_STATEMODE_IDLE("idle"), /* */ //$NON-NLS-1$ | |
73 | LTT_STATEMODE_BUSY("busy"), /* */ //$NON-NLS-1$ | |
74 | LTT_STATEMODE_PENDING("pending"), /* */ //$NON-NLS-1$ | |
75 | LTT_STATEMODE_READING("reading"), /* */ //$NON-NLS-1$ | |
76 | LTT_STATEMODE_WRITING("writing"), /* */ //$NON-NLS-1$ | |
77 | LTT_STATEMODE_IRQ("irq"), /* */ //$NON-NLS-1$ | |
78 | LTT_STATEMODE_SOFTIRQ("softirq"), /* */ //$NON-NLS-1$ | |
79 | LTT_STATEMODE_TRAP("trap"), /* */ //$NON-NLS-1$ | |
80 | LTT_STATEMODE_WAIT_FORK("waitfork"), /* */ //$NON-NLS-1$ | |
81 | LTT_STATEMODE_WAIT_CPU("waitcpu"), /* */ //$NON-NLS-1$ | |
82 | LTT_STATEMODE_EXIT("exit"), /* */ //$NON-NLS-1$ | |
83 | LTT_STATEMODE_ZOMBIE("zombie"), /* */ //$NON-NLS-1$ | |
84 | LTT_STATEMODE_WAIT_IO("waitio"), /* */ //$NON-NLS-1$ | |
85 | LTT_STATEMODE_RUN("run"), /* */ //$NON-NLS-1$ | |
86 | LTT_STATEMODE_DEAD("dead"), /* */ //$NON-NLS-1$ | |
87 | LTT_STATEMODE_USER_MODE("usermode"), /* */ //$NON-NLS-1$ | |
88 | LTT_STATEMODE_SYSCALL("syscall"); /* */ //$NON-NLS-1$ | |
5d10d135 ASL |
89 | |
90 | ||
91 | String inName; | |
92 | ||
93 | private GlobalStateMode(String name) { | |
94 | this.inName = name; | |
95 | } | |
96 | ||
97 | public String getInName() { | |
98 | return this.inName; | |
99 | } | |
100 | } | |
101 | ||
102 | } |