Search in sources :

Example 1 with KeepAliveListenerJob

use of org.jkiss.dbeaver.runtime.jobs.KeepAliveListenerJob in project dbeaver by dbeaver.

the class BasePlatformImpl method initialize.

protected void initialize() {
    log.debug("Initialize base platform...");
    DBPPreferenceStore prefsStore = getPreferenceStore();
    // Global pref events forwarder
    prefsStore.addPropertyChangeListener(event -> {
        // Forward event to all data source preferences
        for (DBPDataSourceContainer ds : DataSourceRegistry.getAllDataSources()) {
            ((AbstractPreferenceStore) ds.getPreferenceStore()).firePropertyChangeEvent(prefsStore, event.getProperty(), event.getOldValue(), event.getNewValue());
        }
    });
    this.localSystem = new OSDescriptor(Platform.getOS(), Platform.getOSArch());
    {
        this.language = PlatformLanguageRegistry.getInstance().getLanguage(Locale.getDefault());
        if (this.language == null) {
            log.debug("Language for locale '" + Locale.getDefault() + "' not found. Use default.");
            this.language = PlatformLanguageRegistry.getInstance().getLanguage(Locale.ENGLISH);
        }
    }
    // Navigator model
    this.navigatorModel = new DBNModel(this, null);
    this.navigatorModel.initialize();
    // Activate plugin services
    for (IPluginService pluginService : PluginServiceRegistry.getInstance().getServices()) {
        try {
            pluginService.activateService();
            activatedServices.add(pluginService);
        } catch (Throwable e) {
            log.error("Error activating plugin service", e);
        }
    }
    // Keep-alive job
    new KeepAliveListenerJob(this).scheduleMonitor();
}
Also used : AbstractPreferenceStore(org.jkiss.dbeaver.model.impl.preferences.AbstractPreferenceStore) KeepAliveListenerJob(org.jkiss.dbeaver.runtime.jobs.KeepAliveListenerJob) IPluginService(org.jkiss.dbeaver.runtime.IPluginService) DBPPreferenceStore(org.jkiss.dbeaver.model.preferences.DBPPreferenceStore) DBPDataSourceContainer(org.jkiss.dbeaver.model.DBPDataSourceContainer) OSDescriptor(org.jkiss.dbeaver.model.runtime.OSDescriptor) DBNModel(org.jkiss.dbeaver.model.navigator.DBNModel)

Example 2 with KeepAliveListenerJob

use of org.jkiss.dbeaver.runtime.jobs.KeepAliveListenerJob in project dbeaver by serge-rider.

the class BasePlatformImpl method initialize.

protected void initialize() {
    log.debug("Initialize base platform...");
    DBPPreferenceStore prefsStore = getPreferenceStore();
    // Global pref events forwarder
    prefsStore.addPropertyChangeListener(event -> {
        // Forward event to all data source preferences
        for (DBPDataSourceContainer ds : DataSourceRegistry.getAllDataSources()) {
            ((AbstractPreferenceStore) ds.getPreferenceStore()).firePropertyChangeEvent(prefsStore, event.getProperty(), event.getOldValue(), event.getNewValue());
        }
    });
    this.localSystem = new OSDescriptor(Platform.getOS(), Platform.getOSArch());
    {
        this.language = PlatformLanguageRegistry.getInstance().getLanguage(Locale.getDefault());
        if (this.language == null) {
            log.debug("Language for locale '" + Locale.getDefault() + "' not found. Use default.");
            this.language = PlatformLanguageRegistry.getInstance().getLanguage(Locale.ENGLISH);
        }
    }
    // Navigator model
    this.navigatorModel = new DBNModel(this, null);
    this.navigatorModel.initialize();
    // Activate plugin services
    for (IPluginService pluginService : PluginServiceRegistry.getInstance().getServices()) {
        try {
            pluginService.activateService();
            activatedServices.add(pluginService);
        } catch (Throwable e) {
            log.error("Error activating plugin service", e);
        }
    }
    // Keep-alive job
    new KeepAliveListenerJob(this).scheduleMonitor();
}
Also used : AbstractPreferenceStore(org.jkiss.dbeaver.model.impl.preferences.AbstractPreferenceStore) KeepAliveListenerJob(org.jkiss.dbeaver.runtime.jobs.KeepAliveListenerJob) IPluginService(org.jkiss.dbeaver.runtime.IPluginService) DBPPreferenceStore(org.jkiss.dbeaver.model.preferences.DBPPreferenceStore) DBPDataSourceContainer(org.jkiss.dbeaver.model.DBPDataSourceContainer) OSDescriptor(org.jkiss.dbeaver.model.runtime.OSDescriptor) DBNModel(org.jkiss.dbeaver.model.navigator.DBNModel)

Aggregations

DBPDataSourceContainer (org.jkiss.dbeaver.model.DBPDataSourceContainer)2 AbstractPreferenceStore (org.jkiss.dbeaver.model.impl.preferences.AbstractPreferenceStore)2 DBNModel (org.jkiss.dbeaver.model.navigator.DBNModel)2 DBPPreferenceStore (org.jkiss.dbeaver.model.preferences.DBPPreferenceStore)2 OSDescriptor (org.jkiss.dbeaver.model.runtime.OSDescriptor)2 IPluginService (org.jkiss.dbeaver.runtime.IPluginService)2 KeepAliveListenerJob (org.jkiss.dbeaver.runtime.jobs.KeepAliveListenerJob)2