Implemented Task Manager API
This commit is contained in:
parent
a0adb9bb44
commit
d343bce350
|
@ -20,6 +20,7 @@ package the.bytecode.club.bytecodeviewer;
|
|||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.konloch.taskmanager.TaskManager;
|
||||
import me.konloch.kontainer.io.DiskReader;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
|
@ -150,6 +151,7 @@ public class BytecodeViewer
|
|||
private static final Thread PING_BACK = new Thread(new PingBack(), "Pingback");
|
||||
private static final Thread INSTALL_FAT_JAR = new Thread(new InstallFatJar(), "Install Fat-Jar");
|
||||
private static final Thread BOOT_CHECK = new Thread(new BootCheck(), "Boot Check");
|
||||
private static final TaskManager TASK_MANAGER = new TaskManager();
|
||||
|
||||
/**
|
||||
* Main startup
|
||||
|
@ -257,6 +259,9 @@ public class BytecodeViewer
|
|||
cleanup();
|
||||
}, "Shutdown Hook"));
|
||||
|
||||
//start the background task manager
|
||||
TASK_MANAGER.start();
|
||||
|
||||
//setup the viewer
|
||||
viewer.calledAfterLoad();
|
||||
|
||||
|
@ -580,6 +585,16 @@ public class BytecodeViewer
|
|||
Settings.addRecentPlugin(file);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Task Manager
|
||||
*
|
||||
* @return the global task manager object
|
||||
*/
|
||||
public static TaskManager getTaskManager()
|
||||
{
|
||||
return TASK_MANAGER;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a message to alert the user
|
||||
*
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
package the.bytecode.club.bytecodeviewer.api;
|
||||
|
||||
import com.konloch.taskmanager.TaskManager;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
||||
|
@ -164,6 +165,16 @@ public class BCV
|
|||
loader = new ClassNodeLoader();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the background Task Manager
|
||||
*
|
||||
* @return the global BCV background task manager
|
||||
*/
|
||||
public static TaskManager getTaskManager()
|
||||
{
|
||||
return BytecodeViewer.getTaskManager();
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to start a plugin from file.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue
Block a user