net.sf.jso.garbage
Interface GarbageCollector

All Known Implementing Classes:
JSOGarbageCollector

public interface GarbageCollector

Interface for storable objects garbage collector.


Method Summary
 int getCurrentCycle()
          Gets current garbage collection cycle.
 PID getCurrentPID()
          Gets current storage partition's identification.
 boolean isStarted()
          Indicates if garbage collector is started.
 void set(java.util.Properties properties)
          Sets garbage collector configuration properties.
 void start()
          Starts the collector.
 void stop()
          Stops the collector.
 

Method Detail

start

public void start()
           throws StorageException
Starts the collector.

Throws:
StorageException

stop

public void stop()
          throws StorageException
Stops the collector.

Throws:
StorageException

set

public void set(java.util.Properties properties)
         throws java.lang.IllegalStateException
Sets garbage collector configuration properties. This method can only be called if collector is not running, that is, only if isStarted() method returns false.

Parameters:
properties - Properties containing parameters to the collector. The following properties can be used:
  • jso.garbage.partition.size: The size of a partition. Specifies the maximum number of objects a (logical) partition can have. If not specified the default size of 200 objects is used.
  • jso.garbage.collection.interval: The interval between two consecutive garbage collections, in minutes. If not specified the default interval of 10 minutes is used.
Throws:
java.lang.IllegalStateException - If collector has already been started.

isStarted

public boolean isStarted()
Indicates if garbage collector is started.

Returns:
true if collector is running; false otherwise.

getCurrentPID

public PID getCurrentPID()
                  throws StorageException
Gets current storage partition's identification.

Returns:
Current storage partition's identification.
Throws:
StorageException

getCurrentCycle

public int getCurrentCycle()
Gets current garbage collection cycle.

Returns:
Current garbage collection cycle.