X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.acorn%2Fsrc%2Forg%2Fsimantics%2Facorn%2Flru%2FLRU.java;h=80fec7032940ac3e7a6a1abbebb02325880a8bfc;hp=323d66d3df12ea34d2d429293801eeacfc95a23b;hb=c26409b1caf2f1e560d37c5befd11b442399c3fe;hpb=2a8d452434358e28cb826744bc01755a46455afd diff --git a/bundles/org.simantics.acorn/src/org/simantics/acorn/lru/LRU.java b/bundles/org.simantics.acorn/src/org/simantics/acorn/lru/LRU.java index 323d66d3d..80fec7032 100644 --- a/bundles/org.simantics.acorn/src/org/simantics/acorn/lru/LRU.java +++ b/bundles/org.simantics.acorn/src/org/simantics/acorn/lru/LRU.java @@ -16,16 +16,19 @@ import org.simantics.acorn.ClusterManager; import org.simantics.acorn.GraphClientImpl2; import org.simantics.acorn.exception.AcornAccessVerificationException; import org.simantics.acorn.exception.IllegalAcornStateException; -import org.simantics.db.common.utils.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* * The order rule of synchronization for LRU and LRUObject is: - * § Always lock LRUObject first! + * � Always lock LRUObject first! * */ public class LRU> { - + + private static final Logger LOGGER = LoggerFactory.getLogger(LRU.class); + public static boolean VERIFY = true; final private long swapTime = 5L*1000000000L; @@ -148,6 +151,12 @@ public class LRU> { } } + + + public MapValue purge(MapKey id) { + return map.remove(id); + } + public MapValue get(MapKey key) throws AcornAccessVerificationException { if(VERIFY) verifyAccess(); @@ -513,7 +522,7 @@ public class LRU> { manager.notSafeToMakeSnapshot(new IllegalAcornStateException(t)); } t.printStackTrace(); - Logger.defaultLogError(t); + LOGGER.error("Exception happened in WriteRunnable.run", t); } } @@ -553,7 +562,7 @@ public class LRU> { runWithMutex(); done = true; } else { - System.err.println("Retry mutex acquire"); + LOGGER.warn("Retry mutex acquire"); gotMutex = impl.tryAcquireMutex(); }