Search in sources :

Example 6 with PluginFactory

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

the class Client method createPluginFactory.

private PluginFactory createPluginFactory(List<PluginProvider> list) {
    ArrayList<Plugin> plugins = new ArrayList<Plugin>();
    for (PluginProvider suit : list) {
        plugins.addAll(suit.getPlugins());
    }
    PluginFactory factory = new PluginFactory(plugins);
    return factory;
}
Also used : ArrayList(java.util.ArrayList) PluginProvider(com.ramussoft.common.PluginProvider) AbstractGUIPluginFactory(com.ramussoft.gui.common.AbstractGUIPluginFactory) SimleGUIPluginFactory(com.ramussoft.gui.core.simple.SimleGUIPluginFactory) GUIPluginFactory(com.ramussoft.gui.core.GUIPluginFactory) PluginFactory(com.ramussoft.common.PluginFactory) Plugin(com.ramussoft.common.Plugin) GUIPlugin(com.ramussoft.gui.common.GUIPlugin)

Example 7 with PluginFactory

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

the class MemoryDatabase method createJournaledEngine.

private JournaledEngine createJournaledEngine(PluginFactory factory, PersistentFactory persistentFactory) throws ClassNotFoundException {
    if (cached) {
        JournaledEngine journaledEngine2 = new JournaledEngine(factory, impl, persistentFactory.getRows(), journalFactory, accessor) {

            @Override
            protected void initPlugins(PluginFactory pluginFactory, AccessRules accessor) {
            }
        };
        CachedEngine cachedEngine = new CachedEngine(journaledEngine2);
        for (Plugin plugin : factory.getPlugins()) plugin.init(cachedEngine, accessor);
        this.engine = cachedEngine;
        return journaledEngine2;
    } else {
        JournaledEngine journaledEngine2 = new JournaledEngine(factory, impl, persistentFactory.getRows(), journalFactory, accessor);
        this.engine = journaledEngine2;
        return journaledEngine2;
    }
}
Also used : JournaledEngine(com.ramussoft.common.journal.JournaledEngine) CachedEngine(com.ramussoft.common.cached.CachedEngine) AccessRules(com.ramussoft.common.AccessRules) PluginFactory(com.ramussoft.common.PluginFactory) Plugin(com.ramussoft.common.Plugin)

Example 8 with PluginFactory

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

the class AbstractDatabase method createPluginFactory.

protected PluginFactory createPluginFactory(List<PluginProvider> list) {
    ArrayList<Plugin> plugins = new ArrayList<Plugin>();
    for (PluginProvider suit : list) {
        plugins.addAll(suit.getPlugins());
    }
    PluginFactory factory = new PluginFactory(plugins);
    return factory;
}
Also used : ArrayList(java.util.ArrayList) PluginProvider(com.ramussoft.common.PluginProvider) PluginFactory(com.ramussoft.common.PluginFactory) Plugin(com.ramussoft.common.Plugin)

Example 9 with PluginFactory

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

the class NDataPluginFactory method createTemplateDataPlugin.

private static DataPlugin createTemplateDataPlugin() {
    MemoryDatabase database = new MemoryDatabase() {

        @Override
        protected Collection<? extends PluginProvider> getAdditionalSuits() {
            ArrayList<PluginProvider> ps = new ArrayList<PluginProvider>(1);
            ps.add(new IDEF0PluginProvider());
            return ps;
        }

        @Override
        protected String getJournalDirectoryName(String tmp) {
            return null;
        }

        @Override
        protected FileIEngineImpl createFileIEngine(PluginFactory factory) throws ClassNotFoundException, ZipException, IOException {
            return createNotSessionedFileIEngine(factory);
        }
    };
    Engine e = database.getEngine(null);
    AccessRules rules = database.getAccessRules(null);
    Qualifier q = e.createQualifier();
    IDEF0Plugin.installFunctionAttributes(q, e);
    return getDataPlugin(q, e, rules);
}
Also used : MemoryDatabase(com.ramussoft.database.MemoryDatabase) ArrayList(java.util.ArrayList) AccessRules(com.ramussoft.common.AccessRules) Qualifier(com.ramussoft.common.Qualifier) PluginProvider(com.ramussoft.common.PluginProvider) PluginFactory(com.ramussoft.common.PluginFactory) Engine(com.ramussoft.common.Engine)

Example 10 with PluginFactory

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

the class Navigator method createPluginFactory.

private PluginFactory createPluginFactory(List<PluginProvider> list) {
    ArrayList<Plugin> plugins = new ArrayList<Plugin>();
    for (PluginProvider suit : list) {
        plugins.addAll(suit.getPlugins());
    }
    PluginFactory factory = new PluginFactory(plugins);
    return factory;
}
Also used : ArrayList(java.util.ArrayList) IDEF0PluginProvider(com.ramussoft.idef0.IDEF0PluginProvider) ReportPluginProvider(com.ramussoft.report.ReportPluginProvider) PluginProvider(com.ramussoft.common.PluginProvider) NDataPluginFactory(com.ramussoft.idef0.NDataPluginFactory) PluginFactory(com.ramussoft.common.PluginFactory) DataPlugin(com.ramussoft.pb.DataPlugin) Plugin(com.ramussoft.common.Plugin)

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