|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| InternalKernelServices | 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-2010, 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.module; | |
| 17 | ||
| 18 | import java.io.File; | |
| 19 | import java.io.IOException; | |
| 20 | ||
| 21 | import org.qedeq.kernel.base.module.Specification; | |
| 22 | import org.qedeq.kernel.bo.context.KernelServices; | |
| 23 | import org.qedeq.kernel.common.ModuleAddress; | |
| 24 | import org.qedeq.kernel.common.SourceFileExceptionList; | |
| 25 | ||
| 26 | /** | |
| 27 | * The kernel internal service methods are assembled here. Needed by the kernel and its helpers. | |
| 28 | * | |
| 29 | * @author Michael Meyling | |
| 30 | */ | |
| 31 | public interface InternalKernelServices extends KernelServices { | |
| 32 | ||
| 33 | /** | |
| 34 | * Get buffer directory for QEDEQ module files. | |
| 35 | * | |
| 36 | * @return buffer directory. | |
| 37 | */ | |
| 38 | public File getBufferDirectory(); | |
| 39 | ||
| 40 | /** | |
| 41 | * Get directory for generated files. | |
| 42 | * | |
| 43 | * @return Generation directory. | |
| 44 | */ | |
| 45 | public File getGenerationDirectory(); | |
| 46 | ||
| 47 | /** | |
| 48 | * Get {@link KernelQedeqBo} for an address. | |
| 49 | * | |
| 50 | * @param address Look for this address. | |
| 51 | * @return Existing or new {@link KernelQedeqBo}, if address is malformed | |
| 52 | * <code>null</code> is returned. | |
| 53 | */ | |
| 54 | public KernelQedeqBo getKernelQedeqBo(ModuleAddress address); | |
| 55 | ||
| 56 | /** | |
| 57 | * Transform an URL address into a local file path where the QEDEQ module is buffered. | |
| 58 | * If the module is not buffered <code>null</code> is returned. | |
| 59 | * | |
| 60 | * @param address Get local address for this QEDEQ module address. | |
| 61 | * @return Local file path for that <code>address</code>. | |
| 62 | */ | |
| 63 | public File getLocalFilePath(ModuleAddress address); | |
| 64 | ||
| 65 | /** | |
| 66 | * Load specified QEDEQ module from QEDEQ parent module. | |
| 67 | * | |
| 68 | * @param parent Parent module address. | |
| 69 | * @param spec Specification for another QEDEQ module. | |
| 70 | * @return Loaded module. | |
| 71 | * @throws SourceFileExceptionList Loading failed. | |
| 72 | */ | |
| 73 | public KernelQedeqBo loadModule(ModuleAddress parent, Specification spec) | |
| 74 | throws SourceFileExceptionList; | |
| 75 | ||
| 76 | /** | |
| 77 | * Get DAO for reading and writing QEDEQ modules from or to a file. | |
| 78 | * | |
| 79 | * @return DAO. | |
| 80 | */ | |
| 81 | public QedeqFileDao getQedeqFileDao(); | |
| 82 | ||
| 83 | /** | |
| 84 | * Creates a list with a {@link org.qedeq.kernel.common.SourceFileException} with dummy position. | |
| 85 | * | |
| 86 | * @param address This source had a problem. | |
| 87 | * @param e Wrapped exception. | |
| 88 | * @return Created list. | |
| 89 | */ | |
| 90 | public SourceFileExceptionList createSourceFileExceptionList(String address, IOException e); | |
| 91 | ||
| 92 | /** | |
| 93 | * Creates a list with a {@link org.qedeq.kernel.common.SourceFileException} with dummy position. | |
| 94 | * | |
| 95 | * @param address This source had a problem. | |
| 96 | * @param e Wrapped exception. | |
| 97 | * @return Created list. | |
| 98 | */ | |
| 99 | public SourceFileExceptionList createSourceFileExceptionList(String address, RuntimeException e); | |
| 100 | ||
| 101 | /** | |
| 102 | * Creates a list with a {@link org.qedeq.kernel.common.SourceFileException} with dummy position. | |
| 103 | * | |
| 104 | * @param address This source had a problem. | |
| 105 | * @param e Wrapped exception. | |
| 106 | * @return Created list. | |
| 107 | */ | |
| 108 | public SourceFileExceptionList createSourceFileExceptionList(String address, Exception e); | |
| 109 | ||
| 110 | } | |
|
||||||||||