org.planx.xmlstore.regions
Class RegionManager

java.lang.Object
  extended by org.planx.xmlstore.regions.RegionManager

public class RegionManager
extends Object


Nested Class Summary
static class RegionManager.Statistics
           
 
Constructor Summary
RegionManager(XMLStore xmlstore)
           
RegionManager(XMLStore xmlstore, RegionConfiguration conf)
           
 
Method Summary
 void addRootListener(ReferenceListener l)
          Registers the specified ReferenceListener for receiving LocalLocator events for roots.
 void close()
          Closes the RegionManager and releases all ressources.
 void compact(boolean doComplete)
           
 RegionConfiguration configuration()
           
 void discriminate()
          Forces brutal compaction of the store by running the Sharer continously until the store is fully discriminated.
 void expunge()
          Clears all cached soft references to data to conserve memory.
 void flush()
          Persists the current writing Region and begins a new.
 Sharer getSharer()
           
 boolean isDiscriminated()
           
 SystemNode load(LocalLocator loc)
           
 int numOfRegions()
           
 void release()
          Attempts to release all cached ressources held.
 void release(LocalLocator loc)
          Removes a root previously added with retain(LocalLocator).
 void removeRootListener(ReferenceListener l)
          Removes a ReferenceListener previously registered with addRootListener(ReferenceListener).
 void retain(LocalLocator loc)
          Adds a root permanently that must be explicitly removed using release(LocalLocator).
 LocalLocator save(SystemNode node)
           
 long size()
          Returns the on-disk file size of the store.
 RegionManager.Statistics statistics()
           
 RegionManager.Statistics statistics(boolean isVerbose)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RegionManager

public RegionManager(XMLStore xmlstore)
              throws IOException
Throws:
IOException

RegionManager

public RegionManager(XMLStore xmlstore,
                     RegionConfiguration conf)
              throws IOException
Throws:
IOException
Method Detail

load

public SystemNode load(LocalLocator loc)
                throws IOException,
                       UnknownReferenceException
Throws:
IOException
UnknownReferenceException

save

public LocalLocator save(SystemNode node)
                  throws IOException
Throws:
IOException

flush

public void flush()
           throws IOException
Persists the current writing Region and begins a new.

Throws:
IOException

release

public void release()
             throws IOException
Attempts to release all cached ressources held. This means flushing the write region, clearing the cache, and flushing all Regions.

Throws:
IOException

discriminate

public void discriminate()
                  throws IOException
Forces brutal compaction of the store by running the Sharer continously until the store is fully discriminated. This will, of course, not do well with concurrently executing applications.

Throws:
IOException

compact

public void compact(boolean doComplete)
             throws IOException
Throws:
IOException

configuration

public RegionConfiguration configuration()

getSharer

public Sharer getSharer()

retain

public void retain(LocalLocator loc)
            throws UnknownReferenceException
Adds a root permanently that must be explicitly removed using release(LocalLocator).

Throws:
UnknownReferenceException

release

public void release(LocalLocator loc)
             throws UnknownReferenceException
Removes a root previously added with retain(LocalLocator).

Throws:
UnknownReferenceException

expunge

public void expunge()
Clears all cached soft references to data to conserve memory.


addRootListener

public void addRootListener(ReferenceListener l)
Registers the specified ReferenceListener for receiving LocalLocator events for roots.


removeRootListener

public void removeRootListener(ReferenceListener l)
Removes a ReferenceListener previously registered with addRootListener(ReferenceListener).


size

public long size()
          throws IOException
Returns the on-disk file size of the store. This includes any free space. Refer to statistics() for more detailed size information.

Throws:
IOException

numOfRegions

public int numOfRegions()

isDiscriminated

public boolean isDiscriminated()

toString

public String toString()
Overrides:
toString in class Object

statistics

public RegionManager.Statistics statistics()

statistics

public RegionManager.Statistics statistics(boolean isVerbose)

close

public void close()
           throws IOException
Closes the RegionManager and releases all ressources. Any subsequent calls to methods will throw an IllegalStateException.

Throws:
IOException


Copyright © 2010. All Rights Reserved.