org.gcube.datatransformation.datatransformationlibrary.tmpfilemanagement
Class GarbageCollector

java.lang.Object
  extended by java.lang.Thread
      extended by org.gcube.datatransformation.datatransformationlibrary.tmpfilemanagement.GarbageCollector
All Implemented Interfaces:
Runnable

public class GarbageCollector
extends Thread

Author:
Dimitris Katris, NKUA Class which garbage collects temporary files.

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
GarbageCollector(File tmpDirectory)
          Initializes the GarbageCollector
 
Method Summary
static void configGCFileLifetime(long filelifetime)
          Sets the lifetime of each temporary file.
static void configReGCollectInterval(long reGCollectInterval)
          Sets the interval in which the GarbageCollector searches for files to delete.
protected  void forceTempFilesDeletion()
           
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GarbageCollector

public GarbageCollector(File tmpDirectory)
Initializes the GarbageCollector

Parameters:
tmpDirectory - The directory in which the GarbageCollector will garbage collect the files.
Method Detail

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread
See Also:
Thread.run()

forceTempFilesDeletion

protected void forceTempFilesDeletion()

configGCFileLifetime

public static void configGCFileLifetime(long filelifetime)
Sets the lifetime of each temporary file.

Parameters:
filelifetime - The lifetime of each temporary file.

configReGCollectInterval

public static void configReGCollectInterval(long reGCollectInterval)
Sets the interval in which the GarbageCollector searches for files to delete.

Parameters:
reGCollectInterval - The interval in which the GarbageCollector searches for files to delete.


Copyright © 2013. All Rights Reserved.