|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ServiceProcess | Line # 25 | 0 | 0 | - |
-1.0
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
No Tests | |||
1 | /* This file is part of the project "Hilbert II" - http://www.qedeq.org | |
2 | * | |
3 | * Copyright 2000-2013, Michael Meyling <mime@qedeq.org>. | |
4 | * | |
5 | * "Hilbert II" is free software; you can redistribute | |
6 | * it and/or modify it under the terms of the GNU General Public | |
7 | * License as published by the Free Software Foundation; either | |
8 | * version 2 of the License, or (at your option) any later version. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | */ | |
15 | ||
16 | package org.qedeq.kernel.bo.common; | |
17 | ||
18 | ||
19 | ||
20 | /** | |
21 | * Process info for a kernel service. | |
22 | * | |
23 | * @author Michael Meyling | |
24 | */ | |
25 | public interface ServiceProcess extends Comparable { | |
26 | ||
27 | /** | |
28 | * Get currently running service call. | |
29 | * | |
30 | * @return Service call. | |
31 | */ | |
32 | public ServiceCall getServiceCall(); | |
33 | ||
34 | /** | |
35 | * Get thread the service runs within. | |
36 | * | |
37 | * @return Service thread. | |
38 | */ | |
39 | public Thread getThread(); | |
40 | ||
41 | /** | |
42 | * Get currently processed QedeqBo. | |
43 | * | |
44 | * @return QEDEQ module. Might be <code>null</code>. | |
45 | */ | |
46 | public QedeqBo getQedeq(); | |
47 | ||
48 | /** | |
49 | * Get name of currently processed QedeqBo. | |
50 | * | |
51 | * @return Name of QEDEQ module. Might be empty string. | |
52 | */ | |
53 | public String getQedeqName(); | |
54 | ||
55 | /** | |
56 | * Get URL of currently processed QedeqBo. | |
57 | * | |
58 | * @return URL of QEDEQ module. Might be empty string. | |
59 | */ | |
60 | public String getQedeqUrl(); | |
61 | ||
62 | /** | |
63 | * Get timestamp for service start. | |
64 | * | |
65 | * @return Service start timestamp. | |
66 | */ | |
67 | public long getStart(); | |
68 | ||
69 | /** | |
70 | * Get timestamp for service stop. | |
71 | * | |
72 | * @return Service stop timestamp. | |
73 | */ | |
74 | public long getStop(); | |
75 | ||
76 | /** | |
77 | * Is the process still running? | |
78 | * | |
79 | * @return The process is still running. (But it might be blocked.) | |
80 | */ | |
81 | public boolean isRunning(); | |
82 | ||
83 | /** | |
84 | * Is the process running, but is blocked? | |
85 | * | |
86 | * @return Process is running and blocked. | |
87 | */ | |
88 | public boolean isBlocked(); | |
89 | ||
90 | /** | |
91 | * Has the process normally ended? | |
92 | * | |
93 | * @return Has the process normally ended? | |
94 | */ | |
95 | public boolean wasSuccess(); | |
96 | ||
97 | /** | |
98 | * Has the process been canceled? | |
99 | * | |
100 | * @return The process has been canceled. | |
101 | */ | |
102 | public boolean wasFailure(); | |
103 | ||
104 | /** | |
105 | * Interrupt running thread. Usually because of user canceling. This should initiate a | |
106 | * {@link org.qedeq.kernel.se.visitor.InterruptException} when {@link Thread.interrupted()} | |
107 | * is <code>true</code>. | |
108 | */ | |
109 | public void interrupt(); | |
110 | ||
111 | /** | |
112 | * Get action name. This is what the process mainly does. | |
113 | * | |
114 | * @return Action name. | |
115 | */ | |
116 | public String getActionName(); | |
117 | ||
118 | /** | |
119 | * Get percentage of currently running execution. | |
120 | * | |
121 | * @return Number between 0 and 100. | |
122 | */ | |
123 | public double getExecutionPercentage(); | |
124 | ||
125 | /** | |
126 | * Get description of currently taken action. | |
127 | * | |
128 | * @return We are doing this currently. | |
129 | */ | |
130 | public String getExecutionActionDescription(); | |
131 | ||
132 | /** | |
133 | * Get {@link QedeqModule}s blocked by this process. | |
134 | * | |
135 | * @return Blocked QEDEQ modules. | |
136 | */ | |
137 | public QedeqBoSet getBlockedModules(); | |
138 | ||
139 | /** | |
140 | * Get currently processed {@link QedeqModule} list. This includes QEDEQ modules we try to get a lock for. | |
141 | * | |
142 | * @return QEDEQ modules we currently try to process. | |
143 | */ | |
144 | public QedeqBo[] getCurrentlyProcessedModules(); | |
145 | ||
146 | /** | |
147 | * Get process id. | |
148 | * | |
149 | * @return Process identifying number. | |
150 | */ | |
151 | public long getId(); | |
152 | ||
153 | } |
|