|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
KernelServices | Line # 31 | 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 | import java.io.File; | |
19 | import java.io.IOException; | |
20 | import java.net.URL; | |
21 | ||
22 | import org.qedeq.kernel.se.common.ModuleAddress; | |
23 | import org.qedeq.kernel.se.common.Plugin; | |
24 | import org.qedeq.kernel.se.visitor.InterruptException; | |
25 | ||
26 | /** | |
27 | * The main QEDEQ kernel methods are assembled here. | |
28 | * | |
29 | * @author Michael Meyling | |
30 | */ | |
31 | public interface KernelServices { | |
32 | ||
33 | /** | |
34 | * Remove all modules from memory. | |
35 | */ | |
36 | public void removeAllModules(); | |
37 | ||
38 | /** | |
39 | * Clear local buffer and all loaded QEDEQ modules. | |
40 | * | |
41 | * @return Was deletion successful? | |
42 | */ | |
43 | public boolean clearLocalBuffer(); | |
44 | ||
45 | /** | |
46 | * Get a certain module. You can check the status to know if the loading was successful. | |
47 | * | |
48 | * @param address Address of module. | |
49 | * @return Wanted module. | |
50 | */ | |
51 | public QedeqBo loadModule(ModuleAddress address); | |
52 | ||
53 | /** | |
54 | * Get required modules of given module. You can check the status to know if the loading was | |
55 | * successful. | |
56 | * | |
57 | * @param address Address of module. | |
58 | * @return Successful loading. | |
59 | */ | |
60 | public boolean loadRequiredModules(ModuleAddress address); | |
61 | ||
62 | /** | |
63 | * Load all QEDEQ modules from project web directory for current kernel. | |
64 | * | |
65 | * @return Successful loading. | |
66 | */ | |
67 | public boolean loadAllModulesFromQedeq(); | |
68 | ||
69 | /** | |
70 | * Remove a certain module. | |
71 | * | |
72 | * @param address Address of module. | |
73 | */ | |
74 | public void removeModule(ModuleAddress address); | |
75 | ||
76 | /** | |
77 | * Get list of all currently loaded QEDEQ modules. | |
78 | * | |
79 | * @return All currently loaded QEDEQ modules. | |
80 | */ | |
81 | public ModuleAddress[] getAllLoadedModules(); | |
82 | ||
83 | /** | |
84 | * Get {@link QedeqBo} for an address. | |
85 | * | |
86 | * @param address Look for this address. | |
87 | * @return Existing or new {@link QedeqBo}. | |
88 | */ | |
89 | public QedeqBo getQedeqBo(ModuleAddress address); | |
90 | ||
91 | /** | |
92 | * Get source of an QEDEQ module. | |
93 | * If the module was not yet not buffered <code>null</code> is returned. | |
94 | * | |
95 | * @param address Address for QEDEQ module address. | |
96 | * @return Contents of locally buffered QEDEQ module. | |
97 | * @throws IOException Loading failed. | |
98 | */ | |
99 | public String getSource(ModuleAddress address) throws IOException; | |
100 | ||
101 | /** | |
102 | * Get module address from URL. | |
103 | * | |
104 | * @param url URL for QEDEQ module. | |
105 | * @return Module address. | |
106 | * @throws IOException URL has not the correct format for referencing a QEDEQ module. | |
107 | */ | |
108 | public ModuleAddress getModuleAddress(URL url) throws IOException; | |
109 | ||
110 | /** | |
111 | * Get module address from URL. | |
112 | * | |
113 | * @param url URL for QEDEQ module. | |
114 | * @return Module address. | |
115 | * @throws IOException URL has not the correct format for referencing a QEDEQ module. | |
116 | */ | |
117 | public ModuleAddress getModuleAddress(String url) throws IOException; | |
118 | ||
119 | /** | |
120 | * Get module address from URL. | |
121 | * | |
122 | * @param file Local QEDEQ module. | |
123 | * @return Module address. | |
124 | * @throws IOException URL has not the correct format for referencing a QEDEQ module. | |
125 | */ | |
126 | public ModuleAddress getModuleAddress(File file) throws IOException; | |
127 | ||
128 | /** | |
129 | * Check if all formulas of a QEDEQ module and its required modules are well formed. | |
130 | * | |
131 | * @param address Module to check. | |
132 | * @return Was check successful? | |
133 | */ | |
134 | public boolean checkWellFormedness(ModuleAddress address); | |
135 | ||
136 | /** | |
137 | * Check if all propositions of this and all required modules have correct formal proofs. | |
138 | * | |
139 | * @param address Module to check. | |
140 | * @return Was check successful? | |
141 | */ | |
142 | public boolean checkFormallyProved(ModuleAddress address); | |
143 | ||
144 | /** | |
145 | * Get all installed plugins. | |
146 | * | |
147 | * @return Installed plugins. | |
148 | */ | |
149 | public Plugin[] getPlugins(); | |
150 | ||
151 | /** | |
152 | * Execute plugin on given QEDEQ module. | |
153 | * | |
154 | * @param id Plugin id. | |
155 | * @param address QEDEQ module address. | |
156 | * @param data Process data. Additional data beside module. | |
157 | * @throws InterruptException User canceled further processing. | |
158 | * @return Plugin specific resulting object. Might be <code>null</code>. | |
159 | */ | |
160 | public Object executePlugin(final String id, final ModuleAddress address, final Object data) | |
161 | throws InterruptException; | |
162 | ||
163 | /** | |
164 | * Clear all plugin warnings and errors for given module. | |
165 | * | |
166 | * @param address QEDEQ module address. | |
167 | */ | |
168 | public void clearAllPluginResults(final ModuleAddress address); | |
169 | ||
170 | /** | |
171 | * Get information about all service processes. | |
172 | * | |
173 | * @return Result. | |
174 | */ | |
175 | public ServiceProcess[] getServiceProcesses(); | |
176 | ||
177 | /** | |
178 | * Get all running service processes. But remember a running process might currently | |
179 | * be blocked. | |
180 | * | |
181 | * @return All service running processes. | |
182 | */ | |
183 | public ServiceProcess[] getRunningServiceProcesses(); | |
184 | ||
185 | /** | |
186 | * Stop all currently running plugin executions. | |
187 | */ | |
188 | public void stopAllPluginExecutions(); | |
189 | ||
190 | } |
|