Launcher/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java

614 lines
22 KiB
Java
Raw Normal View History

package pro.gravit.launchserver;
2018-09-17 10:07:32 +03:00
2019-06-03 10:58:10 +03:00
import java.io.BufferedReader;
import java.io.IOException;
import java.lang.ProcessBuilder.Redirect;
import java.lang.reflect.InvocationTargetException;
import java.nio.file.DirectoryStream;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.security.InvalidAlgorithmParameterException;
2019-06-03 10:58:10 +03:00
import java.security.KeyPair;
import java.security.NoSuchAlgorithmException;
import java.security.interfaces.ECPrivateKey;
import java.security.interfaces.ECPublicKey;
2019-06-03 10:58:10 +03:00
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.InvalidKeySpecException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.Timer;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.zip.CRC32;
import org.bouncycastle.crypto.util.PrivateKeyFactory;
import org.bouncycastle.operator.OperatorCreationException;
2019-06-03 10:58:10 +03:00
import pro.gravit.launcher.Launcher;
import pro.gravit.launcher.NeedGarbageCollection;
import pro.gravit.launcher.hasher.HashedDir;
import pro.gravit.launcher.managers.ConfigManager;
import pro.gravit.launcher.managers.GarbageManager;
import pro.gravit.launcher.modules.events.ClosePhase;
2019-06-03 10:58:10 +03:00
import pro.gravit.launcher.profiles.ClientProfile;
import pro.gravit.launchserver.auth.AuthProviderPair;
import pro.gravit.launchserver.binary.EXEL4JLauncherBinary;
import pro.gravit.launchserver.binary.EXELauncherBinary;
import pro.gravit.launchserver.binary.JARLauncherBinary;
import pro.gravit.launchserver.binary.LauncherBinary;
import pro.gravit.launchserver.binary.ProguardConf;
import pro.gravit.launchserver.binary.SimpleEXELauncherBinary;
import pro.gravit.launchserver.config.LaunchServerConfig;
import pro.gravit.launchserver.config.LaunchServerRuntimeConfig;
2019-08-31 15:44:43 +03:00
import pro.gravit.launchserver.manangers.CertificateManager;
import pro.gravit.launchserver.manangers.MirrorManager;
import pro.gravit.launchserver.manangers.ReconfigurableManager;
import pro.gravit.launchserver.manangers.SessionManager;
import pro.gravit.launchserver.manangers.hook.AuthHookManager;
import pro.gravit.launchserver.manangers.hook.BuildHookManager;
import pro.gravit.launchserver.modules.events.LaunchServerFullInitEvent;
import pro.gravit.launchserver.modules.events.LaunchServerInitPhase;
import pro.gravit.launchserver.modules.events.LaunchServerPostInitPhase;
import pro.gravit.launchserver.modules.events.NewLaunchServerInstanceEvent;
import pro.gravit.launchserver.modules.impl.LaunchServerModulesManager;
import pro.gravit.launchserver.socket.handlers.NettyServerSocketHandler;
2019-08-31 15:44:43 +03:00
import pro.gravit.utils.command.Command;
import pro.gravit.utils.command.CommandHandler;
import pro.gravit.utils.command.SubCommand;
2019-06-03 10:58:10 +03:00
import pro.gravit.utils.helper.CommonHelper;
import pro.gravit.utils.helper.IOHelper;
import pro.gravit.utils.helper.JVMHelper;
import pro.gravit.utils.helper.LogHelper;
2018-09-17 10:07:32 +03:00
public final class LaunchServer implements Runnable, AutoCloseable, Reconfigurable {
public enum ReloadType
{
NO_AUTH,
NO_COMPONENTS,
FULL
}
public enum LaunchServerEnv
{
TEST,
DEV,
DEBUG,
PRODUCTION
}
public interface LaunchServerConfigManager
{
LaunchServerConfig readConfig() throws IOException;
LaunchServerRuntimeConfig readRuntimeConfig() throws IOException;
void writeConfig(LaunchServerConfig config) throws IOException;
void writeRuntimeConfig(LaunchServerRuntimeConfig config) throws IOException;
}
public void reload(ReloadType type) throws Exception {
config.close(type);
AuthProviderPair[] pairs = null;
if(type.equals(ReloadType.NO_AUTH))
{
pairs = config.auth;
}
LogHelper.info("Reading LaunchServer config file");
config = launchServerConfigManager.readConfig();
config.setLaunchServer(this);
if(type.equals(ReloadType.NO_AUTH))
{
config.auth = pairs;
}
config.verify();
config.init(type);
if (type.equals(ReloadType.FULL) && config.components != null) {
LogHelper.debug("PreInit components");
config.components.forEach((k, v) -> {
LogHelper.subDebug("PreInit component %s", k);
v.preInit(this);
});
LogHelper.debug("PreInit components successful");
LogHelper.debug("Init components");
config.components.forEach((k, v) -> {
LogHelper.subDebug("Init component %s", k);
registerObject("component.".concat(k), v);
v.init(this);
});
LogHelper.debug("Init components successful");
LogHelper.debug("PostInit components");
config.components.forEach((k, v) -> {
LogHelper.subDebug("PostInit component %s", k);
v.postInit(this);
});
LogHelper.debug("PostInit components successful");
}
}
@Override
public Map<String, Command> getCommands() {
Map<String, Command> commands = new HashMap<>();
SubCommand reload = new SubCommand() {
@Override
public void invoke(String... args) throws Exception {
if(args.length == 0)
{
reload(ReloadType.FULL);
return;
}
switch (args[0])
{
case "full":
reload(ReloadType.FULL);
break;
case "no_auth":
reload(ReloadType.NO_AUTH);
break;
case "no_components":
reload(ReloadType.NO_COMPONENTS);
break;
default:
reload(ReloadType.FULL);;
break;
}
}
};
commands.put("reload", reload);
return commands;
}
2018-09-22 17:33:00 +03:00
2018-09-17 10:07:32 +03:00
private final class ProfilesFileVisitor extends SimpleFileVisitor<Path> {
private final Collection<ClientProfile> result;
2018-09-17 10:07:32 +03:00
private ProfilesFileVisitor(Collection<ClientProfile> result) {
2018-09-17 10:07:32 +03:00
this.result = result;
}
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
LogHelper.info("Syncing '%s' profile", IOHelper.getFileName(file));
// Read profile
ClientProfile profile;
try (BufferedReader reader = IOHelper.newReader(file)) {
2019-04-20 01:03:06 +03:00
profile = Launcher.gsonManager.gson.fromJson(reader, ClientProfile.class);
2018-09-17 10:07:32 +03:00
}
profile.verify();
// Add SIGNED profile to result list
result.add(profile);
2018-09-17 10:07:32 +03:00
return super.visitFile(file, attrs);
}
}
2018-09-22 17:33:00 +03:00
2018-09-17 10:07:32 +03:00
// Constant paths
2018-10-13 11:01:10 +03:00
2018-09-17 10:07:32 +03:00
public final Path dir;
public final LaunchServerEnv env;
2019-01-15 06:35:39 +03:00
public final Path launcherLibraries;
2019-04-03 16:27:40 +03:00
public final Path launcherLibrariesCompile;
2019-03-15 17:32:01 +03:00
public final Path caCertFile;
public final Path caKeyFile;
public final Path serverCertFile;
public final Path serverKeyFile;
2018-09-17 10:07:32 +03:00
public final Path updatesDir;
2019-01-15 06:35:39 +03:00
public final LaunchServerConfigManager launchServerConfigManager;
//public static LaunchServer server = null;
2018-10-13 11:01:10 +03:00
2018-09-17 10:07:32 +03:00
public final Path profilesDir;
// Server config
2018-10-13 11:01:10 +03:00
public LaunchServerConfig config;
2019-04-12 00:58:45 +03:00
public LaunchServerRuntimeConfig runtime;
2018-09-17 10:07:32 +03:00
2018-10-13 11:01:10 +03:00
public final ECPublicKey publicKey;
2018-10-13 11:01:10 +03:00
public final ECPrivateKey privateKey;
2018-09-17 10:07:32 +03:00
// Launcher binary
2018-10-13 11:01:10 +03:00
public final JARLauncherBinary launcherBinary;
2018-10-13 11:01:10 +03:00
public Class<? extends LauncherBinary> launcherEXEBinaryClass;
2018-09-17 10:07:32 +03:00
public final LauncherBinary launcherEXEBinary;
// HWID ban + anti-brutforce
2018-10-13 11:01:10 +03:00
2018-09-17 10:07:32 +03:00
public final SessionManager sessionManager;
2018-12-29 13:00:50 +03:00
2018-12-31 10:51:49 +03:00
public final AuthHookManager authHookManager;
2018-09-17 10:07:32 +03:00
// Server
2018-10-13 11:01:10 +03:00
public final LaunchServerModulesManager modulesManager;
2018-09-17 10:07:32 +03:00
public final MirrorManager mirrorManager;
public final ReconfigurableManager reconfigurableManager;
2019-04-03 13:09:53 +03:00
public final ConfigManager configManager;
public final CertificateManager certificateManager;
2018-10-13 11:01:10 +03:00
2018-09-17 10:07:32 +03:00
public final BuildHookManager buildHookManager;
2018-10-13 11:01:10 +03:00
2018-09-17 10:07:32 +03:00
public final ProguardConf proguardConf;
2018-10-13 11:01:10 +03:00
2018-09-17 10:07:32 +03:00
public final CommandHandler commandHandler;
public final NettyServerSocketHandler nettyServerSocketHandler;
2018-09-22 17:33:00 +03:00
private final AtomicBoolean started = new AtomicBoolean(false);
2018-09-17 10:07:32 +03:00
// Updates and profiles
private volatile List<ClientProfile> profilesList;
public volatile Map<String, HashedDir> updatesDirMap;
2018-09-17 10:07:32 +03:00
2019-04-03 16:27:40 +03:00
public final Timer taskPool;
public static Class<? extends LauncherBinary> defaultLauncherEXEBinaryClass = null;
public static class LaunchServerDirectories
{
public Path updatesDir;
public Path profilesDir;
public Path dir;
public void collect()
{
if(updatesDir == null) updatesDir = dir.resolve("updates");
if(profilesDir == null) profilesDir = dir.resolve("profiles");
}
}
public LaunchServer(LaunchServerDirectories directories, LaunchServerEnv env, LaunchServerConfig config, LaunchServerRuntimeConfig runtimeConfig, LaunchServerConfigManager launchServerConfigManager, LaunchServerModulesManager modulesManager, ECPublicKey publicKey, ECPrivateKey privateKey, CommandHandler commandHandler) throws IOException, InvalidKeySpecException {
this.dir = directories.dir;
this.env = env;
this.config = config;
this.launchServerConfigManager = launchServerConfigManager;
this.modulesManager = modulesManager;
this.profilesDir = directories.profilesDir;
this.updatesDir = directories.updatesDir;
this.publicKey = publicKey;
this.privateKey = privateKey;
this.commandHandler = commandHandler;
this.runtime = runtimeConfig;
taskPool = new Timer("Timered task worker thread", true);
launcherLibraries = dir.resolve("launcher-libraries");
2019-03-15 17:32:01 +03:00
launcherLibrariesCompile = dir.resolve("launcher-libraries-compile");
config.setLaunchServer(this);
2018-09-17 10:07:32 +03:00
caCertFile = dir.resolve("ca.crt");
caKeyFile = dir.resolve("ca.key");
serverCertFile = dir.resolve("server.crt");
serverKeyFile = dir.resolve("server.key");
modulesManager.invokeEvent(new NewLaunchServerInstanceEvent(this));
2018-09-17 10:07:32 +03:00
// Print keypair fingerprints
2018-09-22 17:33:00 +03:00
// Load class bindings.
launcherEXEBinaryClass = defaultLauncherEXEBinaryClass;
2019-04-12 00:58:45 +03:00
runtime.verify();
2018-09-17 10:07:32 +03:00
config.verify();
if (config.components != null) {
LogHelper.debug("PreInit components");
config.components.forEach((k, v) -> {
LogHelper.subDebug("PreInit component %s", k);
v.preInit(this);
});
LogHelper.debug("PreInit components successful");
}
2018-09-17 10:07:32 +03:00
// build hooks, anti-brutforce and other
buildHookManager = new BuildHookManager();
proguardConf = new ProguardConf(this);
sessionManager = new SessionManager();
mirrorManager = new MirrorManager();
reconfigurableManager = new ReconfigurableManager();
2018-12-31 10:51:49 +03:00
authHookManager = new AuthHookManager();
2019-04-03 13:09:53 +03:00
configManager = new ConfigManager();
certificateManager = new CertificateManager();
//Generate or set new Certificate API
certificateManager.orgName = config.projectName;
if(config.certificate != null && config.certificate.enabled)
{
if(IOHelper.isFile(caCertFile) && IOHelper.isFile(caKeyFile))
{
certificateManager.ca = certificateManager.readCertificate(caCertFile);
certificateManager.caKey = certificateManager.readPrivateKey(caKeyFile);
}
else
{
try {
certificateManager.generateCA();
certificateManager.writeCertificate(caCertFile, certificateManager.ca);
certificateManager.writePrivateKey(caKeyFile, certificateManager.caKey);
} catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException | OperatorCreationException e) {
LogHelper.error(e);
}
}
if(IOHelper.isFile(serverCertFile) && IOHelper.isFile(serverKeyFile))
{
certificateManager.server = certificateManager.readCertificate(serverCertFile);
certificateManager.serverKey = certificateManager.readPrivateKey(serverKeyFile);
}
else
{
try {
KeyPair pair = certificateManager.generateKeyPair();
certificateManager.server = certificateManager.generateCertificate(config.projectName.concat(" Server"), pair.getPublic());
certificateManager.serverKey = PrivateKeyFactory.createKey(pair.getPrivate().getEncoded());
certificateManager.writePrivateKey(serverKeyFile, pair.getPrivate());
certificateManager.writeCertificate(serverCertFile, certificateManager.server);
} catch (InvalidAlgorithmParameterException | NoSuchAlgorithmException | OperatorCreationException e) {
LogHelper.error(e);
}
}
}
config.init(ReloadType.FULL);
registerObject("launchServer", this);
2018-09-17 10:07:32 +03:00
GarbageManager.registerNeedGC(sessionManager);
2018-09-22 17:33:00 +03:00
pro.gravit.launchserver.command.handler.CommandHandler.registerCommands(commandHandler, this);
2018-09-17 10:07:32 +03:00
// init modules
modulesManager.invokeEvent(new LaunchServerInitPhase(this));
2019-04-03 16:27:40 +03:00
if (config.components != null) {
LogHelper.debug("Init components");
2019-04-03 16:27:40 +03:00
config.components.forEach((k, v) -> {
LogHelper.subDebug("Init component %s", k);
v.init(this);
});
LogHelper.debug("Init components successful");
}
2018-09-17 10:07:32 +03:00
// Set launcher EXE binary
launcherBinary = new JARLauncherBinary(this);
launcherEXEBinary = binary();
2019-01-15 06:35:39 +03:00
2019-01-08 16:57:01 +03:00
launcherBinary.init();
launcherEXEBinary.init();
2018-09-17 10:07:32 +03:00
syncLauncherBinaries();
// Sync updates dir
if (!IOHelper.isDir(updatesDir))
2018-09-22 17:33:00 +03:00
Files.createDirectory(updatesDir);
2018-09-17 10:07:32 +03:00
syncUpdatesDir(null);
// Sync profiles dir
if (!IOHelper.isDir(profilesDir))
2018-09-22 17:33:00 +03:00
Files.createDirectory(profilesDir);
2018-09-17 10:07:32 +03:00
syncProfilesDir();
if (config.netty != null)
nettyServerSocketHandler = new NettyServerSocketHandler(this);
else
nettyServerSocketHandler = null;
2018-09-17 10:07:32 +03:00
// post init modules
modulesManager.invokeEvent(new LaunchServerPostInitPhase(this));
2019-04-03 16:27:40 +03:00
if (config.components != null) {
LogHelper.debug("PostInit components");
2019-04-03 16:27:40 +03:00
config.components.forEach((k, v) -> {
LogHelper.subDebug("PostInit component %s", k);
v.postInit(this);
});
LogHelper.debug("PostInit components successful");
}
2018-09-17 10:07:32 +03:00
}
private LauncherBinary binary() {
2019-05-15 14:11:22 +03:00
if (launcherEXEBinaryClass != null) {
try {
return launcherEXEBinaryClass.getConstructor(LaunchServer.class).newInstance(this);
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException | NoSuchMethodException | SecurityException e) {
LogHelper.error(e);
}
}
if(config.launch4j.alternative != null)
{
switch (config.launch4j.alternative) {
case "simple":
return new SimpleEXELauncherBinary(this);
case "no":
//None
break;
default:
LogHelper.warning("Alternative %s not found", config.launch4j.alternative);
break;
}
}
2019-01-15 06:35:39 +03:00
try {
Class.forName("net.sf.launch4j.Builder");
2018-12-26 16:17:47 +03:00
if (config.launch4j.enabled) return new EXEL4JLauncherBinary(this);
2019-01-15 06:35:39 +03:00
} catch (ClassNotFoundException ignored) {
LogHelper.warning("Launch4J isn't in classpath.");
}
2018-09-22 17:33:00 +03:00
return new EXELauncherBinary(this);
2018-09-17 10:07:32 +03:00
}
2018-10-13 11:01:10 +03:00
2018-09-17 10:07:32 +03:00
public void buildLauncherBinaries() throws IOException {
launcherBinary.build();
launcherEXEBinary.build();
}
public void close() throws Exception {
2018-09-17 10:07:32 +03:00
// Close handlers & providers
config.close(ReloadType.FULL);
modulesManager.invokeEvent(new ClosePhase());
2019-04-12 00:58:45 +03:00
LogHelper.info("Save LaunchServer runtime config");
launchServerConfigManager.writeRuntimeConfig(runtime);
2018-09-17 10:07:32 +03:00
// Print last message before death :(
LogHelper.info("LaunchServer stopped");
}
public List<ClientProfile> getProfiles() {
2018-09-17 10:07:32 +03:00
return profilesList;
}
public void setProfiles(List<ClientProfile> profilesList) {
this.profilesList = Collections.unmodifiableList(profilesList);
}
2018-10-13 11:01:10 +03:00
public HashedDir getUpdateDir(String name) {
2018-09-17 10:07:32 +03:00
return updatesDirMap.get(name);
}
2018-10-13 11:01:10 +03:00
public Set<Entry<String, HashedDir>> getUpdateDirs() {
2018-09-17 10:07:32 +03:00
return updatesDirMap.entrySet();
}
public void rebindNettyServerSocket() {
nettyServerSocketHandler.close();
CommonHelper.newThread("Netty Server Socket Thread", false, nettyServerSocketHandler).start();
}
2018-09-17 10:07:32 +03:00
@Override
public void run() {
if (started.getAndSet(true))
2018-09-22 17:33:00 +03:00
throw new IllegalStateException("LaunchServer has been already started");
2018-09-17 10:07:32 +03:00
// Add shutdown hook, then start LaunchServer
if (!this.env.equals(LaunchServerEnv.TEST)) {
JVMHelper.RUNTIME.addShutdownHook(CommonHelper.newThread(null, false, () -> {
try {
close();
} catch (Exception e) {
LogHelper.error(e);
}
}));
2019-05-15 14:11:22 +03:00
CommonHelper.newThread("Command Thread", true, commandHandler).start();
}
2019-04-03 16:27:40 +03:00
if (config.netty != null)
rebindNettyServerSocket();
modulesManager.fullInitializedLaunchServer(this);
modulesManager.invokeEvent(new LaunchServerFullInitEvent(this));
2018-09-17 10:07:32 +03:00
}
2018-10-13 11:01:10 +03:00
2018-09-17 10:07:32 +03:00
public void syncLauncherBinaries() throws IOException {
LogHelper.info("Syncing launcher binaries");
// Syncing launcher binary
LogHelper.info("Syncing launcher binary file");
if (!launcherBinary.sync()) LogHelper.warning("Missing launcher binary file");
// Syncing launcher EXE binary
LogHelper.info("Syncing launcher EXE binary file");
if (!launcherEXEBinary.sync() && config.launch4j.enabled)
LogHelper.warning("Missing launcher EXE binary file");
}
2018-09-22 17:33:00 +03:00
2018-10-13 11:01:10 +03:00
2018-09-17 10:07:32 +03:00
public void syncProfilesDir() throws IOException {
LogHelper.info("Syncing profiles dir");
List<ClientProfile> newProfies = new LinkedList<>();
2018-09-17 10:07:32 +03:00
IOHelper.walk(profilesDir, new ProfilesFileVisitor(newProfies), false);
// Sort and set new profiles
newProfies.sort(Comparator.comparing(a -> a));
2018-09-17 10:07:32 +03:00
profilesList = Collections.unmodifiableList(newProfies);
}
2018-09-22 17:33:00 +03:00
2018-10-13 11:01:10 +03:00
2018-09-17 10:07:32 +03:00
public void syncUpdatesDir(Collection<String> dirs) throws IOException {
LogHelper.info("Syncing updates dir");
Map<String, HashedDir> newUpdatesDirMap = new HashMap<>(16);
2018-09-17 10:07:32 +03:00
try (DirectoryStream<Path> dirStream = Files.newDirectoryStream(updatesDir)) {
for (final Path updateDir : dirStream) {
2018-09-17 10:07:32 +03:00
if (Files.isHidden(updateDir))
2018-09-22 17:33:00 +03:00
continue; // Skip hidden
2018-09-17 10:07:32 +03:00
// Resolve name and verify is dir
String name = IOHelper.getFileName(updateDir);
if (!IOHelper.isDir(updateDir)) {
2019-05-15 14:11:22 +03:00
if (!IOHelper.isFile(updateDir) && Arrays.asList(".jar", ".exe", ".hash").stream().noneMatch(e -> updateDir.toString().endsWith(e)))
LogHelper.warning("Not update dir: '%s'", name);
2018-09-17 10:07:32 +03:00
continue;
}
// Add from previous map (it's guaranteed to be non-null)
if (dirs != null && !dirs.contains(name)) {
HashedDir hdir = updatesDirMap.get(name);
2018-09-17 10:07:32 +03:00
if (hdir != null) {
newUpdatesDirMap.put(name, hdir);
continue;
}
}
// Sync and sign update dir
LogHelper.info("Syncing '%s' update dir", name);
HashedDir updateHDir = new HashedDir(updateDir, null, true, true);
newUpdatesDirMap.put(name, updateHDir);
2018-09-17 10:07:32 +03:00
}
}
updatesDirMap = Collections.unmodifiableMap(newUpdatesDirMap);
}
2019-01-15 06:35:39 +03:00
2019-01-04 14:32:16 +03:00
public void restart() {
2019-01-15 06:35:39 +03:00
ProcessBuilder builder = new ProcessBuilder();
if (config.startScript != null) builder.command(Collections.singletonList(config.startScript));
2019-01-15 06:35:39 +03:00
else throw new IllegalArgumentException("Please create start script and link it as startScript in config.");
2019-01-04 14:32:16 +03:00
builder.directory(this.dir.toFile());
builder.inheritIO();
builder.redirectErrorStream(true);
builder.redirectOutput(Redirect.PIPE);
try {
2019-01-15 06:35:39 +03:00
builder.start();
} catch (IOException e) {
LogHelper.error(e);
}
2019-01-04 14:32:16 +03:00
}
2019-04-03 16:27:40 +03:00
public void registerObject(String name, Object object) {
if (object instanceof Reconfigurable) {
2019-04-03 13:09:53 +03:00
reconfigurableManager.registerReconfigurable(name, (Reconfigurable) object);
}
2019-04-03 16:27:40 +03:00
if (object instanceof NeedGarbageCollection) {
2019-04-03 13:09:53 +03:00
GarbageManager.registerNeedGC((NeedGarbageCollection) object);
}
}
2019-05-15 14:11:22 +03:00
public void unregisterObject(String name, Object object) {
if (object instanceof Reconfigurable) {
reconfigurableManager.unregisterReconfigurable(name);
}
if (object instanceof NeedGarbageCollection) {
GarbageManager.unregisterNeedGC((NeedGarbageCollection) object);
}
}
2019-04-03 13:09:53 +03:00
2019-01-15 06:35:39 +03:00
public void fullyRestart() {
restart();
2019-01-04 14:32:16 +03:00
JVMHelper.RUNTIME.exit(0);
2019-01-15 06:35:39 +03:00
}
2018-09-17 10:07:32 +03:00
}