org.kahina.core.io.magazine
Class ObjectMagazine<S>

java.lang.Object
  extended by org.kahina.core.io.magazine.ObjectMagazine<S>
Type Parameters:
S -

public class ObjectMagazine<S>
extends Object

Stores objects in memory by default, but serializes them away to disk in blocks when memory usage exceeds a specified threshold. The idea is from http:// forums.sun.com/thread.jspa?messageID=10949277#10949277.


Method Summary
 void close()
           
static
<S> ObjectMagazine<S>
create()
           
static
<S> ObjectMagazine<S>
load(File folder, Class<S> objectType)
           
 void persist(File destinationFolder, ProgressMonitorWrapper monitor)
           
 int persistSteps()
           
 S retrieve(int index)
           
 void store(int index, S object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

retrieve

public S retrieve(int index)

store

public void store(int index,
                  S object)

load

public static <S> ObjectMagazine<S> load(File folder,
                                         Class<S> objectType)

create

public static <S> ObjectMagazine<S> create()

persistSteps

public int persistSteps()

persist

public void persist(File destinationFolder,
                    ProgressMonitorWrapper monitor)

close

public void close()