|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.planx.xmlstore.koala.storage.RootManager
public class RootManager
The RootManager keeps track of live roots.
TODO: Improve O(N) time complexity in getRoots(org.planx.io.SourceId).
| Constructor Summary | |
|---|---|
RootManager()
|
|
| Method Summary | |
|---|---|
void |
addRootListener(LocatorListener l)
|
void |
addWeakRoot(LocalLocator loc)
Adds the specified LocalLocator as a transient root. |
LocalLocator |
asWeakRoot(LocalLocator loc)
|
List<Locator> |
getRoots()
|
List<Locator> |
getRoots(SourceId fsi)
Returns all live roots with the specified SourceId. |
static SizeStreamer<RootManager> |
getStreamer()
|
LocalLocator |
lookup(LocalLocator loc)
|
LocalLocator |
lookup(Locator loc)
Returns the canonical LocalLocator for the specified
Locator or null if the locator is not a root. |
void |
move(LocalLocator old,
LocalLocator canonic)
Informs the RootManager that two existing roots are
equivalent and will be merged. |
void |
move(Locator old,
Locator canonic)
|
void |
release(LocalLocator loc)
Releases a root that was previously retained. |
void |
removeRootListener(LocatorListener l)
|
void |
retain(LocalLocator loc)
Requests that a root be kept permanently alive. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RootManager()
| Method Detail |
|---|
public void addWeakRoot(LocalLocator loc)
LocalLocator as a transient root. That is,
it will disappear when it goes out of runtime scope unless
retain is called.
public LocalLocator lookup(Locator loc)
LocalLocator for the specified
Locator or null if the locator is not a root.
public LocalLocator lookup(LocalLocator loc)
public LocalLocator asWeakRoot(LocalLocator loc)
public List<Locator> getRoots(SourceId fsi)
SourceId.
TODO: Currently, O(N) time complexity - should be improved.
public List<Locator> getRoots()
public void retain(LocalLocator loc)
public void release(LocalLocator loc)
throws UnknownReferenceException
UnknownReferenceExceptionpublic void addRootListener(LocatorListener l)
public void removeRootListener(LocatorListener l)
public void move(LocalLocator old,
LocalLocator canonic)
RootManager that two existing roots are
equivalent and will be merged. The first argument is a root that will
no longer be used, and the second argument is a canonical root.
If the roots are permanent roots, their reference counts are added and
stored under the canonic root. Also, the weak root
old is removed to ensure the consistency of the internal
hash table. (When the LocalLocator.move method is
called the hash code of the old root may change messing up the hash
table.)
public void move(Locator old,
Locator canonic)
public String toString()
toString in class Objectpublic static SizeStreamer<RootManager> getStreamer()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||