Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.shotbygun.shotmod.common.system;
- import com.shotbygun.shotmod.common.logger.Log;
- /**
- *
- * @author shotbygun
- */
- public class KillerDaemon extends RunnableSystem {
- private final RunnableSystem[] systemArray;
- public KillerDaemon(RunnableSystem[] systemArray) {
- this.systemArray = systemArray;
- }
- @Override
- public void run() {
- // This thread will be run only when shutting down
- // if all else non-daemon systems are shut down, we are not required
- // so we can die with the application before we can execute
- this.thread.setDaemon(true);
- try {
- Thread.sleep(6000);
- for(RunnableSystem system : systemArray) {
- system.interrupt();
- }
- } catch (Exception ex) {
- Log.log("shutdown", Log.LOGLEVEL_ERROR, this.getClass().getSimpleName(), "error while executing (pun intended)", ex);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment