public void checkSessionAndConnect(DBRProgressListener onFinish) throws DBException {
        if (getDataSourceContainer() != null
            && getDataSourceContainer().isConnected()
            && getExecutionContext() != null
        ) {
            if (onFinish != null) {
                onFinish.onTaskFinished(Status.OK_STATUS);
            }
        } else {
            checkSession(status -> {
                if (status.isOK() && getExecutionContext() == null) {
                    status = GeneralUtils.makeErrorStatus("Failed to create execution context after session check");
                }

                if (onFinish != null) {
                    onFinish.onTaskFinished(status);
                }
            });
        }
    }
Obtain the add-in instance by its concrete type
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java