| java.lang.Object org.mandarax.zkb.ZKBManager
ZKBManager | public class ZKBManager implements LogCategories(Code) | | Persistency manager supporting the serialization of knowledge bases. The
functionality is similar to the XBKManager. However, there are the following
differences:
- The ZKB Manager serializes the knowledge base as XML, similiar to XKB.
It uses modified XKB drivers to achieve this.
- Objects (in particular objects used in constant terms) are not XML
serialized with the knowledge base. Instead, they are referenced by (string)
uris.
- Objects are serialized using a separate
ObjectPersistncyService (OPS). The idea is to re-use existing
services such as binary and (JDK-) XML serialization.
- The two streams (knowledge base and objects (resources)) are zipped
together,
Public methods are synchronized in order to ensure the consistency of the OPS
used (added in 3.2).
author: Jens Dietrich version: 3.4 <7 March 05> since: 2.2 |
Constructor Summary | |
public | ZKBManager() Constructor. |
LOG_ZKB | final public static Category LOG_ZKB(Code) | | |
ZKB_DRIVER_CLASS | final public static String ZKB_DRIVER_CLASS(Code) | | |
ZKBManager | public ZKBManager()(Code) | | Constructor.
|
exportKnowledgeBase | public synchronized void exportKnowledgeBase(Object target, KnowledgeBase kb) throws ZKBException(Code) | | Exports a knowledge base to an output stream.
Parameters: target - the output (a file or output stream) Parameters: kb - a knowledge base throws: a - ZKBException is thrown if export fails |
exportKnowledgeBase | public synchronized void exportKnowledgeBase(Object target, KnowledgeBase kb, Object attachment) throws ZKBException(Code) | | Exports a knowledge base to an output stream.
Parameters: target - the output (a file or output stream) Parameters: kb - a knowledge base Parameters: attachment - an attachment throws: a - ZKBException is thrown if export fails |
getDriver | public synchronized ZKBDriver getDriver()(Code) | | Returns the driver.
ZKBDriver |
importKnowledgeBase | public synchronized KnowledgeBase importKnowledgeBase(Object source) throws ZKBException(Code) | | Import a knowledge base.
a knowledge base Parameters: source - an input stream, file or url throws: a - ZKBException is thrown if import fails |
importKnowledgeBaseAndAttachment | public synchronized KnowledgeBasePlusAttachment importKnowledgeBaseAndAttachment(Object source) throws ZKBException(Code) | | Import a knowledge base.
a knowledge base plus an attachment Parameters: source - an input stream, file or url throws: a - ZKBException is thrown if import fails |
setDriver | public synchronized void setDriver(ZKBDriver driver)(Code) | | Sets the driver.
Parameters: driver - The driver to set |
setSAXBuilder | public synchronized void setSAXBuilder(SAXBuilder builder)(Code) | | Set the SAX builder. E.g., here we can set a special XML parser. Note
that validation of the builder and validation set here could become
inconsistent!
Parameters: builder - a SAX builder |
|
|