163 lines
7.0 KiB
Java
163 lines
7.0 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javax.baja.nre.util.Array
|
|
* javax.baja.util.Lexicon
|
|
*/
|
|
package com.tridium.install;
|
|
|
|
import com.tridium.install.BDaemonPlatform;
|
|
import com.tridium.install.BDependency;
|
|
import com.tridium.install.BVersion;
|
|
import com.tridium.install.part.BNrePart;
|
|
import com.tridium.install.part.BOsPart;
|
|
import com.tridium.install.part.BPart;
|
|
import com.tridium.platform.daemon.BDaemonSession;
|
|
import com.tridium.platform.daemon.BStationSurrogate;
|
|
import com.tridium.platform.daemon.task.CancelableDaemonSessionTask;
|
|
import com.tridium.platform.daemon.task.DaemonSessionTask;
|
|
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
|
import java.net.SocketException;
|
|
import javax.baja.nre.util.Array;
|
|
import javax.baja.platform.ICancelHint;
|
|
import javax.baja.util.Lexicon;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public class DaemonPlatformUtil {
|
|
private static final BDependency fixedNre = new BDependency("nre-core-qnx-ppc", new BVersion(null, "3.0.103"), BNrePart.TYPE.getTypeSpec());
|
|
static /* synthetic */ Class class$com$tridium$platform$daemon$BStationSurrogate;
|
|
|
|
/*
|
|
* Enabled aggressive block sorting
|
|
* Enabled unnecessary exception pruning
|
|
* Enabled aggressive exception aggregation
|
|
*/
|
|
public static void doExtraStationShutdownTasks(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener, ICancelHint iCancelHint) throws Exception {
|
|
Object var11_19;
|
|
Object object2;
|
|
BOsPart bOsPart = bDaemonPlatform.getOsPart();
|
|
if (!bOsPart.getPartName().startsWith("qnx")) return;
|
|
BNrePart bNrePart = bDaemonPlatform.getNrePart();
|
|
if (!bNrePart.isNull()) {
|
|
if (((BPart)bNrePart).meets(fixedNre)) return;
|
|
}
|
|
if (daemonSessionTaskListener == null) {
|
|
daemonSessionTaskListener = DaemonSessionTaskListener.NULL_TASK_LISTENER;
|
|
}
|
|
BDaemonSession bDaemonSession = bDaemonPlatform.getDaemonSession();
|
|
String string = bDaemonSession.getHostProperties().getSessionTimestamp();
|
|
Lexicon lexicon = Lexicon.make((String)"platform");
|
|
Class clazz = class$com$tridium$platform$daemon$BStationSurrogate;
|
|
if (clazz == null) {
|
|
clazz = class$com$tridium$platform$daemon$BStationSurrogate = DaemonPlatformUtil.class("[Lcom.tridium.platform.daemon.BStationSurrogate;", false);
|
|
}
|
|
Array array = new Array(clazz);
|
|
DaemonSessionTask daemonSessionTask = new DaemonSessionTask(lexicon, "DaemonPlatformUtil.settingAutoStart.title", "DaemonPlatformUtil.settingAutoStart.message");
|
|
daemonSessionTaskListener.taskStarted(daemonSessionTask);
|
|
try {
|
|
object2 = BStationSurrogate.makeAll(bDaemonSession);
|
|
int n = 0;
|
|
while (n < ((BStationSurrogate[])object2).length) {
|
|
DaemonPlatformUtil.checkCanceled(iCancelHint);
|
|
if (object2[n].getIsAutoStart()) {
|
|
object2[n].updateSettings(false, object2[n].getIsAutoRestart());
|
|
array.add((Object)object2[n]);
|
|
}
|
|
++n;
|
|
}
|
|
var11_19 = null;
|
|
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
|
}
|
|
catch (Throwable throwable) {
|
|
Object var11_18 = null;
|
|
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
|
throw throwable;
|
|
}
|
|
{
|
|
Object var17_23;
|
|
daemonSessionTask = new DaemonSessionTask(lexicon, "DaemonPlatformUtil.sendingReboot.title", "DaemonPlatformUtil.sendingReboot.message");
|
|
daemonSessionTaskListener.taskStarted(daemonSessionTask);
|
|
try {
|
|
if (!bDaemonSession.sendRebootRequest(false)) {
|
|
DaemonPlatformUtil.checkCanceled(iCancelHint);
|
|
bDaemonSession.sendForceRebootRequest();
|
|
}
|
|
var17_23 = null;
|
|
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
|
daemonSessionTask = new CancelableDaemonSessionTask(lexicon, "DaemonPlatformUtil.reconnecting.title", "DaemonPlatformUtil.reconnecting.message", iCancelHint);
|
|
daemonSessionTaskListener.taskStarted(daemonSessionTask);
|
|
}
|
|
catch (Throwable throwable) {
|
|
Object var17_22 = null;
|
|
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
|
throw throwable;
|
|
}
|
|
try {
|
|
bDaemonSession.getHostProperties().reset();
|
|
while (true) {
|
|
DaemonPlatformUtil.checkCanceled(iCancelHint);
|
|
try {
|
|
bDaemonSession.reloadHostProperties(15000);
|
|
if (bDaemonSession.getHostProperties().getSessionTimestamp().equals(string)) continue;
|
|
daemonSessionTask.setMessage(lexicon.getText("DaemonPlatformUtil.reconnecting.successMessage"));
|
|
daemonSessionTaskListener.taskUpdated(daemonSessionTask);
|
|
}
|
|
catch (SocketException socketException) {
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
var17_23 = null;
|
|
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
|
}
|
|
catch (Throwable throwable) {
|
|
var17_23 = null;
|
|
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
|
throw throwable;
|
|
}
|
|
var11_19 = null;
|
|
daemonSessionTask = new DaemonSessionTask(lexicon, "DaemonPlatformUtil.restoringAutoStart.title", "DaemonPlatformUtil.restoringAutoStart.message");
|
|
daemonSessionTaskListener.taskStarted(daemonSessionTask);
|
|
}
|
|
try {
|
|
int n = 0;
|
|
while (n < array.size()) {
|
|
BStationSurrogate bStationSurrogate = (BStationSurrogate)((Object)array.get(n));
|
|
bStationSurrogate.updateSettings(true, bStationSurrogate.getIsAutoRestart());
|
|
++n;
|
|
}
|
|
Object var13_15 = null;
|
|
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
|
return;
|
|
}
|
|
catch (Throwable object2) {
|
|
Object var13_14 = null;
|
|
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
|
throw object2;
|
|
}
|
|
}
|
|
|
|
private static final void checkCanceled(ICancelHint iCancelHint) {
|
|
if (iCancelHint != null && iCancelHint.isCanceled()) {
|
|
throw new ICancelHint.CanceledException();
|
|
}
|
|
}
|
|
|
|
static /* synthetic */ Class class(String string, boolean bl) {
|
|
try {
|
|
Class<?> clazz = Class.forName(string);
|
|
if (!bl) {
|
|
clazz = clazz.getComponentType();
|
|
}
|
|
return clazz;
|
|
}
|
|
catch (ClassNotFoundException classNotFoundException) {
|
|
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
|
}
|
|
}
|
|
}
|
|
|