Search in sources :

Example 1 with GlobalProxySelector

use of org.jkiss.dbeaver.runtime.net.GlobalProxySelector in project dbeaver by serge-rider.

the class DBeaverCore method initialize.

private void initialize() {
    long startTime = System.currentTimeMillis();
    log.debug("Initialize Core...");
    // Register properties adapter
    this.workspace = ResourcesPlugin.getWorkspace();
    this.localSystem = new OSDescriptor(Platform.getOS(), Platform.getOSArch());
    QMUtils.initApplication(this);
    this.queryManager = new QMControllerImpl();
    this.qmLogWriter = new QMLogFileWriter();
    this.queryManager.registerMetaListener(qmLogWriter);
    // Init default network settings
    Authenticator.setDefault(new GlobalProxyAuthenticator());
    ProxySelector.setDefault(new GlobalProxySelector(ProxySelector.getDefault()));
    this.certificateStorage = new DefaultCertificateStorage(new File(DBeaverActivator.getInstance().getStateLocation().toFile(), "security"));
    // Init project registry
    this.projectRegistry = new ProjectRegistry(workspace);
    // Projects registry
    initializeProjects();
    // Navigator model
    this.navigatorModel = new DBNModel(this);
    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 KeepAliveJob().scheduleMonitor();
    log.debug("Core initialized (" + (System.currentTimeMillis() - startTime) + "ms)");
}
Also used : DefaultCertificateStorage(org.jkiss.dbeaver.model.impl.app.DefaultCertificateStorage) QMControllerImpl(org.jkiss.dbeaver.runtime.qm.QMControllerImpl) GlobalProxyAuthenticator(org.jkiss.dbeaver.runtime.net.GlobalProxyAuthenticator) QMLogFileWriter(org.jkiss.dbeaver.runtime.qm.QMLogFileWriter) KeepAliveJob(org.jkiss.dbeaver.runtime.jobs.KeepAliveJob) DBNModel(org.jkiss.dbeaver.model.navigator.DBNModel) GlobalProxySelector(org.jkiss.dbeaver.runtime.net.GlobalProxySelector) IPluginService(org.jkiss.dbeaver.runtime.IPluginService) ProjectRegistry(org.jkiss.dbeaver.registry.ProjectRegistry) OSDescriptor(org.jkiss.dbeaver.model.runtime.OSDescriptor) File(java.io.File)

Aggregations

File (java.io.File)1 DefaultCertificateStorage (org.jkiss.dbeaver.model.impl.app.DefaultCertificateStorage)1 DBNModel (org.jkiss.dbeaver.model.navigator.DBNModel)1 OSDescriptor (org.jkiss.dbeaver.model.runtime.OSDescriptor)1 ProjectRegistry (org.jkiss.dbeaver.registry.ProjectRegistry)1 IPluginService (org.jkiss.dbeaver.runtime.IPluginService)1 KeepAliveJob (org.jkiss.dbeaver.runtime.jobs.KeepAliveJob)1 GlobalProxyAuthenticator (org.jkiss.dbeaver.runtime.net.GlobalProxyAuthenticator)1 GlobalProxySelector (org.jkiss.dbeaver.runtime.net.GlobalProxySelector)1 QMControllerImpl (org.jkiss.dbeaver.runtime.qm.QMControllerImpl)1 QMLogFileWriter (org.jkiss.dbeaver.runtime.qm.QMLogFileWriter)1