package com.nicewuerfel.blockown.database;
class CachedDatabaseOperation implements Runnable {
private final DatabaseAction action;
private final CachedDatabase database;
CachedDatabaseOperation(CachedDatabase database, DatabaseAction action) {
this.action = action;
this.database = database;
}
@Override
public void run() {
if (!database.cache.doAction(action)) {
database.getOutput().printException("An action has not been performed",
new ActionNotPerformedException(action));
}
}
}