|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.planx.xmlstore.stores.LocalXMLStore
public class LocalXMLStore
A local XMLStore that only operates on location dependent
References, that is, LocalLocators. Thus, it is
fast but unable to resolve ValueReferences. In order to do this,
wrap the LocalXMLStore in a TranslatorXMLStore.
A LocalXMLStore will run a Sharer in the background
that compacts redundant on-disk data and performs garbage collection.
| Constructor Summary | |
|---|---|
LocalXMLStore(String name)
Creates a new LocalXMLStore with the specified on-disk name. |
|
LocalXMLStore(String name,
StorageConfiguration conf)
Creates a new LocalXMLStore with the specified on-disk name. |
|
| Method Summary | |
|---|---|
void |
addReferenceListener(LocatorListener listener)
Adds the specified LocatorListener for receiving
Reference events. |
void |
close()
The method is used to let the XMLStore properly commit all
data to the underlying ressource, release resources, and so
forth. |
StorageManager |
getManager()
|
NameServer<LocalLocator> |
getNameServer()
Returns a NameServer for this store. |
SystemNode |
load(LocalLocator ref)
Only accepts LocalLocators. |
void |
release(LocalLocator ref)
Informs the XMLStore that the data referenced by the
specified Reference is no longer needed. |
void |
removeReferenceListener(LocatorListener listener)
Removes the specified LocatorListener previously added
with addReferenceListener. |
void |
retain(LocalLocator ref)
Informs the XMLStore that the data referenced by the
specified Reference should be kept permanently. |
LocalLocator |
save(Node node)
Saves the specified Node and returns a LocalLocator to it. |
long |
size()
Returns the disk size of this LocalXMLStore. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LocalXMLStore(String name)
throws IOException
LocalXMLStore with the specified on-disk name.
name - the on-disk file name to use as base for persistent data
IOException - if an error occurred initializing the XMLStore
using the specified name
public LocalXMLStore(String name,
StorageConfiguration conf)
throws IOException
LocalXMLStore with the specified on-disk name.
name - the on-disk file name to use as base for persistent data
IOException - if an error occurred initializing the XMLStore
using the specified name| Method Detail |
|---|
public LocalLocator save(Node node)
throws IOException
Node and returns a LocalLocator to it.
save in interface XMLStore<LocalLocator>node - representing XML data in the form of semi-structured tree data
IOException - if an error occurs during disk, network, etc access
public SystemNode load(LocalLocator ref)
throws IOException
LocalLocators.
load in interface XMLStore<LocalLocator>ref - the Reference to the data
IOException - if an error occurs during disk, network, etc access
UnknownReferenceException - if the data referenced is not stored
in the XMLStore or the Reference is of
a type not supported by the XMLStorepublic NameServer<LocalLocator> getNameServer()
NameServer for this store.
getNameServer in interface XMLStore<LocalLocator>public StorageManager getManager()
public void retain(LocalLocator ref)
throws UnknownReferenceException
XMLStore that the data referenced by the
specified Reference should be kept permanently.
Implementations may assume that the Reference is one
previously obtained from this XMLStore.
When the data referenced is no longer needed the XMLStore
should be informed of this be calling release(LocalLocator).
ref - the Reference to retain
UnknownReferenceException
public void release(LocalLocator ref)
throws UnknownReferenceException
XMLStore that the data referenced by the
specified Reference is no longer needed. The
XMLStore should previously have been informed to retain
the data using the retain(LocalLocator) method.
More specifically, implementations may assume that the argument of this
method, or one equal to it, has previously been an argument
to retain.
ref - the Reference to release
UnknownReferenceExceptionpublic void addReferenceListener(LocatorListener listener)
LocatorListener for receiving
Reference events.
listener - the listener to addpublic void removeReferenceListener(LocatorListener listener)
LocatorListener previously added
with addReferenceListener.
listener - the listener to remove
public long size()
throws IOException
LocalXMLStore.
IOException
public void close()
throws IOException
XMLStoreXMLStore properly commit all
data to the underlying ressource, release resources, and so
forth. Once close has been issued on an XMLStore, the store
is no longer available for handling requests. Any subsequent
request to the store will result in an exception being
thrown. An XMLStore implementation has to ensure that
this happens.
close in interface XMLStore<LocalLocator>IOException - if it is not possible to properly close the storepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||