Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart6.png 80% of files have more coverage
434   1,165   158   5.49
78   863   0.36   79
79     2  
1    
 
  DefaultInternalKernelServices       Line # 75 434 158 53.6% 0.53637904
 
  (101)
 
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.service.control;
17   
18    import java.io.File;
19    import java.io.FileFilter;
20    import java.io.IOException;
21    import java.io.Reader;
22    import java.io.UnsupportedEncodingException;
23    import java.net.MalformedURLException;
24    import java.net.URL;
25    import java.net.URLEncoder;
26    import java.util.ArrayList;
27    import java.util.List;
28   
29    import org.qedeq.base.io.IoUtility;
30    import org.qedeq.base.io.LoadingListener;
31    import org.qedeq.base.io.Parameters;
32    import org.qedeq.base.io.SourceArea;
33    import org.qedeq.base.io.TextInput;
34    import org.qedeq.base.io.UrlUtility;
35    import org.qedeq.base.trace.Trace;
36    import org.qedeq.base.utility.StringUtility;
37    import org.qedeq.kernel.bo.common.KernelProperties;
38    import org.qedeq.kernel.bo.common.QedeqBo;
39    import org.qedeq.kernel.bo.common.ServiceModule;
40    import org.qedeq.kernel.bo.common.ServiceProcess;
41    import org.qedeq.kernel.bo.log.QedeqLog;
42    import org.qedeq.kernel.bo.module.InternalKernelServices;
43    import org.qedeq.kernel.bo.module.InternalServiceCall;
44    import org.qedeq.kernel.bo.module.InternalServiceProcess;
45    import org.qedeq.kernel.bo.module.KernelQedeqBo;
46    import org.qedeq.kernel.bo.module.QedeqFileDao;
47    import org.qedeq.kernel.bo.module.ServiceExecutor;
48    import org.qedeq.kernel.bo.service.dependency.LoadDirectlyRequiredModulesPlugin;
49    import org.qedeq.kernel.bo.service.dependency.LoadRequiredModulesPlugin;
50    import org.qedeq.kernel.bo.service.logic.FormalProofCheckerPlugin;
51    import org.qedeq.kernel.bo.service.logic.SimpleProofFinderPlugin;
52    import org.qedeq.kernel.bo.service.logic.WellFormedCheckerPlugin;
53    import org.qedeq.kernel.se.base.module.Qedeq;
54    import org.qedeq.kernel.se.base.module.Specification;
55    import org.qedeq.kernel.se.common.DefaultModuleAddress;
56    import org.qedeq.kernel.se.common.ModuleAddress;
57    import org.qedeq.kernel.se.common.ModuleDataException;
58    import org.qedeq.kernel.se.common.Plugin;
59    import org.qedeq.kernel.se.common.Service;
60    import org.qedeq.kernel.se.common.SourceFileException;
61    import org.qedeq.kernel.se.common.SourceFileExceptionList;
62    import org.qedeq.kernel.se.config.QedeqConfig;
63    import org.qedeq.kernel.se.dto.module.QedeqVo;
64    import org.qedeq.kernel.se.state.LoadingState;
65    import org.qedeq.kernel.se.visitor.ContextChecker;
66    import org.qedeq.kernel.se.visitor.DefaultContextChecker;
67    import org.qedeq.kernel.se.visitor.InterruptException;
68   
69   
70    /**
71    * This class provides a default implementation for the QEDEQ module services.
72    *
73    * @author Michael Meyling
74    */
 
