import org.simantics.acorn.internal.ClusterChange;
import org.simantics.acorn.internal.ClusterUpdateProcessorBase;
import org.simantics.acorn.internal.UndoClusterUpdateProcessor;
+import org.simantics.acorn.lru.ClusterChangeSet.Entry;
import org.simantics.acorn.lru.ClusterInfo;
import org.simantics.acorn.lru.ClusterStreamChunk;
import org.simantics.acorn.lru.ClusterUpdateOperation;
-import org.simantics.acorn.lru.ClusterChangeSet.Entry;
import org.simantics.db.ClusterCreator;
import org.simantics.db.Database;
import org.simantics.db.ServiceLocator;
-import org.simantics.db.common.utils.Logger;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.exception.SDBException;
import org.simantics.db.server.ProCoreException;
import org.simantics.db.service.LifecycleSupport;
import org.simantics.utils.datastructures.Pair;
import org.simantics.utils.logging.TimeLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import gnu.trove.map.hash.TLongObjectHashMap;
public class GraphClientImpl2 implements Database.Session {
-
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(GraphClientImpl2.class);
public static final boolean DEBUG = false;
public final ClusterManager clusters;
mainProgram.mutex.release();
}
} catch (IllegalAcornStateException | ProCoreException e) {
- Logger.defaultLogError("Snapshotting failed", e);
+ LOGGER.error("Snapshotting failed", e);
unexpectedClose = true;
} catch (InterruptedException e) {
- Logger.defaultLogError("Snapshotting interrupted", e);
+ LOGGER.error("Snapshotting interrupted", e);
} finally {
try {
if(tr != null)
try {
support.close();
} catch (DatabaseException e1) {
- Logger.defaultLogError("Failed to close database as a safety measure due to failed snapshotting", e1);
+ LOGGER.error("Failed to close database as a safety measure due to failed snapshotting", e1);
}
}
} catch (ProCoreException e) {
- Logger.defaultLogError("Failed to end snapshotting write transaction", e);
+ LOGGER.error("Failed to end snapshotting write transaction", e);
}
}
}
@Override
public void close() throws ProCoreException {
- System.err.println("Closing " + this + " and mainProgram " + mainProgram);
+ LOGGER.info("Closing " + this + " and mainProgram " + mainProgram);
if(!closed && !isClosing) {
isClosing = true;
try {
clusters.state.headChangeSetId++;
return clusters.state.headChangeSetId;
} catch (SDBException e) {
- Logger.defaultLogError("Failed to undo cancelled transaction", e);
+ LOGGER.error("Failed to undo cancelled transaction", e);
throw new ProCoreException(e);
}
}
mainProgram.mutex.release();
}
} catch (IllegalAcornStateException | ProCoreException e) {
- Logger.defaultLogError("Purge failed", e);
+ LOGGER.error("Purge failed", e);
unexpectedClose = true;
} catch (InterruptedException e) {
- Logger.defaultLogError("Purge interrupted", e);
+ LOGGER.error("Purge interrupted", e);
} finally {
try {
if(tr != null)
try {
support.close();
} catch (DatabaseException e1) {
- Logger.defaultLogError("Failed to close database as a safety measure due to failed purge", e1);
+ LOGGER.error("Failed to close database as a safety measure due to failed purge", e1);
}
}
} catch (ProCoreException e) {
- Logger.defaultLogError("Failed to end purge write transaction", e);
+ LOGGER.error("Failed to end purge write transaction", e);
}
}
}
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<MapKey,MapValue extends LRUObject<MapKey, MapValue>> {
-
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(LRU.class);
+
public static boolean VERIFY = true;
final private long swapTime = 5L*1000000000L;
manager.notSafeToMakeSnapshot(new IllegalAcornStateException(t));
}
t.printStackTrace();
- Logger.defaultLogError(t);
+ LOGGER.error("Exception happened in WriteRunnable.run", t);
}
}
runWithMutex();
done = true;
} else {
- System.err.println("Retry mutex acquire");
+ LOGGER.warn("Retry mutex acquire");
gotMutex = impl.tryAcquireMutex();
}
import java.util.ArrayList;
import java.util.Iterator;
-import org.simantics.db.common.utils.Logger;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.impl.DebugPolicy;
import org.simantics.db.impl.graph.ReadGraphImpl;
import org.simantics.db.impl.procedure.InternalProcedure;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
abstract public class CacheEntryBase extends CacheEntry {
+ private static final Logger LOGGER = LoggerFactory.getLogger(CacheEntryBase.class);
+
// Default level is something that is not quite a prospect but still allows for ordering within CacheCollectionResult
public static final short UNDEFINED_LEVEL = 5;
statusOrException = EXCEPTED;
result = t;
} else {
- Logger.defaultLogError("Cache entry got excepted status after being discarded: " + getClass().getSimpleName(), t);
+ LOGGER.warn("Cache entry got excepted status after being discarded: " + getClass().getSimpleName(), t);
result = t;
}
}
final public boolean assertPending() {
boolean result = isPending();
if(!result) {
- System.err.println("Assertion failed, expected pending, got " + statusOrException);
+ LOGGER.warn("Assertion failed, expected pending, got " + statusOrException);
}
return result;
}
import org.simantics.structural2.modelingRules.IAttachmentRelationMap;
import org.simantics.structural2.modelingRules.IModelingRules;
import org.simantics.utils.threads.CurrentThread;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import gnu.trove.map.hash.THashMap;
import gnu.trove.set.hash.THashSet;
public class RouteGraphUtils {
+ private static final Logger LOGGER = LoggerFactory.getLogger(RouteGraph.class);
public static boolean DEBUG = false;
public static final ILineEndStyle HEAD = new ArrowLineEndStyle("fill 2 1 0");
RouteNode n1 = nodeByData.get(link.first());
RouteNode n2 = nodeByData.get(link.second());
if (n1 == null || n2 == null) {
- System.err.println("Stray connection link found: " + link.toString(graph));
+ LOGGER.warn("Stray connection link found: " + link.toString(graph));
continue;
}
rg.link(n1, n2);