1 /*******************************************************************************
2 * Copyright (c) 2013 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 * Semantum Oy - initial API and implementation
12 *******************************************************************************/
13 package org.simantics.simulator.toolkit.db;
15 import org.simantics.db.layer0.variable.NodeSupport;
16 import org.simantics.simulator.toolkit.StandardNodeManager;
17 import org.simantics.simulator.toolkit.StandardNodeManagerSupport;
18 import org.simantics.simulator.toolkit.StandardRealm;
19 import org.simantics.simulator.variable.exceptions.NodeManagerException;
20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory;
24 * Adds support for Layer0 Variable interface in StandardNodeManager
26 * @author Antti Villberg
28 public class StandardVariableNodeManager<Node, Engine extends StandardNodeManagerSupport<Node>> extends StandardNodeManager<Node,Engine> {
30 private static final Logger LOGGER = LoggerFactory.getLogger(StandardVariableNodeManager.class);
31 protected NodeSupport<Node> support;
33 public StandardVariableNodeManager(StandardRealm<Node, Engine> realm, Node root) {
35 this.support = new NodeSupport<>(this);
39 public void refreshVariable(Node node) {
41 support.refreshCache(node);
42 } catch (NodeManagerException e) {
43 LOGGER.error("Failed to refresh variable", e);
44 throw new RuntimeException(e);
46 super.refreshVariable(node);