Class PreloadedDataStore
java.lang.Object
it.uniroma2.art.semanticturkey.services.core.projects.PreloadedDataStore
A singleton component that is in charge of storing preloaded data, while assuring that they will be
eventually deleted. The current implementation does not guarantee the deletion of the stored data in case
of abrupt termination of the program. For this case, it relies on the automatic clearing of the temporary
directory where this store places its data.
- Author:
- Manuel Fiorelli, Andrea Turbati
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends Exception>
voidconsumePreloadedData
(String preloadedDataFileName, ValidationUtilities.ThrowingConsumer<File, T> consumerTask) void
finishConsumingPreloadedData
(String preloadedDataFileName, boolean deleteFile, ReentrantLock lock) getReentrantLock
(String preloadedDataFileName) preloadData
(ValidationUtilities.ThrowingConsumer<File, T> preloadingTask) startConsumingPreloadedData
(String preloadedDataFileName)
-
Constructor Details
-
PreloadedDataStore
- Throws:
IOException
-
-
Method Details
-
preloadData
public <T extends Exception> File preloadData(ValidationUtilities.ThrowingConsumer<File, T> preloadingTask) throws T, IOException- Throws:
T extends Exception
IOException
-
consumePreloadedData
public <T extends Exception> void consumePreloadedData(String preloadedDataFileName, ValidationUtilities.ThrowingConsumer<File, T> consumerTask) throws T, IOException- Throws:
T extends Exception
IOException
-
getReentrantLock
-
startConsumingPreloadedData
- Throws:
IOException
-
finishConsumingPreloadedData
public void finishConsumingPreloadedData(String preloadedDataFileName, boolean deleteFile, ReentrantLock lock)
-