-package org.simantics.db.common;\r
-\r
-import org.simantics.db.Session;\r
-import org.simantics.db.service.LifecycleSupport;\r
-\r
-\r
-public class SessionThreads {\r
-\r
- public static boolean isClosed() {\r
- Thread current = Thread.currentThread();\r
- if(current instanceof SessionThread) {\r
- Session session = ((SessionThread)current).getSession();\r
- LifecycleSupport ls = session.peekService(LifecycleSupport.class);\r
- if(ls != null) return ls.isClosed();\r
- else return true;\r
- } else {\r
- return false;\r
- }\r
- }\r
- \r
-}\r
+package org.simantics.db.common;
+
+import org.simantics.db.Session;
+import org.simantics.db.service.LifecycleSupport;
+
+
+public class SessionThreads {
+
+ public static boolean isClosed() {
+ Thread current = Thread.currentThread();
+ if(current instanceof SessionThread) {
+ Session session = ((SessionThread)current).getSession();
+ LifecycleSupport ls = session.peekService(LifecycleSupport.class);
+ if(ls != null) return ls.isClosed();
+ else return true;
+ } else {
+ return false;
+ }
+ }
+
+}