1 29 30 package com.caucho.db.store; 31 32 import com.caucho.java.WorkDir; 33 import com.caucho.server.util.CauchoSystem; 34 import com.caucho.vfs.Path; 35 36 40 public final class SwapStore { 41 private static SwapStore _swap; 42 43 private final Store _store; 44 45 private SwapStore() 46 { 47 ClassLoader loader = ClassLoader.getSystemClassLoader(); 48 49 Path workDir = WorkDir.getLocalWorkDir(loader); 50 51 String serverId = CauchoSystem.getServerId(); 52 53 Path path = workDir.lookup("tmp-" + serverId + ".swap"); 54 55 try { 56 _store = Store.create(path); 57 } catch (Exception e) { 58 throw new RuntimeException (e); 59 } 60 } 61 62 65 public static SwapStore create() 66 { 67 synchronized (SwapStore.class) { 68 if (_swap == null) 69 _swap = new SwapStore(); 70 71 return _swap; 72 } 73 } 74 } 75 | Popular Tags |