75    public class DefaultInternalKernelServices implements ServiceModule, InternalKernelServices,
76    Service {
77   
78    /** This class. */
79    private static final Class CLASS = DefaultInternalKernelServices.class;
80   
81    /** Collection of already known QEDEQ modules. */
82    private KernelQedeqBoStorage modules;
83   
84    /** Config access. */
85    private final QedeqConfig config;
86   
87    /** Basic kernel properties. */
88    private final KernelProperties kernel;
89   
90    /** This instance nows how to load a module from the file system. */
91    private final QedeqFileDao qedeqFileDao;
92   
93    /** Synchronize module access. */
94    private ModuleArbiter arbiter;
95   
96    /** This instance manages plugins. */
97    private final PluginManager pluginManager;
98   
99    /** This instance manages service processes. */
100    private ServiceProcessManager processManager;
101   
102    /** Validate module dependencies and status. */
103    private boolean validate = true;
104   
105    /** We check the context with this checker. */
106    private ContextChecker contextChecker;
107   
108    /**
109    * Constructor.
110    *
111    * @param config For config access.
112    * @param kernel For kernel properties.
113    * @param loader For loading QEDEQ modules.
114    */
 
115  471 toggle public DefaultInternalKernelServices(final QedeqConfig config, final KernelProperties kernel,
116    final QedeqFileDao loader) {
117  471 this.config = config;
118  471 this.kernel = kernel;
119  471 this.qedeqFileDao = loader;
120  471 pluginManager = new PluginManager(this);
121  471 loader.setServices(this);
122   
123    //// pluginManager.addPlugin(MultiProofFinderPlugin.class.getName());
124  471 pluginManager.addPlugin("org.qedeq.kernel.bo.service.unicode.Qedeq2UnicodeTextPlugin");
125  471 pluginManager.addPlugin("org.qedeq.kernel.bo.service.latex.Qedeq2LatexPlugin");
126  471 pluginManager.addPlugin("org.qedeq.kernel.bo.service.unicode.Qedeq2Utf8Plugin");
127    //// pluginManager.addPlugin("org.qedeq.kernel.bo.service.heuristic.HeuristicCheckerPlugin");
128  471 pluginManager.addPlugin("org.qedeq.kernel.bo.service.heuristic.DynamicHeuristicCheckerPlugin");
129  471 pluginManager.addPlugin(SimpleProofFinderPlugin.class.getName());
130   
131    // add internal plugins
132  471 pluginManager.addPlugin(LoadDirectlyRequiredModulesPlugin.class.getName());
133  471 pluginManager.addPlugin(LoadRequiredModulesPlugin.class.getName());
134  471 pluginManager.addPlugin(WellFormedCheckerPlugin.class.getName());
135  471 pluginManager.addPlugin(FormalProofCheckerPlugin.class.getName());
136    }
137   
 
138  471 toggle public void startupServices() {
139  471 modules = new KernelQedeqBoStorage();
140  471 arbiter = new ModuleArbiter();
141  471 processManager = new ServiceProcessManager(pluginManager, arbiter);
142  471 contextChecker = new DefaultContextChecker();
143  471 if (config.isAutoReloadLastSessionChecked()) {
144  0 autoReloadLastSessionChecked();
145    }
146    }
147   
 
148  471 toggle public void shutdownServices() {
149  471 processManager.terminateAndRemoveAllServiceProcesses();
150  471 processManager = null;
151  471 modules.removeAllModules();
152  471 modules = null;
153  471 arbiter = null;
154    // clear thread interrupt flag because we might have interrupted ourself
155  471 Thread.interrupted();
156    }
157   
158    /**
159    * If configured load all QEDEQ modules that where successfully loaded the last time.
160    */
 
161  0 toggle public void autoReloadLastSessionChecked() {
162  0 if (config.isAutoReloadLastSessionChecked()) {
163  0 final Thread thread = new Thread() {
 
164  0 toggle public void run() {
165  0 final String method = "autoReloadLastSessionChecked.thread.run()";
166  0 try {
167  0 Trace.begin(CLASS, this, method);
168  0 QedeqLog.getInstance().logMessage(
169    "Trying to load previously successfully loaded modules.");
170  0 final int number = config.getPreviouslyLoadedModules().length;
171  0 if (loadPreviouslySuccessfullyLoadedModules()) {
172  0 QedeqLog.getInstance().logMessage(
173    "Loading of " + number + " previously successfully loaded module"
174  0 + (number != 1 ? "s" : "") + " successfully done.");
175    } else {
176  0 QedeqLog.getInstance().logMessage(
177    "Loading of all previously successfully checked modules failed. "
178  0 + number + " module" + (number != 1 ? "s" : "")
179    + " were tried.");
180    }
181    } catch (Exception e) {
182  0 Trace.trace(CLASS, this, method, e);
183    } finally {
184  0 Trace.end(CLASS, this, method);
185    }
186    }
187    };
188  0 thread.setDaemon(true);
189  0 thread.start();
190    }
191    }
192   
 
193  0 toggle public void removeAllModules() {
194  0 getModules().removeAllModules();
195    // FIXME implement as below for removeModule
196    }
197   
198    /**
199    * Remove a QEDEQ module from memory.
200    *
201    * @param address Remove module identified by this address.
202    */
 
203  0 toggle public void removeModule(final ModuleAddress address) {
204  0 final KernelQedeqBo prop = getKernelQedeqBo(address);
205  0 if (prop != null) {
206  0 QedeqLog.getInstance().logRequest("Removing module", address.getUrl());
207  0 InternalServiceProcess proc = null;
208  0 InternalServiceCall call = null;
209  0 try {
210  0 proc = processManager.createServiceProcess("remove module");
211  0 call = processManager.createServiceCall(this, prop, Parameters.EMPTY,
212    Parameters.EMPTY, proc);
213  0 removeModule((DefaultKernelQedeqBo) prop);
214  0 call.finish();
215  0 proc.setSuccessState();
216    } catch (final InterruptException e) {
217  0 QedeqLog.getInstance().logFailureReply(
218    "Remove failed", address.getUrl(), e.getMessage());
219  0 if (proc != null) {
220  0 proc.setFailureState();
221    }
222    } finally {
223  0 processManager.endServiceCall(call);
224    }
225  0 if (validate) {
226  0 modules.validateDependencies();
227    }
228    }
229    }
230   
231    /**
232    * Remove a QEDEQ module from memory. This method must block all other methods and if this
233    * method runs no other is allowed to run
234    *
235    * @param prop Remove module identified by this property.
236    */
 
237  0 toggle private void removeModule(final DefaultKernelQedeqBo prop) {
238  0 synchronized (prop) {
239    // FIXME mime 20080319: one could call prop.setLoadingProgressState(
240    // LoadingState.STATE_DELETED) alone but that would
241    // miss to inform the KernelQedeqBoPool. How do we inform the pool?
242    // must the StateManager have a reference to it?
243  0 prop.delete();
244  0 getModules().removeModule(prop);
245  0 return;
246    }
247    }
248   
249    /**
250    * Clear local file buffer and all loaded QEDEQ modules.
251    *
252    * @return Successful?
253    */
 
254  0 toggle public boolean clearLocalBuffer() {
255  0 final String method = "clearLocalBuffer";
256  0 try {
257  0 QedeqLog.getInstance().logMessage(
258    "Clear local buffer from all QEDEQ files.");
259  0 removeAllModules();
260  0 final File bufferDir = getBufferDirectory().getCanonicalFile();
261  0 if (bufferDir.exists() && !IoUtility.deleteDir(bufferDir, new FileFilter() {
 
262  0 toggle public boolean accept(final File pathname) {
263  0 return pathname.getName().endsWith(".xml");
264    }
265    })) {
266  0 throw new IOException("buffer could not be deleted: " + bufferDir);
267    }
268  0 QedeqLog.getInstance().logMessage("Local buffer was cleared.");
269  0 return true;
270    } catch (IOException e) {
271  0 Trace.fatal(CLASS, this, method, "IO access problem", e);
272  0 QedeqLog.getInstance().logMessage(
273    "Local buffer not cleared. IO access problem. " + e.getMessage());
274  0 return false;
275    } catch (final RuntimeException e) {
276  0 Trace.fatal(CLASS, this, method, "unexpected problem", e);
277  0 QedeqLog.getInstance().logMessage(
278    "Local buffer not cleared. " + e.getMessage());
279  0 return false;
280    }
281    }
282   
 
283  652 toggle public KernelQedeqBo loadKernelModule(final InternalServiceProcess process, final ModuleAddress address)
284    throws InterruptException {
285  652 final String method = "loadModule(InternalServiceProcess, ModuleAddress)";
286  652 final DefaultKernelQedeqBo prop = getModules().getKernelQedeqBo(this, address);
287  652 final ServiceExecutor executor = new ServiceExecutor() {
 
288  652 toggle public void executeService(final InternalServiceCall call) throws InterruptException {
289  652 try {
290  652 synchronized (prop) {
291  652 if (prop.isLoaded()) {
292  232 call.finish();
293  232 return;
294    }
295  420 QedeqLog.getInstance().logRequest("Load module", address.getUrl());
296  420 if (prop.getModuleAddress().isFileAddress()) {
297  387 call.setAction("file loading");
298  387 loadLocalModule(call.getInternalServiceProcess(), prop);
299    } else {
300    // search in local file buffer
301  33 try {
302  33 getCanonicalReadableFile(prop);
303    } catch (ModuleFileNotFoundException e) { // file not found
304    // we will continue by creating a local copy
305  0 call.setAction("web loading");
306  0 saveQedeqFromWebToBuffer(call, prop);
307  0 call.setExecutionPercentage(50);
308    }
309  33 call.setAction("buffer loading");
310  33 loadBufferedModule(call.getInternalServiceProcess(), prop);
311    }
312  403 QedeqLog.getInstance().logSuccessfulReply(
313    "Successfully loaded", address.getUrl());
314  403 call.finish();
315    }
316    } catch (SourceFileExceptionList e) {
317  17 Trace.trace(CLASS, this, method, e);
318  17 QedeqLog.getInstance().logFailureState("Loading of module failed.", address.getUrl(),
319    e.toString());
320  17 call.finish("Loading of module failed.");
321    } catch (final RuntimeException e) {
322  0 Trace.fatal(CLASS, this, method, "unexpected problem", e);
323  0 QedeqLog.getInstance().logFailureReply("Loading failed", address.getUrl(), e.getMessage());
324  0 call.finish("Loading of module failed: " + e.getMessage());
325    }
326    }
327   
328    };
329  652 this.processManager.executeService(new Service() {
 
330  0 toggle public String getServiceAction() {
331  0 return "load QEDEQ module";
332    }
333   
 
334  0 toggle public String getServiceDescription() {
335  0 return "take QEDEQ module address and try to load and parse the content";
336    }
337   
 
338  652 toggle public String getServiceId() {
339  652 return "" + hashCode();
340    }
341    }, executor, prop, process);
342  652 return prop;
343    // try {
344    // synchronized (prop) {
345    // if (prop.isLoaded()) {
346    // return prop;
347    // }
348    // QedeqLog.getInstance().logRequest("Load module", address.getUrl());
349    // if (prop.getModuleAddress().isFileAddress()) {
350    // loadLocalModule(proc, prop);
351    // } else {
352    // // search in local file buffer
353    // try {
354    // getCanonicalReadableFile(prop);
355    // } catch (ModuleFileNotFoundException e) { // file not found
356    // // we will continue by creating a local copy
357    // saveQedeqFromWebToBuffer(prop);
358    // }
359    // loadBufferedModule(proc, prop);
360    // }
361    // QedeqLog.getInstance().logSuccessfulReply(
362    // "Successfully loaded", address.getUrl());
363    // }
364    // } catch (SourceFileExceptionList e) {
365    // Trace.trace(CLASS, this, method, e);
366    // QedeqLog.getInstance().logFailureState("Loading of module failed!", address.getUrl(),
367    // e.toString());
368    // } catch (final RuntimeException e) {
369    // Trace.fatal(CLASS, this, method, "unexpected problem", e);
370    // QedeqLog.getInstance().logFailureReply("Loading failed", address.getUrl(), e.getMessage());
371    // } finally {
372    // call.setSuccessState();
373    // }
374    // return prop;
375    }
376   
377   
 
378  509 toggle public QedeqBo loadModule(final ModuleAddress address) {
379  509 final InternalServiceProcess proc = processManager.createServiceProcess("LoadModule");
380  509 final QedeqBo result = getQedeqBo(address);
381  509 try {
382  509 loadKernelModule(proc, address);
383  509 proc.setSuccessState();
384    } catch (InterruptException e) {
385  0 proc.setFailureState();
386    }
387  509 return result;
388    }
389   
390    /**
391    * Load buffered QEDEQ module file.
392    *
393    * @param process Service process we run within.
394    * @param prop Load this.
395    * @throws SourceFileExceptionList Loading or QEDEQ module failed.
396    */
 
397  43 toggle private void loadBufferedModule(final InternalServiceProcess process,
398    final DefaultKernelQedeqBo prop) throws SourceFileExceptionList {
399  43 prop.setLoadingProgressState(LoadingState.STATE_LOADING_FROM_BUFFER);
400  43 final File localFile;
401  43 try {
402  43 localFile = getCanonicalReadableFile(prop);
403    } catch (ModuleFileNotFoundException e) {
404  6 final SourceFileExceptionList sfl = createSourceFileExceptionList(
405    ServiceErrors.LOADING_FROM_FILE_BUFFER_FAILED_CODE,
406    ServiceErrors.LOADING_FROM_FILE_BUFFER_FAILED_TEXT,
407    prop.getUrl(), e);
408  6 prop.setLoadingFailureState(LoadingState.STATE_LOADING_FROM_BUFFER_FAILED, sfl);
409  6 throw sfl;
410    }
411   
412  37 prop.setQedeqFileDao(getQedeqFileDao()); // remember loader for this module
413  37 final Qedeq qedeq;
414  37 try {
415  37 qedeq = getQedeqFileDao().loadQedeq(process, prop, localFile);
416    } catch (SourceFileExceptionList sfl) {
417  0 prop.setLoadingFailureState(LoadingState.STATE_LOADING_FROM_BUFFER_FAILED, sfl);
418  0 throw sfl;
419    }
420  37 setCopiedQedeq(process, prop, qedeq);
421    }
422   
423    /**
424    * Load QEDEQ module file with file loader.
425    *
426    * @param process Service process we run within.
427    * @param prop Load this.
428    * @throws SourceFileExceptionList Loading or copying QEDEQ module failed.
429    */
 
430  556 toggle private void loadLocalModule(final InternalServiceProcess process,
431    final DefaultKernelQedeqBo prop) throws SourceFileExceptionList {
432  556 prop.setLoadingProgressState(LoadingState.STATE_LOADING_FROM_LOCAL_FILE);
433  556 final File localFile;
434  556 try {
435  556 localFile = getCanonicalReadableFile(prop);
436    } catch (ModuleFileNotFoundException e) {
437  19 final SourceFileExceptionList sfl = createSourceFileExceptionList(
438    ServiceErrors.LOADING_FROM_LOCAL_FILE_FAILED_CODE,
439    ServiceErrors.LOADING_FROM_LOCAL_FILE_FAILED_TEXT,
440    prop.getUrl(), e);
441  19 prop.setLoadingFailureState(LoadingState.STATE_LOADING_FROM_LOCAL_FILE_FAILED, sfl);
442  19 throw sfl;
443    }
444  537 prop.setQedeqFileDao(getQedeqFileDao()); // remember loader for this module
445   
446  537 final Qedeq qedeq;
447  537 try {
448  537 qedeq = getQedeqFileDao().loadQedeq(process, prop, localFile);
449    } catch (SourceFileExceptionList sfl) {
450  14 prop.setLoadingFailureState(LoadingState.STATE_LOADING_FROM_LOCAL_FILE_FAILED, sfl);
451  14 throw sfl;
452    }
453  523 setCopiedQedeq(process, prop, qedeq);
454    }
455   
 
456  560 toggle private void setCopiedQedeq(final InternalServiceProcess process, final DefaultKernelQedeqBo prop,
457    final Qedeq qedeq) throws SourceFileExceptionList {
458  560 final String method = "setCopiedQedeq(DefaultKernelQedeqBo, Qedeq)";
459  560 prop.setLoadingProgressState(LoadingState.STATE_LOADING_INTO_MEMORY);
460  560 QedeqVo vo = null;
461  560 try {
462  560 vo = QedeqVoBuilder.createQedeq(prop.getModuleAddress(), qedeq);
463    } catch (RuntimeException e) {
464  0 Trace.fatal(CLASS, this, method, "looks like a programming error", e);
465  0 final SourceFileExceptionList xl = createSourceFileExceptionList(
466    ServiceErrors.RUNTIME_ERROR_CODE,
467    ServiceErrors.RUNTIME_ERROR_TEXT,
468    prop.getModuleAddress().getUrl(), e);
469  0 prop.setLoadingFailureState(LoadingState.STATE_LOADING_INTO_MEMORY_FAILED, xl);
470  0 throw xl;
471    } catch (ModuleDataException e) {
472  0 if (e.getCause() != null) {
473  0 Trace.fatal(CLASS, this, method, "looks like a programming error", e.getCause());
474    } else {
475  0 Trace.fatal(CLASS, this, method, "looks like a programming error", e);
476    }
477  0 final SourceFileExceptionList xl = prop.createSourceFileExceptionList(this, e, qedeq);
478  0 prop.setLoadingFailureState(LoadingState.STATE_LOADING_INTO_MEMORY_FAILED, xl);
479  0 throw xl;
480    }
481  560 prop.setQedeqVo(vo);
482    // TODO 20110213 m31: perhaps we need a new state, pre loaded? So when we put more
483    // label testing into the moduleLabelCreator, we still can launch some plugins
484    // On the other side: Label checking is only possible, if all referenced modules can
485    // be loaded.
486    //
487    // Correct labels are necessary for many plugins (e.g. LaTeX and UTF-8 generation).
488    // So a label checker must be run before that.
489    // It might be a good idea to put it into the formal logic checker.
490    // We could make a FormalChecker plugin. This starts loading required modules, checks
491    // the labels and checks if the formulas are correctly written.
492    // So we get some sub status (for every check) and an overall status (all checks
493    // green). Later on the formal proof checker can be integrated too.
494    // This should be the extended load status.
495  560 final ModuleLabelsCreator moduleNodesCreator = new ModuleLabelsCreator(this, prop);
496  560 try {
497  560 moduleNodesCreator.createLabels(process);
498  557 prop.setLoaded(vo, moduleNodesCreator.getLabels(), moduleNodesCreator.getConverter(),
499    moduleNodesCreator.getTextConverter());
500    } catch (SourceFileExceptionList sfl) {
501  3 prop.setLoadingFailureState(LoadingState.STATE_LOADING_INTO_MEMORY_FAILED, sfl);
502  3 throw sfl;
503    }
504    }
505   
506    /**
507    * Check if file exists and is readable. Checks the local buffer file for a buffered module or
508    * the module file address directly. Returns canonical file path.
509    *
510    * @param prop Check for this file.
511    * @return Canonical file path.
512    * @throws ModuleFileNotFoundException File doesn't exist or is not readable.
513    */
 
514  642 toggle private File getCanonicalReadableFile(final QedeqBo prop) throws ModuleFileNotFoundException {
515  642 final String method = "getCanonicalReadableFile(File)";
516  642 final File localFile = getLocalFilePath(prop.getModuleAddress());
517  642 final File file;
518  642 try {
519  642 file = localFile.getCanonicalFile();
520    } catch (IOException e) {
521  0 Trace.trace(CLASS, this, method, e);
522  0 throw new ModuleFileNotFoundException("file path not correct: " + localFile);
523    }
524  642 if (!file.canRead()) {
525  31 Trace.trace(CLASS, this, method, "file not readable=" + file);
526  31 throw new ModuleFileNotFoundException("file not readable: " + file);
527    }
528  611 return file;
529    }
530   
531    /**
532    * Load specified QEDEQ module from QEDEQ parent module.
533    *
534    * @param process Our service process we run within.
535    * @param parent Parent module address.
536    * @param spec Specification for another QEDEQ module.
537    * @return Loaded module.
538    * @throws SourceFileExceptionList Loading failed.
539    * @throws InterruptException User canceled request.
540    */
 
541  229 toggle public KernelQedeqBo loadModule(final InternalServiceProcess process, final ModuleAddress parent,
542    final Specification spec) throws SourceFileExceptionList, InterruptException {
543   
544  229 final String method = "loadModule(Module, Specification)";
545  229 Trace.begin(CLASS, this, method);
546  229 Trace.trace(CLASS, this, method, spec);
547  229 DefaultKernelQedeqBo prop = null; // currently tried module
548  229 try {
549  229 final ModuleAddress[] modulePaths;
550  229 try {
551  229 modulePaths = parent.getModulePaths(spec);
552    } catch (IOException e) {
553  0 Trace.fatal(CLASS, this, method, "getting module path failed", e); // TODO 20110308 m31: make constant
554  0 throw createSourceFileExceptionList(
555    ServiceErrors.LOADING_FROM_FILE_BUFFER_FAILED_CODE,
556    ServiceErrors.LOADING_FROM_FILE_BUFFER_FAILED_TEXT,
557    parent.getUrl(), e);
558    }
559   
560    // now we iterate over the possible module addresses
561  252 for (int i = 0; i < modulePaths.length; i++) {
562  252 prop = getModules().getKernelQedeqBo(this, modulePaths[i]);
563  252 Trace.trace(CLASS, this, method, "synchronizing at prop=" + prop);
564  252 if (prop.isLoaded()) {
565  73 return (prop);
566    }
567  179 synchronized (prop) {
568  179 if (prop.isLoaded()) {
569  0 return (prop);
570    }
571  179 try {
572  179 if (prop.getModuleAddress().isFileAddress()) {
573  169 loadLocalModule(process, prop);
574    } else {
575    // search in local file buffer
576  10 try {
577  10 getCanonicalReadableFile(prop);
578    } catch (ModuleFileNotFoundException e) { // file not found
579    // we will continue by creating a local copy
580  6 saveQedeqFromWebToBuffer((InternalServiceCall) process.getServiceCall(), prop);
581    }
582  10 loadBufferedModule(process, prop);
583    }
584    // success!
585  154 return prop;
586    } catch (SourceFileExceptionList e) {
587  25 Trace.trace(CLASS, this, method, e);
588  25 if (i + 1 < modulePaths.length) {
589  23 QedeqLog.getInstance().logMessage("trying alternate path");
590    // we continue with the next path
591    } else {
592    // we surrender
593  2 throw e;
594    }
595    }
596    }
597    }
598  0 return prop; // never called, only here to soothe the compiler
599    } catch (final RuntimeException e) {
600  0 Trace.fatal(CLASS, this, method, "unexpected problem", e);
601  0 QedeqLog.getInstance().logFailureReply("Loading failed",
602  0 (prop != null ? prop.getUrl() : "unknownURL"), e.getMessage());
603  0 throw e;
604    } finally {
605  229 Trace.end(CLASS, this, method);
606    }
607    }
608   
 
609  471 toggle public ModuleAddress[] getAllLoadedModules() {
610  471 return getModules().getAllLoadedModules();
611    }
612   
613    /**
614    * Load all previously checked QEDEQ modules.
615    *
616    * @return Successfully reloaded all modules.
617    */
 
618  0 toggle public boolean loadPreviouslySuccessfullyLoadedModules() {
619  0 final String[] list = config.getPreviouslyLoadedModules();
620  0 boolean errors = false;
621  0 for (int i = 0; i < list.length; i++) {
622  0 try {
623  0 final ModuleAddress address = getModuleAddress(list[i]);
624  0 final QedeqBo prop = loadModule(address);
625  0 if (prop.hasErrors()) {
626  0 errors = true;
627    }
628    } catch (IOException e) {
629  0 Trace.fatal(CLASS, this, "loadPreviouslySuccessfullyLoadedModules",
630    "internal error: " + "saved URLs are malformed", e);
631  0 errors = true;
632    }
633    }
634  0 return !errors;
635    }
636   
637    // LATER mime 20070326: dynamic loading from web page directory
 
638  0 toggle public boolean loadAllModulesFromQedeq() {
639  0 final String prefix = "http://www.qedeq.org/" + kernel.getKernelVersionDirectory() + "/";
640  0 final String[] list = new String[] {
641    prefix + "doc/math/qedeq_logic_v1.xml",
642    prefix + "doc/math/qedeq_formal_logic_v1.xml",
643    prefix + "doc/math/qedeq_set_theory_v1.xml",
644    prefix + "doc/project/qedeq_basic_concept.xml",
645    prefix + "doc/project/qedeq_logic_language.xml",
646    prefix + "sample/qedeq_sample1.xml",
647    prefix + "sample/qedeq_sample2.xml",
648    prefix + "sample/qedeq_sample3.xml",
649    prefix + "sample/qedeq_sample4.xml",
650    prefix + "sample/qedeq_error_sample_00.xml",
651    prefix + "sample/qedeq_error_sample_01.xml",
652    prefix + "sample/qedeq_error_sample_02.xml",
653    prefix + "sample/qedeq_error_sample_03.xml",
654    prefix + "sample/qedeq_error_sample_04.xml",
655    prefix + "sample/qedeq_error_sample_05.xml",
656    prefix + "sample/qedeq_error_sample_12.xml",
657    prefix + "sample/qedeq_error_sample_13.xml",
658    prefix + "sample/qedeq_error_sample_14.xml",
659    prefix + "sample/qedeq_error_sample_15.xml",
660    prefix + "sample/qedeq_error_sample_16.xml",
661    prefix + "sample/qedeq_error_sample_17.xml",
662    prefix + "sample/qedeq_error_sample_18.xml"};
663  0 boolean errors = false;
664  0 for (int i = 0; i < list.length; i++) {
665  0 try {
666  0 final ModuleAddress address = getModuleAddress(list[i]);
667  0 final QedeqBo prop = loadModule(address);
668  0 if (prop.hasErrors()) {
669  0 errors = true;
670    }
671    } catch (final IOException e) {
672  0 Trace.fatal(CLASS, this, "loadPreviouslySuccessfullyLoadedModules",
673    "internal error: " + "saved URLs are malformed", e);
674  0 errors = true;
675    }
676    }
677  0 return !errors;
678    }
679   
680    /**
681    * Make local copy of a module if it is no file address.
682    *
683    * @param call Service call we run within.
684    * @param prop Module properties.
685    * @throws SourceFileExceptionList Address was malformed or the file can not be found.
686    * @throws InterruptException User canceled request.
687    */
 
688  6 toggle private void saveQedeqFromWebToBuffer(final InternalServiceCall call, final DefaultKernelQedeqBo prop)
689    throws SourceFileExceptionList, InterruptException {
690  6 final String method = "saveQedeqFromWebToBuffer(DefaultKernelQedeqBo)";
691  6 Trace.begin(CLASS, this, method);
692   
693  6 if (prop.getModuleAddress().isFileAddress()) { // this is already a local file
694  0 Trace.fatal(CLASS, this, method, "tried to make a local copy for a local module", null);
695  0 Trace.end(CLASS, this, method);
696  0 return;
697    }
698   
699  6 final ServiceExecutor executor = new ServiceExecutor() {
700   
 
701  6 toggle public void executeService(final InternalServiceCall call) {
702  6 final File f = getLocalFilePath(prop.getModuleAddress());
703  6 prop.setLoadingProgressState(LoadingState.STATE_LOADING_FROM_WEB);
704  6 try {
705  6 UrlUtility.saveUrlToFile(prop.getUrl(), f,
706    config.getHttpProxyHost(), config.getHttpProxyPort(), config.getHttpNonProxyHosts(),
707    config.getConnectionTimeout(), config.getReadTimeout(), new LoadingListener() {
 
708  0 toggle public void loadingCompletenessChanged(final double completeness) {
709  0 final double percentage = completeness * 100;
710  0 call.setExecutionPercentage(percentage);
711  0 prop.setLoadingCompleteness((int) percentage);
712    }
713    });
714  0 call.finish();
715    } catch (IOException e) {
716  6 Trace.trace(CLASS, this, method, e);
717  6 try {
718  6 f.delete();
719    } catch (Exception ex) {
720  0 Trace.trace(CLASS, this, method, ex);
721    }
722  6 final SourceFileExceptionList sfl = createSourceFileExceptionList(
723    ServiceErrors.LOADING_FROM_WEB_FAILED_CODE,
724    ServiceErrors.LOADING_FROM_WEB_FAILED_TEXT,
725    prop.getUrl(), e);
726  6 prop.setLoadingFailureState(LoadingState.STATE_LOADING_FROM_WEB_FAILED, sfl);
727  6 Trace.trace(CLASS, this, method, "Couldn't access " + prop.getUrl());
728  6 call.finish("Couldn't save URL " + prop.getUrl() + " to file: " + e.getMessage());
729    }
730    }
731    };
732   
733  6 this.processManager.executeService(new Service() {
 
734  0 toggle public String getServiceAction() {
735  0 return "saving from web to file buffer";
736    }
737   
 
738  0 toggle public String getServiceDescription() {
739  0 return "download QEDEQ module from web URL and save it to a local file";
740    }
741   
 
742  6 toggle public String getServiceId() {
743  6 return "" + hashCode();
744    }
745    }, executor, prop, call.getInternalServiceProcess());
746  6 Trace.end(CLASS, this, method);
747   
748    }
749   
 
750  59614 toggle public final File getLocalFilePath(final ModuleAddress address) {
751  59614 final String method = "getLocalFilePath(ModuleAddress)";
752  59614 URL url;
753  59614 try {
754  59614 url = new URL(address.getUrl());
755    } catch (MalformedURLException e) {
756  0 Trace.fatal(CLASS, this, method, "Could not get local file path.", e);
757  0 return null;
758    }
759  59614 Trace.param(CLASS, this, method, "protocol", url.getProtocol());
760  59614 Trace.param(CLASS, this, method, "host", url.getHost());
761  59614 Trace.param(CLASS, this, method, "port", url.getPort());
762  59614 Trace.param(CLASS, this, method, "path", url.getPath());
763  59614 Trace.param(CLASS, this, method, "file", url.getFile());
764  59614 if (address.isFileAddress()) {
765  59350 try {
766  59350 return UrlUtility.transformURLPathToFilePath(url);
767    } catch (IllegalArgumentException e) {
768    // should not occur because check for validy must be done in constructor of address
769  0 Trace.fatal(CLASS, this, method, "Loading failed of local file with URL=" + url, e);
770  0 throw new RuntimeException(e);
771    }
772    }
773  264 StringBuffer file = new StringBuffer(url.getFile());
774  264 StringUtility.replace(file, "_", "_1"); // remember all '_'
775  264 StringUtility.replace(file, "/", "_2"); // preserve all '/'
776  264 String encoded = file.toString(); // fallback file name
777  264 try {
778  264 encoded = URLEncoder.encode(file.toString(), "UTF-8");
779    } catch (UnsupportedEncodingException e) {
780    // should not occur
781  0 Trace.trace(CLASS, method, e);
782    }
783  264 file.setLength(0);
784  264 file.append(encoded);
785  264 StringUtility.replace(file, "#", "##"); // escape all '#'
786  264 StringUtility.replace(file, "_2", "#"); // from '/' into '#'
787  264 StringUtility.replace(file, "_1", "_"); // from '_' into '_'
788    // mime 2010-06-25: use if we throw no RuntimException
789    // StringBuffer adr = new StringBuffer(url.toExternalForm());
790  264 final StringBuffer adr;
791  264 try {
792  264 adr = new StringBuffer(new URL(url.getProtocol(), url.getHost(), url.getPort(), file
793    .toString()).toExternalForm());
794    } catch (MalformedURLException e) {
795  0 Trace.fatal(CLASS, this, method, "unexpected", e);
796  0 throw new RuntimeException(e);
797    }
798    // escape characters:
799  264 StringUtility.replace(adr, "://", "_"); // before host
800  264 StringUtility.replace(adr, ":", "_"); // before protocol
801  264 return new File(getBufferDirectory(), adr.toString());
802    }
803   
 
804  264 toggle public File getBufferDirectory() {
805  264 return config.getBufferDirectory();
806    }
807   
 
808  0 toggle public File getGenerationDirectory() {
809  0 return config.getGenerationDirectory();
810    }
811   
 
812  44629 toggle public KernelQedeqBo getKernelQedeqBo(final ModuleAddress address) {
813  44629 return getModules().getKernelQedeqBo(this, address);
814    }
815   
 
816  44510 toggle public QedeqBo getQedeqBo(final ModuleAddress address) {
817  44510 return getKernelQedeqBo(address);
818    }
819   
 
820  395 toggle public ModuleAddress getModuleAddress(final URL url) throws IOException {
821  395 return new DefaultModuleAddress(url);
822    }
823   
 
824  0 toggle public ModuleAddress getModuleAddress(final String url) throws IOException {
825  0 return new DefaultModuleAddress(url);
826    }
827   
 
828  2 toggle public ModuleAddress getModuleAddress(final File file) throws IOException {
829  2 return new DefaultModuleAddress(file);
830    }
831   
 
832  2 toggle public String getSource(final ModuleAddress address) throws IOException {
833  2 final KernelQedeqBo bo = getKernelQedeqBo(address);
834  2 if (bo.getLoadingState().equals(LoadingState.STATE_UNDEFINED)
835    || bo.getLoadingState().equals(LoadingState.STATE_LOADING_FROM_WEB)
836    || bo.getLoadingState().equals(LoadingState.STATE_LOADING_FROM_WEB_FAILED)) {
837  0 return null;
838    }
839  2 final StringBuffer buffer = new StringBuffer();
840  2 final Reader reader = getQedeqFileDao().getModuleReader(bo);
841  2 try {
842  2 IoUtility.loadReader(reader, buffer);
843    } finally {
844  2 IoUtility.close(reader);
845    }
846  2 return buffer.toString();
847    }
848   
 
849  96 toggle public boolean loadRequiredModules(final ModuleAddress address) {
850  96 final KernelQedeqBo prop = getKernelQedeqBo(address);
851    // did we check this already?
852  96 if (prop.hasLoadedRequiredModules()) {
853  22 return true; // everything is OK
854    }
855  74 try {
856  74 loadModule(address);
857  74 executePlugin(null, LoadRequiredModulesPlugin.class.getName(), prop, null);
858    } catch (InterruptException e) { // TODO 20130521 m31: ok?
859    // ignore;
860    }
861  74 if (validate) {
862  74 modules.validateDependencies();
863    }
864  74 return prop.hasLoadedRequiredModules();
865    }
866   
 
867  63 toggle public boolean loadRequiredModules(final InternalServiceProcess process, final KernelQedeqBo qedeq)
868    throws InterruptException {
869    // did we check this already?
870  63 if (qedeq.hasLoadedRequiredModules()) {
871  62 return true; // everything is OK
872    }
873  1 executePlugin(process, LoadRequiredModulesPlugin.class.getName(), qedeq, null);
874  1 return qedeq.hasLoadedRequiredModules();
875    }
876   
 
877  220 toggle public boolean checkWellFormedness(final ModuleAddress address) {
878  220 final DefaultKernelQedeqBo prop = modules.getKernelQedeqBo(this, address);
879    // did we check this already?
880  220 if (prop.isWellFormed()) {
881  44 return true; // everything is OK
882    }
883  176 try {
884  176 loadModule(address);
885  176 executePlugin(null, WellFormedCheckerPlugin.class.getName(), prop, null);
886    } catch (InterruptException e) {
887    // TODO Auto-generated catch block
888  0 e.printStackTrace();
889    }
890  176 if (validate) {
891  176 modules.validateDependencies();
892    }
893  176 return prop.isWellFormed();
894    }
895   
 
896  246 toggle public boolean checkWellFormedness(final InternalServiceProcess process, final KernelQedeqBo qedeq) {
897    // did we check this already?
898  246 if (qedeq.isWellFormed()) {
899  123 return true; // everything is OK
900    }
901  123 try {
902  123 executePlugin(process, WellFormedCheckerPlugin.class.getName(), qedeq,
903    null);
904    } catch (InterruptException e) {
905    // TODO Auto-generated catch block
906  0 e.printStackTrace();
907    }
908  123 return qedeq.isWellFormed();
909    }
910   
 
911  10 toggle public boolean checkFormallyProved(final ModuleAddress address) {
912  10 final DefaultKernelQedeqBo prop = modules.getKernelQedeqBo(this, address);
913    // did we check this already?
914  10 if (prop.isFullyFormallyProved()) {
915  0 return true; // everything is OK
916    }
917  10 try {
918  10 loadModule(address);
919  10 executePlugin(null, FormalProofCheckerPlugin.class.getName(), prop, null);
920    } catch (InterruptException e) {
921    // TODO Auto-generated catch block
922  0 e.printStackTrace();
923    }
924  10 if (validate) {
925  10 modules.validateDependencies();
926    }
927  10 return prop.isFullyFormallyProved();
928    }
929   
 
930  0 toggle public boolean checkFormallyProved(final InternalServiceProcess process, final KernelQedeqBo qedeq) {
931    // did we check this already?
932  0 if (qedeq.isFullyFormallyProved()) {
933  0 return true; // everything is OK
934    }
935  0 try {
936  0 executePlugin(process, FormalProofCheckerPlugin.class.getName(), qedeq, null);
937    } catch (InterruptException e) {
938    // TODO Auto-generated catch block
939  0 e.printStackTrace();
940    }
941  0 return qedeq.isFullyFormallyProved();
942    }
943   
944    /**
945    * Add plugin to services.
946    *
947    * @param pluginClass Plugin class to instantiate.
948    * @throws RuntimeException Addition failed.
949    */
 
950  471 toggle public void addPlugin(final String pluginClass) {
951  471 pluginManager.addPlugin(pluginClass);
952    }
953   
 
954  0 toggle public Plugin[] getPlugins() {
955  0 return pluginManager.getNonInternalPlugins();
956    }
957   
 
958  12 toggle public Object executePlugin(final String id, final ModuleAddress address, final Object data) {
959  12 try {
960  12 loadModule(address);
961  12 return processManager.executePlugin(id, getKernelQedeqBo(address), data, null);
962    } catch (InterruptException e) {
963  0 return null;
964    }
965    }
966   
 
967  1281 toggle public Object executePlugin(final InternalServiceProcess process, final String id, final KernelQedeqBo qedeq,
968    final Object data) throws InterruptException {
969  1281 return processManager.executePlugin(id, qedeq, data, process);
970    }
971   
 
972  0 toggle public void clearAllPluginResults(final ModuleAddress address) {
973  0 pluginManager.clearAllPluginResults(getKernelQedeqBo(address));
974    }
975   
 
976  0 toggle public ServiceProcess[] getServiceProcesses() {
977  0 return processManager.getServiceProcesses();
978    }
979   
 
980  0 toggle public ServiceProcess[] getRunningServiceProcesses() {
981  0 return processManager.getRunningServiceProcesses();
982    }
983   
 
984  0 toggle public void stopAllPluginExecutions() {
985  0 processManager.terminateAllServiceProcesses();
986    }
987   
988   
989    /**
990    * Get all loaded QEDEQ modules.
991    *
992    * @return All QEDEQ modules.
993    */
 
994  46004 toggle private KernelQedeqBoStorage getModules() {
995  46004 return modules;
996    }
997   
 
998  6 toggle public SourceFileExceptionList createSourceFileExceptionList(final int code,
999    final String message, final String address, final IOException e) {
1000  6 return new SourceFileExceptionList(new SourceFileException(this,
1001    code, message, e, new SourceArea(address), null));
1002    }
1003   
 
1004  0 toggle public SourceFileExceptionList createSourceFileExceptionList(final int code,
1005    final String message, final String address, final RuntimeException e) {
1006  0 return new SourceFileExceptionList(new SourceFileException(this,
1007    code, message, e, new SourceArea(address), null));
1008    }
1009   
 
1010  25 toggle public SourceFileExceptionList createSourceFileExceptionList(final int code,
1011    final String message, final String address, final Exception e) {
1012  25 return new SourceFileExceptionList(new SourceFileException(this,
1013    code, message, e, new SourceArea(address), null));
1014    }
1015   
1016    /**
1017    * Get description of source file exception list.
1018    *
1019    * @param address Get description for this module exceptions.
1020    * @return Error description and location.
1021    */
 
1022  0 toggle public String[] getSourceFileExceptionList(final ModuleAddress address) {
1023  0 final List list = new ArrayList();
1024  0 final KernelQedeqBo bo = getKernelQedeqBo(address);
1025  0 final SourceFileExceptionList sfl = bo.getErrors();
1026  0 if (sfl.size() > 0) {
1027  0 final StringBuffer buffer = new StringBuffer();
1028  0 do {
1029  0 Reader reader = null;
1030  0 try {
1031  0 reader = getQedeqFileDao().getModuleReader(bo);
1032  0 IoUtility.loadReader(reader, buffer);
1033    } catch (IOException e) {
1034  0 IoUtility.close(reader);
1035  0 for (int i = 0; i < sfl.size(); i++) {
1036  0 list.add(sfl.get(i).getDescription());
1037    }
1038  0 break; // out of do while
1039    }
1040  0 final TextInput input = new TextInput(buffer);
1041  0 try {
1042  0 input.setPosition(0);
1043  0 final StringBuffer buf = new StringBuffer();
1044  0 for (int i = 0; i < sfl.size(); i++) {
1045  0 buf.setLength(0);
1046  0 final SourceFileException sf = sfl.get(i);
1047  0 buf.append(sf.getDescription());
1048  0 try {
1049  0 if (sf.getSourceArea() != null
1050    && sf.getSourceArea().getStartPosition() != null) {
1051  0 buf.append("\n");
1052  0 input.setRow(sf.getSourceArea().getStartPosition().getRow());
1053  0 buf.append(StringUtility.replace(input.getLine(), "\t", " "));
1054  0 buf.append("\n");
1055  0 final StringBuffer whitespace = StringUtility.getSpaces(sf
1056    .getSourceArea().getStartPosition().getColumn() - 1);
1057  0 buffer.append(whitespace);
1058  0 buffer.append("^");
1059    }
1060    } catch (Exception e) {
1061  0 Trace.trace(CLASS, this, "getSourceFileExceptionList(ModuleAddress)", e);
1062    }
1063  0 list.add(buf.toString());
1064    }
1065    } finally {
1066  0 IoUtility.close(input);
1067    }
1068  0 break; // out of do while
1069    } while (true);
1070    }
1071  0 return (String[]) list.toArray(new String[list.size()]);
1072    }
1073   
 
1074  0 toggle public String getServiceId() {
1075  0 return CLASS.getName();
1076    }
1077   
 
1078  0 toggle public String getServiceAction() {
1079  0 return "Basis";
1080    }
 
1081  1150 toggle public QedeqFileDao getQedeqFileDao() {
1082  1150 return qedeqFileDao;
1083    }
1084   
 
1085  0 toggle public String getServiceDescription() {
1086  0 return "provides basic services for loading QEDEQ modules";
1087    }
1088   
 
1089  9477 toggle public QedeqConfig getConfig() {
1090  9477 return config;
1091    }
1092   
 
1093  55 toggle public String getKernelVersionDirectory() {
1094  55 return kernel.getKernelVersionDirectory();
1095    }
1096   
 
1097  0 toggle public String getBuildId() {
1098  0 return kernel.getBuildId();
1099    }
1100   
 
1101  0 toggle public String getDedication() {
1102  0 return kernel.getDedication();
1103    }
1104   
 
1105  0 toggle public String getDescriptiveKernelVersion() {
1106  0 return kernel.getDescriptiveKernelVersion();
1107    }
1108   
 
1109  0 toggle public String getKernelCodeName() {
1110  0 return kernel.getKernelCodeName();
1111    }
1112   
 
1113  0 toggle public String getKernelVersion() {
1114  0 return kernel.getKernelVersion();
1115    }
1116   
 
1117  0 toggle public String getMaximalRuleVersion() {
1118  0 return kernel.getMaximalRuleVersion();
1119    }
1120   
 
1121  0 toggle public boolean isRuleVersionSupported(final String ruleVersion) {
1122  0 return kernel.isRuleVersionSupported(ruleVersion);
1123    }
1124   
 
1125  0 toggle public boolean isSetConnectionTimeOutSupported() {
1126  0 return kernel.isSetConnectionTimeOutSupported();
1127    }
1128   
 
1129  0 toggle public boolean isSetReadTimeoutSupported() {
1130  0 return kernel.isSetReadTimeoutSupported();
1131    }
1132   
 
1133  71838 toggle public ContextChecker getContextChecker() {
1134  71838 return contextChecker;
1135    }
1136   
1137    /**
1138    * Set the context checker. This is useful especially for test classes.
1139    *
1140    * @param contextChecker We check the context with this checker now.
1141    */
 
1142  471 toggle public void setContextChecker(final ContextChecker contextChecker) {
1143  471 this.contextChecker = contextChecker;
1144    }
1145   
 
1146  755 toggle public boolean lockModule(final InternalServiceProcess process, final KernelQedeqBo qedeq, final Service service)
1147    throws InterruptException {
1148  755 return arbiter.lockRequiredModule(process, qedeq, service);
1149    }
1150   
 
1151  755 toggle public boolean unlockModule(final InternalServiceProcess process, final KernelQedeqBo qedeq) {
1152  755 return arbiter.unlockRequiredModule(process, qedeq);
1153    }
1154   
 
1155  230 toggle public InternalServiceProcess createServiceProcess(final String action) {
1156  230 return processManager.createServiceProcess(action);
1157    }
1158   
 
1159  219 toggle public InternalServiceCall createServiceCall(final Service service, final KernelQedeqBo qedeq,
1160    final Parameters configParameters, final Parameters parameters,
1161    final InternalServiceProcess process, final InternalServiceCall parent) throws InterruptException {
1162  219 return processManager.createServiceCall(service, qedeq, configParameters, parameters, process);
1163    }
1164   
1165    }