From 8186482a11e0498c71c5560873163854fd5ab37a Mon Sep 17 00:00:00 2001 From: huanghongxun Date: Fri, 11 Dec 2015 21:18:51 +0800 Subject: [PATCH] Extracted the codes about installing 2.0 --- .../launch/IMinecraftAssetService.java | 51 ++++++ .../launch/IMinecraftDownloadService.java | 62 +++++++ .../launcher/launch/IMinecraftService.java | 33 ++++ .../utils/installers/InstallerType.java | 37 ++++ .../version/MinecraftDownloadService.java | 163 +++++++++++++++++ .../launcher/views/InstallerPanel.form | 85 +++++++++ .../launcher/views/InstallerPanel.java | 168 ++++++++++++++++++ .../hellominecraft/tasks/TaskObservable.java | 44 +++++ 8 files changed, 643 insertions(+) create mode 100644 HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/launch/IMinecraftAssetService.java create mode 100644 HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/launch/IMinecraftDownloadService.java create mode 100644 HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/launch/IMinecraftService.java create mode 100644 HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/utils/installers/InstallerType.java create mode 100644 HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/version/MinecraftDownloadService.java create mode 100644 HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/InstallerPanel.form create mode 100644 HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/InstallerPanel.java create mode 100644 HMCLAPI/src/main/java/org/jackhuang/hellominecraft/tasks/TaskObservable.java diff --git a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/launch/IMinecraftAssetService.java b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/launch/IMinecraftAssetService.java new file mode 100644 index 000000000..9e7912df3 --- /dev/null +++ b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/launch/IMinecraftAssetService.java @@ -0,0 +1,51 @@ +/* + * Hello Minecraft! Launcher. + * Copyright (C) 2013 huangyuhui + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see {http://www.gnu.org/licenses/}. + */ +package org.jackhuang.hellominecraft.launcher.launch; + +import java.io.File; +import java.io.IOException; +import org.jackhuang.hellominecraft.launcher.settings.Profile; +import org.jackhuang.hellominecraft.tasks.Task; + +/** + * + * @author huangyuhui + */ +public abstract class IMinecraftAssetService extends IMinecraftService { + + public IMinecraftAssetService(Profile profile) { + super(profile); + } + + public abstract Task downloadAssets(String mcVersion); + + public abstract File getAssets(); + + /** + * Redownload the Asset index json of the given version. + * + * @param a the given version name + * + * @return Is the action successful? + */ + public abstract boolean refreshAssetsIndex(String a); + + public abstract boolean downloadMinecraftAssetsIndex(String assetsId); + + public abstract File getAssetObject(String assetVersion, String name) throws IOException; +} diff --git a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/launch/IMinecraftDownloadService.java b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/launch/IMinecraftDownloadService.java new file mode 100644 index 000000000..cb54a8209 --- /dev/null +++ b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/launch/IMinecraftDownloadService.java @@ -0,0 +1,62 @@ +/* + * Hello Minecraft! Launcher. + * Copyright (C) 2013 huangyuhui + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see {http://www.gnu.org/licenses/}. + */ +package org.jackhuang.hellominecraft.launcher.launch; + +import java.util.List; +import org.jackhuang.hellominecraft.launcher.settings.Profile; +import org.jackhuang.hellominecraft.launcher.version.MinecraftVersion; +import org.jackhuang.hellominecraft.version.MinecraftRemoteVersion; +import rx.Observable; + +/** + * + * @author huangyuhui + */ +public abstract class IMinecraftDownloadService extends IMinecraftService { + + public IMinecraftDownloadService(Profile profile) { + super(profile); + } + + public abstract MinecraftVersion downloadMinecraft(String id); + + public abstract boolean downloadMinecraftJar(String id); + + public abstract boolean downloadMinecraftVersionJson(String id); + + + + /** + * Get the libraries that need to download. + * + * @return the library collection + */ + public abstract List getDownloadLibraries(); + + /** + * Install a new version to this profile. + * + * @param version the new version name + * + * @return Is the action successful? + */ + public abstract boolean install(String version); + + public abstract Observable getRemoteVersions(); + +} diff --git a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/launch/IMinecraftService.java b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/launch/IMinecraftService.java new file mode 100644 index 000000000..c49949c3e --- /dev/null +++ b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/launch/IMinecraftService.java @@ -0,0 +1,33 @@ +/* + * Hello Minecraft! Launcher. + * Copyright (C) 2013 huangyuhui + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see {http://www.gnu.org/licenses/}. + */ +package org.jackhuang.hellominecraft.launcher.launch; + +import org.jackhuang.hellominecraft.launcher.settings.Profile; + +/** + * + * @author huangyuhui + */ +public abstract class IMinecraftService { + public Profile profile; + + public IMinecraftService(Profile profile) { + this.profile = profile; + } + +} diff --git a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/utils/installers/InstallerType.java b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/utils/installers/InstallerType.java new file mode 100644 index 000000000..346b7231a --- /dev/null +++ b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/utils/installers/InstallerType.java @@ -0,0 +1,37 @@ +/* + * Hello Minecraft! Launcher. + * Copyright (C) 2013 huangyuhui + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see {http://www.gnu.org/licenses/}. + */ +package org.jackhuang.hellominecraft.launcher.utils.installers; + +/** + * + * @author huangyuhui + */ +public enum InstallerType { + Forge("forge"), Optifine("optifine"), LiteLoader("liteloader"); + + public final String id; + + private InstallerType(String id) { + this.id = id; + } + + + public String getLocalizedName() { + return this.name(); + } +} diff --git a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/version/MinecraftDownloadService.java b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/version/MinecraftDownloadService.java new file mode 100644 index 000000000..03ed9df06 --- /dev/null +++ b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/version/MinecraftDownloadService.java @@ -0,0 +1,163 @@ +/* + * Hello Minecraft! Launcher. + * Copyright (C) 2013 huangyuhui + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see {http://www.gnu.org/licenses/}. + */ +package org.jackhuang.hellominecraft.launcher.version; + +import org.jackhuang.hellominecraft.launcher.launch.IMinecraftDownloadService; +import com.google.gson.JsonSyntaxException; +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import org.jackhuang.hellominecraft.C; +import org.jackhuang.hellominecraft.HMCLog; +import org.jackhuang.hellominecraft.launcher.launch.GameLauncher; +import org.jackhuang.hellominecraft.launcher.settings.Profile; +import org.jackhuang.hellominecraft.tasks.TaskWindow; +import org.jackhuang.hellominecraft.tasks.download.FileDownloadTask; +import org.jackhuang.hellominecraft.utils.NetUtils; +import org.jackhuang.hellominecraft.utils.system.FileUtils; +import org.jackhuang.hellominecraft.utils.system.IOUtils; +import org.jackhuang.hellominecraft.version.MinecraftRemoteVersion; +import org.jackhuang.hellominecraft.version.MinecraftRemoteVersions; +import rx.Observable; + +/** + * + * @author huangyuhui + */ +public class MinecraftDownloadService extends IMinecraftDownloadService { + MinecraftVersionManager mgr; + + public MinecraftDownloadService(Profile p, MinecraftVersionManager mgr) { + super(p); + this.mgr = mgr; + } + + @Override + public List getDownloadLibraries() { + ArrayList downloadLibraries = new ArrayList<>(); + if (profile.getSelectedMinecraftVersion() == null) + return downloadLibraries; + MinecraftVersion v = profile.getSelectedMinecraftVersion().resolve(mgr); + if (v.libraries != null) + for (IMinecraftLibrary l : v.libraries) { + l.init(); + if (l.allow()) { + File ff = l.getFilePath(profile.getCanonicalGameDirFile()); + if (!ff.exists()) { + String libURL = profile.getDownloadType().getProvider().getLibraryDownloadURL() + "/"; + libURL = profile.getDownloadType().getProvider().getParsedLibraryDownloadURL(l.getDownloadURL(libURL, profile.getDownloadType())); + if (libURL != null) + downloadLibraries.add(new GameLauncher.DownloadLibraryJob(l.name, libURL, ff)); + } + } + } + return downloadLibraries; + } + + @Override + public boolean install(String id) { + MinecraftVersion v = downloadMinecraft(id); + if (v != null) { + mgr.versions.put(v.id, v); + return true; + } + return false; + } + + @Override + public MinecraftVersion downloadMinecraft(String id) { + String vurl = profile.getDownloadType().getProvider().getVersionsDownloadURL() + id + "/"; + File vpath = new File(profile.getCanonicalGameDirFile(), "versions/" + id); + File mvt = new File(vpath, id + ".json"); + File mvj = new File(vpath, id + ".jar"); + vpath.mkdirs(); + mvt.delete(); + mvj.delete(); + + if (TaskWindow.getInstance() + .addTask(new FileDownloadTask(vurl + id + ".json", IOUtils.tryGetCanonicalFile(mvt)).setTag(id + ".json")) + .addTask(new FileDownloadTask(vurl + id + ".jar", IOUtils.tryGetCanonicalFile(mvj)).setTag(id + ".jar")) + .start()) + try { + return C.gson.fromJson(FileUtils.readFileToStringQuietly(mvt), MinecraftVersion.class); + } catch (JsonSyntaxException ex) { + HMCLog.err("Failed to parse minecraft version json.", ex); + } + else + FileUtils.deleteDirectoryQuietly(vpath); + return null; + } + + @Override + public boolean downloadMinecraftJar(String id) { + String vurl = profile.getDownloadType().getProvider().getVersionsDownloadURL() + id + "/"; + File vpath = new File(profile.getCanonicalGameDirFile(), "versions/" + id); + File mvv = new File(vpath, id + ".jar"), moved = null; + if (mvv.exists()) { + moved = new File(vpath, id + "-renamed.jar"); + mvv.renameTo(moved); + } + File mvt = new File(vpath, id + ".jar"); + vpath.mkdirs(); + if (TaskWindow.getInstance() + .addTask(new FileDownloadTask(vurl + id + ".jar", IOUtils.tryGetCanonicalFile(mvt)).setTag(id + ".jar")) + .start()) { + if (moved != null) + moved.delete(); + return true; + } else { + mvt.delete(); + if (moved != null) + moved.renameTo(mvt); + return false; + } + } + + @Override + public boolean downloadMinecraftVersionJson(String id) { + String vurl = profile.getDownloadType().getProvider().getVersionsDownloadURL() + id + "/"; + File vpath = new File(profile.getCanonicalGameDirFile(), "versions/" + id); + File mvv = new File(vpath, id + ".json"), moved = null; + if (mvv.exists()) { + moved = new File(vpath, id + "-renamed.json"); + mvv.renameTo(moved); + } + File mvt = new File(vpath, id + ".json"); + vpath.mkdirs(); + if (TaskWindow.getInstance() + .addTask(new FileDownloadTask(vurl + id + ".json", IOUtils.tryGetCanonicalFile(mvt)).setTag(id + ".json")) + .start()) { + if (moved != null) + moved.delete(); + return true; + } else { + mvt.delete(); + if (moved != null) + moved.renameTo(mvt); + return false; + } + } + + @Override + public Observable getRemoteVersions() { + return NetUtils.getRx(profile.getDownloadType().getProvider().getVersionsListDownloadURL()) + .map(r -> C.gson.fromJson(r, MinecraftRemoteVersions.class)) + .filter(r -> r != null && r.versions != null) + .flatMap(r -> Observable.from(r.versions)); + } +} diff --git a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/InstallerPanel.form b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/InstallerPanel.form new file mode 100644 index 000000000..a1a14ea5e --- /dev/null +++ b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/InstallerPanel.form @@ -0,0 +1,85 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/InstallerPanel.java b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/InstallerPanel.java new file mode 100644 index 000000000..f101315f6 --- /dev/null +++ b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/InstallerPanel.java @@ -0,0 +1,168 @@ +/* + * Hello Minecraft! Launcher. + * Copyright (C) 2013 huangyuhui + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see {http://www.gnu.org/licenses/}. + */ +package org.jackhuang.hellominecraft.launcher.views; + +import java.util.List; +import javax.swing.JTable; +import javax.swing.table.DefaultTableModel; +import org.jackhuang.hellominecraft.C; +import org.jackhuang.hellominecraft.launcher.settings.Settings; +import org.jackhuang.hellominecraft.launcher.utils.installers.InstallerType; +import org.jackhuang.hellominecraft.launcher.utils.installers.InstallerVersionList; +import org.jackhuang.hellominecraft.tasks.TaskRunnable; +import org.jackhuang.hellominecraft.tasks.TaskRunnableArg1; +import org.jackhuang.hellominecraft.tasks.TaskWindow; +import org.jackhuang.hellominecraft.tasks.communication.DefaultPreviousResult; +import org.jackhuang.hellominecraft.utils.MessageBox; +import org.jackhuang.hellominecraft.utils.StrUtils; +import org.jackhuang.hellominecraft.utils.SwingUtils; + +/** + * + * @author huangyuhui + */ +public class InstallerPanel extends javax.swing.JPanel { + + GameSettingsPanel gsp; + + /** + * Creates new form InstallerPanel + * + * @param gsp To get the minecraft version + * @param installerType load which installer + */ + public InstallerPanel(GameSettingsPanel gsp, InstallerType installerType) { + initComponents(); + + this.gsp = gsp; + id = installerType; + list = Settings.getInstance().getDownloadSource().getProvider().getInstallerByType(id); + ((DefaultTableModel) lstInstallers.getModel()).addRow(new Object[] {"hehe", "hehe"}); + } + + /** + * This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + btnInstall = new javax.swing.JButton(); + jScrollPane12 = new javax.swing.JScrollPane(); + lstInstallers = new javax.swing.JTable(); + btnRefresh = new javax.swing.JButton(); + + java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/jackhuang/hellominecraft/launcher/I18N"); // NOI18N + btnInstall.setText(bundle.getString("ui.button.install")); // NOI18N + btnInstall.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnInstallActionPerformed(evt); + } + }); + + lstInstallers.setModel(SwingUtils.makeDefaultTableModel(new String[]{C.I18N.getString("install.version"), C.I18N.getString("install.mcversion")}, + new Class[]{String.class, String.class}, new boolean[]{false, false})); + lstInstallers.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); + jScrollPane12.setViewportView(lstInstallers); + + btnRefresh.setText(bundle.getString("ui.button.refresh")); // NOI18N + btnRefresh.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnRefreshActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jScrollPane12, javax.swing.GroupLayout.DEFAULT_SIZE, 292, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(btnInstall, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(btnRefresh, javax.swing.GroupLayout.Alignment.TRAILING))) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane12, javax.swing.GroupLayout.DEFAULT_SIZE, 308, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addComponent(btnInstall) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnRefresh) + .addGap(0, 0, Short.MAX_VALUE)) + ); + }// //GEN-END:initComponents + + private void btnInstallActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInstallActionPerformed + downloadSelectedRow(); + }//GEN-LAST:event_btnInstallActionPerformed + + private void btnRefreshActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRefreshActionPerformed + refreshVersions(); + }//GEN-LAST:event_btnRefreshActionPerformed + + List versions; + InstallerVersionList list; + InstallerType id; + + void refreshVersions() { + if (TaskWindow.getInstance().addTask(new TaskRunnableArg1<>(C.i18n("install." + id.id + ".get_list"), list) + .registerPreviousResult(new DefaultPreviousResult<>(new String[] {gsp.getMinecraftVersionFormatted()}))) + .start()) + loadVersions(); + } + + public InstallerVersionList.InstallerVersion getVersion(int idx) { + return versions.get(idx); + } + + void downloadSelectedRow() { + int idx = lstInstallers.getSelectedRow(); + if (idx < 0 || idx >= versions.size()) { + MessageBox.Show(C.i18n("install.not_refreshed")); + return; + } + gsp.getProfile().getInstallerService().download(getVersion(idx), id).after(new TaskRunnable(this::refreshVersions)).run(); + } + + public void loadVersions() { + versions = loadVersions(list, lstInstallers); + } + + private List loadVersions(InstallerVersionList list, JTable table) { + DefaultTableModel model = (DefaultTableModel) table.getModel(); + String mcver = StrUtils.formatVersion(gsp.getMinecraftVersionFormatted()); + List ver = list.getVersions(mcver); + SwingUtils.clearDefaultTable(table); + if (ver != null) + for (InstallerVersionList.InstallerVersion v : ver) + model.addRow(new Object[] {v.selfVersion == null ? "null" : v.selfVersion, v.mcVersion == null ? "null" : v.mcVersion}); + return ver; + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton btnInstall; + private javax.swing.JButton btnRefresh; + private javax.swing.JScrollPane jScrollPane12; + private javax.swing.JTable lstInstallers; + // End of variables declaration//GEN-END:variables +} diff --git a/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/tasks/TaskObservable.java b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/tasks/TaskObservable.java new file mode 100644 index 000000000..d7c07d8cf --- /dev/null +++ b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/tasks/TaskObservable.java @@ -0,0 +1,44 @@ +/* + * Hello Minecraft! Launcher. + * Copyright (C) 2013 huangyuhui + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see {http://www.gnu.org/licenses/}. + */ +package org.jackhuang.hellominecraft.tasks; + +import rx.Observable; + +/** + * + * @author huangyuhui + */ +public class TaskObservable extends TaskInfo { + + private final Observable r; + + public TaskObservable(String info, Observable r) { + super(info); + this.r = r; + } + + public TaskObservable(Observable r) { + this("TaskObservable", r); + } + + @Override + public void executeTask() { + r.subscribe(t->{}); + } + +}