|
xmlBlaster 2.2.0 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xmlBlaster.engine.persistence.filestore.FileDriver
public class FileDriver
A very simple, file based, persistence manager.
This driver stores messages on the hard disk, one message to one file (plus a key and a qos file).
All methods are marked final, in hope to have some performance gain (could be changed to allow a customized driver)
CAUTION: This driver is not suitable for production purposes.
If you want to use this driver for more than some hundred different messages
we recommend to use it with the ReiserFS.
Reiserfs is a file system using a plug-in based object oriented variant on classical balanced tree algorithms.
See ftp://ftp.suse.com:/pub/suse/i386/update/6.3/reiserfs/
and http://devlinux.com/projects/reiserfs/content_table.html
for further informations.
TODO: Extend interface to support caching!
TODO: Is the File stuff thread save or do we need to add some synchronize?
Invoke (for testing only):
jaco org.xmlBlaster.engine.persistence.FileDriver
| Nested Class Summary | |
|---|---|
private class |
FileDriver.XmlKeyFilter
Filter only the xy-XmlKey.xml files. |
| Field Summary | |
|---|---|
private Global |
glob
|
private static java.util.logging.Logger |
log
|
private static java.lang.String |
ME
|
private java.lang.String |
path
|
private java.lang.String |
XMLKEY_TOKEN
|
private java.lang.String |
XMLQOS_TOKEN
|
| Constructor Summary | |
|---|---|
FileDriver()
Constructs the FileDriver object (reflection constructor). |
|
| Method Summary | |
|---|---|
void |
erase(XmlKey xmlKey)
Allows a stored message to be deleted. |
MsgUnit |
fetch(java.lang.String oid)
Allows to fetch one message by oid from the persistence. |
java.util.Enumeration |
fetchAllOids()
Fetches all oid's of the messages from the persistence. |
java.lang.String |
getName()
gives the name of the driver |
java.lang.String |
getType()
gives the type of the driver |
java.lang.String |
getVersion()
gives the version of the driver |
void |
init(Global glob,
PluginInfo pluginInfo)
This method is called by the PluginManager (enforced by I_Plugin). |
static void |
main(java.lang.String[] args)
Invoke: jaco org.xmlBlaster.engine.persistence.FileDriver |
void |
shutdown()
Closes the instance of the filedriver plugin |
void |
store(MsgUnitWrapper messageWrapper)
Allows a message to be stored. |
void |
update(MsgUnitWrapper messageWrapper)
Allows a stored message content to be updated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.lang.String ME
private Global glob
private static java.util.logging.Logger log
private java.lang.String path
private final java.lang.String XMLKEY_TOKEN
private final java.lang.String XMLQOS_TOKEN
| Constructor Detail |
|---|
public FileDriver()
throws XmlBlasterException
XmlBlasterException| Method Detail |
|---|
public final void init(Global glob,
PluginInfo pluginInfo)
throws XmlBlasterException
init in interface I_PluginXmlBlasterExceptionI_Plugin.init(org.xmlBlaster.util.Global,org.xmlBlaster.util.plugin.PluginInfo)
public final void shutdown()
throws XmlBlasterException
shutdown in interface I_PersistenceDrivershutdown in interface I_PluginXmlBlasterException - if an exception occurs. The exception is
handled by the RunLevelManager depending on how the plugin has been
configured with the action:
<action do='STOP' onShutdownRunlevel='2' sequence='5'
onFail='resource.configuration.pluginFailed'>
If onFail is defined to something, the RunLevelManager will stop.
public final void store(MsgUnitWrapper messageWrapper)
throws XmlBlasterException
store in interface I_PersistenceDrivermessageWrapper - The container with all necessary message info.
XmlBlasterException
public final void update(MsgUnitWrapper messageWrapper)
throws XmlBlasterException
update in interface I_PersistenceDriverxmlKey - To identify the messagecontent - The data to storeqos - The quality of service, may contain another publisher name
XmlBlasterException
public MsgUnit fetch(java.lang.String oid)
throws XmlBlasterException
fetch in interface I_PersistenceDriveroid - The message oid (key oid="...")
XmlBlasterException
public java.util.Enumeration fetchAllOids()
throws XmlBlasterException
fetchAllOids in interface I_PersistenceDriverXmlBlasterException
public void erase(XmlKey xmlKey)
throws XmlBlasterException
erase in interface I_PersistenceDriverxmlKey - To identify the message
XmlBlasterExceptionpublic java.lang.String getType()
getType in interface I_Pluginpublic java.lang.String getVersion()
getVersion in interface I_Pluginpublic java.lang.String getName()
getName in interface I_PersistenceDriverpublic static void main(java.lang.String[] args)
|
xmlBlaster 2.2.0 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||