157 lines
5.3 KiB
Java
157 lines
5.3 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javax.baja.sys.Action
|
|
* javax.baja.sys.BComponent
|
|
* javax.baja.sys.BValue
|
|
* javax.baja.sys.BajaRuntimeException
|
|
* javax.baja.sys.Context
|
|
* javax.baja.sys.ServiceNotFoundException
|
|
* javax.baja.sys.Sys
|
|
* javax.baja.sys.Type
|
|
* javax.baja.util.ICoalesceable
|
|
* javax.baja.util.IFuture
|
|
* javax.baja.util.Invocation
|
|
*/
|
|
package com.tridium.alarm;
|
|
|
|
import com.tridium.alarm.CoalesceUuidOnlyInvocation;
|
|
import javax.baja.alarm.BAlarmClass;
|
|
import javax.baja.alarm.BAlarmRecord;
|
|
import javax.baja.alarm.BAlarmService;
|
|
import javax.baja.sys.Action;
|
|
import javax.baja.sys.BComponent;
|
|
import javax.baja.sys.BValue;
|
|
import javax.baja.sys.BajaRuntimeException;
|
|
import javax.baja.sys.Context;
|
|
import javax.baja.sys.ServiceNotFoundException;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
import javax.baja.util.ICoalesceable;
|
|
import javax.baja.util.IFuture;
|
|
import javax.baja.util.Invocation;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public class AlarmClassRouteAlarmInvocation
|
|
extends Invocation
|
|
implements IFuture {
|
|
protected Exception exception;
|
|
protected boolean finished;
|
|
|
|
public static AlarmClassRouteAlarmInvocation make(BComponent bComponent, Action action, BAlarmRecord bAlarmRecord, Context context) {
|
|
try {
|
|
BAlarmService bAlarmService = (BAlarmService)Sys.getService((Type)BAlarmService.TYPE);
|
|
if (bAlarmService.getCoalesceAlarms()) {
|
|
return new AlarmClassRouteAlarmInvocation(bComponent, action, bAlarmRecord, context);
|
|
}
|
|
return new CoalesceUuidOnlyInvocation(bComponent, action, bAlarmRecord, context);
|
|
}
|
|
catch (ServiceNotFoundException serviceNotFoundException) {
|
|
return new AlarmClassRouteAlarmInvocation(bComponent, action, bAlarmRecord, context);
|
|
}
|
|
}
|
|
|
|
public boolean equals(Object object) {
|
|
if (object instanceof AlarmClassRouteAlarmInvocation) {
|
|
AlarmClassRouteAlarmInvocation alarmClassRouteAlarmInvocation = (AlarmClassRouteAlarmInvocation)((Object)object);
|
|
if (this.argument != null) {
|
|
boolean bl = false;
|
|
if (this.instance == alarmClassRouteAlarmInvocation.instance && this.action == alarmClassRouteAlarmInvocation.action && ((BAlarmRecord)this.argument).getUuid().equals((Object)((BAlarmRecord)alarmClassRouteAlarmInvocation.argument).getUuid())) {
|
|
bl = true;
|
|
}
|
|
return bl;
|
|
}
|
|
boolean bl = false;
|
|
if (this.instance == alarmClassRouteAlarmInvocation.instance && this.action == alarmClassRouteAlarmInvocation.action) {
|
|
bl = true;
|
|
}
|
|
return bl;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public ICoalesceable coalesce(ICoalesceable iCoalesceable) {
|
|
this.finished = true;
|
|
return iCoalesceable;
|
|
}
|
|
|
|
/*
|
|
* WARNING - Removed back jump from a try to a catch block - possible behaviour change.
|
|
* Enabled aggressive block sorting
|
|
* Enabled unnecessary exception pruning
|
|
* Enabled aggressive exception aggregation
|
|
*/
|
|
public void run() throws BajaRuntimeException {
|
|
try {
|
|
try {
|
|
if (this.action != BAlarmClass.routeAlarm) {
|
|
super.run();
|
|
Object var2_1 = null;
|
|
this.finished = true;
|
|
return;
|
|
}
|
|
((BAlarmClass)this.instance).doRouteAlarm((BAlarmRecord)this.argument);
|
|
}
|
|
catch (Exception exception) {
|
|
if (exception instanceof BajaRuntimeException) {
|
|
this.exception = (Exception)((BajaRuntimeException)exception).getCause();
|
|
throw (BajaRuntimeException)exception;
|
|
}
|
|
this.exception = exception;
|
|
throw new BajaRuntimeException((Throwable)exception);
|
|
}
|
|
}
|
|
catch (Throwable throwable) {
|
|
Object var2_2 = null;
|
|
this.finished = true;
|
|
throw throwable;
|
|
}
|
|
{
|
|
Object var2_3 = null;
|
|
this.finished = true;
|
|
return;
|
|
}
|
|
}
|
|
|
|
public boolean isFinished() {
|
|
return this.finished;
|
|
}
|
|
|
|
public boolean success() throws Exception {
|
|
if (!this.finished) {
|
|
throw new Exception("Invocation not finished");
|
|
}
|
|
boolean bl = false;
|
|
if (this.exception == null) {
|
|
bl = true;
|
|
}
|
|
return bl;
|
|
}
|
|
|
|
public Exception getException() {
|
|
return this.exception;
|
|
}
|
|
|
|
private final /* synthetic */ void this() {
|
|
this.exception = null;
|
|
this.finished = false;
|
|
}
|
|
|
|
public AlarmClassRouteAlarmInvocation(BAlarmClass bAlarmClass, BAlarmRecord bAlarmRecord, Context context) {
|
|
this(bAlarmClass, BAlarmClass.routeAlarm, bAlarmRecord, context);
|
|
}
|
|
|
|
public AlarmClassRouteAlarmInvocation(BComponent bComponent, Action action, BAlarmRecord bAlarmRecord, Context context) {
|
|
super(bComponent, action, (BValue)bAlarmRecord, context);
|
|
this.this();
|
|
if (bAlarmRecord != null) {
|
|
this.hashCode ^= bAlarmRecord.getUuid().hashCode();
|
|
}
|
|
this.finished = false;
|
|
}
|
|
}
|
|
|