]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.simulation/src/org/simantics/simulation/data/DatasourceAdapter.java
Added `possibleInvertibleExpressionReferencedTransformedProperty`
[simantics/platform.git] / bundles / org.simantics.simulation / src / org / simantics / simulation / data / DatasourceAdapter.java
index 1ee543f4c91c6ce7d45959f3d46ead583da32b57..34fbb587d8afca2e5645f3399914abe5d5991dab 100644 (file)
@@ -19,8 +19,6 @@ import java.util.Set;
 import java.util.concurrent.Executor;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.simantics.databoard.Bindings;
 import org.simantics.databoard.accessor.error.AccessorException;
@@ -32,6 +30,8 @@ import org.simantics.history.HistoryException;
 import org.simantics.history.util.subscription.SubscriptionItem;
 import org.simantics.simulation.data.Datasource.DatasourceListener;
 import org.simantics.utils.datastructures.Triple;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * This adapter reads data from Datasource and writes to an open Subscription.
@@ -41,7 +41,7 @@ import org.simantics.utils.datastructures.Triple;
  */
 public class DatasourceAdapter implements DatasourceListener {
 
-       protected Logger logger = Logger.getLogger( DatasourceAdapter.class.toString() );
+       protected Logger logger = LoggerFactory.getLogger( DatasourceAdapter.class );
        protected Collector session;
        protected boolean loaded = false;
        protected List<VariableHandle> handles = new ArrayList<VariableHandle>();
@@ -139,7 +139,7 @@ public class DatasourceAdapter implements DatasourceListener {
                         result.add(Triple.make(key, binding, value));
                     } catch (AccessorException e) {
                         if (failedIds.add(key))
-                            logger.log(Level.SEVERE, e.toString(), e);
+                            logger.error(e.toString(), e);
                         continue;
                     }
                 }
@@ -172,20 +172,20 @@ public class DatasourceAdapter implements DatasourceListener {
                             value = handle.getValue(source);
                         } catch (AccessorException e) {
                             if (failedIds.add(key))
-                                logger.log(Level.SEVERE, e.toString(), e);
+                                logger.error(e.toString(), e);
                             continue;
                         }
                         Binding binding = handle.binding();
                         try {
                             session.setValue( key, binding, value );
                         } catch (HistoryException e) {
-                            logger.log(Level.SEVERE, e.toString(), e);
+                            logger.error(e.toString(), e);
                         }
                     } else {
                         Binding binding = bindings.get(i);
                         if (binding != null) { 
                             session.setValue( key, binding, value );
-                        }                       
+                        }
                     }
                 }
 
@@ -193,11 +193,11 @@ public class DatasourceAdapter implements DatasourceListener {
                 try {
                     session.endStep();
                 } catch (HistoryException e) {
-                    logger.log(Level.SEVERE, e.toString(), e);
+                    logger.error(e.toString(), e);
                 }
             }
         } catch (HistoryException e) {
-            logger.log(Level.SEVERE, e.toString(), e);
+            logger.error(e.toString(), e);
         } finally {
             stepLock.unlock();
         }
@@ -207,6 +207,5 @@ public class DatasourceAdapter implements DatasourceListener {
        public Executor getExecutor() {
                return null;
        }
-       
 
 }