]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/AbstractStringModifier.java
Speeding up platform startup time
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / adapter / AbstractStringModifier.java
1 package org.simantics.db.layer0.adapter;
2
3 import org.simantics.db.Resource;
4 import org.simantics.db.common.primitiverequest.PossibleAdapter;
5 import org.simantics.db.common.utils.Logger;
6 import org.simantics.db.exception.DatabaseException;
7 import org.simantics.db.layer0.internal.SimanticsInternal;
8
9 abstract public class AbstractStringModifier implements StringModifier {
10
11         final private Resource value;
12         
13         public AbstractStringModifier(Resource resource) {
14                 this.value = resource;
15         }
16         
17         @Override
18         public String getValue() {
19                 try {
20           return SimanticsInternal.getSession().syncRequest(new PossibleAdapter<String>(value, String.class));
21       } catch (DatabaseException e) {
22           Logger.defaultLogError(e);
23           return null;
24       }
25         }
26         
27 }