Search in sources :

Example 16 with PluginFactory

use of com.ramussoft.common.PluginFactory in project ramus by Vitaliy-Yakovchuk.

the class MemoryDatabase method createEngines.

protected void createEngines() {
    try {
        this.template = createTemplate();
        List<PluginProvider> suits = new ArrayList<PluginProvider>();
        loadSuits(suits);
        PluginFactory factory = createPluginFactory(suits);
        impl = createFileIEngine(factory);
        accessor = impl.getAccessor();
        PersistentFactory persistentFactory = new PersistentFactory("ramus_", factory.getAttributePlugins(), template);
        persistentFactory.rebuild();
        File file = getFile();
        if (file != null)
            impl.open(file, isIrnoreUnregisteredPlugins());
        String jName = getJournalDirectoryName(impl.getTmpPath());
        File directory = null;
        if (jName != null) {
            directory = new File(jName);
        }
        journalFactory = createJournalFactory(directory);
        journaledEngine = createJournaledEngine(factory, persistentFactory);
        this.engine = (Engine) SuperEngineFactory.createTransactionalEngine(engine, new JournalEngineImpl(journaledEngine));
        this.engine.setPluginProperty("Core", "PluginList", factory.getPlugins());
        this.engine.setPluginProperty("Core", "PluginFactory", factory);
    } catch (Exception e) {
        if (e instanceof RuntimeException)
            throw (RuntimeException) e;
        throw new RuntimeException(e);
    }
}
Also used : PersistentFactory(com.ramussoft.core.persistent.PersistentFactory) JournalEngineImpl(com.ramussoft.common.journal.JournalEngineImpl) ArrayList(java.util.ArrayList) PluginProvider(com.ramussoft.common.PluginProvider) PluginFactory(com.ramussoft.common.PluginFactory) File(java.io.File) ZipException(java.util.zip.ZipException) IOException(java.io.IOException) SQLException(java.sql.SQLException)

Aggregations

PluginFactory (com.ramussoft.common.PluginFactory)16 PluginProvider (com.ramussoft.common.PluginProvider)13 ArrayList (java.util.ArrayList)13 Engine (com.ramussoft.common.Engine)8 Plugin (com.ramussoft.common.Plugin)8 AccessRules (com.ramussoft.common.AccessRules)5 IOException (java.io.IOException)5 SQLException (java.sql.SQLException)5 JournaledEngine (com.ramussoft.common.journal.JournaledEngine)4 SimpleAttributePluginSuit (com.ramussoft.core.attribute.simple.SimpleAttributePluginSuit)4 PersistentFactory (com.ramussoft.core.persistent.PersistentFactory)4 MemoryDatabase (com.ramussoft.database.MemoryDatabase)4 IDEF0PluginProvider (com.ramussoft.idef0.IDEF0PluginProvider)4 IEngine (com.ramussoft.common.IEngine)3 CachedEngine (com.ramussoft.common.cached.CachedEngine)3 FileIEngineImpl (com.ramussoft.core.impl.FileIEngineImpl)3 AbstractGUIPluginFactory (com.ramussoft.gui.common.AbstractGUIPluginFactory)3 GUIPluginFactory (com.ramussoft.gui.core.GUIPluginFactory)3 SimleGUIPluginFactory (com.ramussoft.gui.core.simple.SimleGUIPluginFactory)3 JDBCTemplate (com.ramussoft.jdbc.JDBCTemplate)3