use of com.ramussoft.common.journal.DirectoryJournalFactory in project ramus by Vitaliy-Yakovchuk.
the class H2Database method createEngines.
private void createEngines() {
try {
JDBCTemplate template = createTemplate();
List<PluginProvider> suits = new ArrayList<PluginProvider>();
suits.add(new SimpleAttributePluginSuit());
PluginFactory factory = createPluginFactory(suits);
IEngineImpl impl = new IEngineImpl(0, template, PREFIX, factory) {
@Override
protected boolean deleteStreamBytes(String path) {
return false;
}
@Override
public byte[] getStream(String path) {
return null;
}
@Override
protected void writeStream(String path, byte[] bytes) {
}
};
accessor = impl.getAccessor();
PersistentFactory persistentFactory = new PersistentFactory(PREFIX, factory.getAttributePlugins(), template);
persistentFactory.rebuild();
String tmp = System.getProperty("java.io.tmpdir");
engine = new JournaledEngine(factory, impl, persistentFactory.getRows(), new DirectoryJournalFactory(new File(tmp)), accessor);
} catch (Exception e) {
if (e instanceof RuntimeException)
throw (RuntimeException) e;
throw new RuntimeException();
}
}
Aggregations