public JESpace(String name, String params) throws SpaceError { super(); try { EnvironmentConfig envConfig = new EnvironmentConfig(); StoreConfig storeConfig = new StoreConfig(); String[] p = ISOUtil.commaDecode(params); String path = p[0]; envConfig.setAllowCreate (true); envConfig.setTransactional(true); envConfig.setLockTimeout(getParam("lock.timeout", p, DEFAULT_LOCK_TIMEOUT), TimeUnit.MILLISECONDS); envConfig.setTxnTimeout(getParam("txn.timeout", p, DEFAULT_TXN_TIMEOUT), TimeUnit.MILLISECONDS); storeConfig.setAllowCreate (true); storeConfig.setTransactional (true); File dir = new File(path); dir.mkdirs(); dbe = new Environment (dir, envConfig); store = new EntityStore (dbe, name, storeConfig); pIndex = store.getPrimaryIndex (Long.class, Ref.class); gcpIndex = store.getPrimaryIndex (Long.class, GCRef.class); sIndex = store.getSecondaryIndex (pIndex, String.class, "key"); gcsIndex = store.getSecondaryIndex (gcpIndex, Long.class, "expires"); gcTask = SpaceFactory.getGCExecutor().scheduleAtFixedRate(this, GC_DELAY, GC_DELAY, TimeUnit.MILLISECONDS); } catch (Exception e) { throw new SpaceError (e); } }