89 lines
2.8 KiB
Java
89 lines
2.8 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javax.baja.sys.BFacets
|
|
* javax.baja.sys.Context
|
|
* javax.baja.sys.Property
|
|
* javax.baja.sys.Sys
|
|
* javax.baja.sys.Type
|
|
* javax.baja.units.BDimension
|
|
* javax.baja.units.BUnit
|
|
*/
|
|
package com.tridium.alarm;
|
|
|
|
import com.tridium.alarm.db.memory.BMemoryAlarmDatabase;
|
|
import javax.baja.alarm.BAlarmDatabase;
|
|
import javax.baja.alarm.BAlarmService;
|
|
import javax.baja.sys.BFacets;
|
|
import javax.baja.sys.Context;
|
|
import javax.baja.sys.Property;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
import javax.baja.units.BDimension;
|
|
import javax.baja.units.BUnit;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public class BMemoryAlarmService
|
|
extends BAlarmService {
|
|
public static final Property capacity = BMemoryAlarmService.newProperty((int)0, (int)500, (BFacets)BFacets.makeInt((BUnit)BUnit.make((String)"records", (BDimension)BDimension.DEFAULT), (int)1, (int)5000));
|
|
public static final Type TYPE;
|
|
static /* synthetic */ Class class$com$tridium$alarm$BMemoryAlarmService;
|
|
|
|
public int getCapacity() {
|
|
return this.getInt(capacity);
|
|
}
|
|
|
|
public void setCapacity(int n) {
|
|
this.setInt(capacity, n, null);
|
|
}
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
protected BAlarmDatabase createAlarmDb() {
|
|
return new BMemoryAlarmDatabase();
|
|
}
|
|
|
|
public void changed(Property property, Context context) {
|
|
if (property.equals((Object)capacity)) {
|
|
BAlarmDatabase bAlarmDatabase = this.getAlarmDb();
|
|
if (bAlarmDatabase != null && bAlarmDatabase instanceof BMemoryAlarmDatabase) {
|
|
try {
|
|
((BMemoryAlarmDatabase)bAlarmDatabase).setCapacity(this.getCapacity());
|
|
}
|
|
catch (Exception exception) {
|
|
logger.error("Cannot change database capacity to " + this.getCapacity() + '.', (Throwable)exception);
|
|
}
|
|
}
|
|
} else {
|
|
super.changed(property, context);
|
|
}
|
|
}
|
|
|
|
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());
|
|
}
|
|
}
|
|
|
|
static {
|
|
Class clazz = class$com$tridium$alarm$BMemoryAlarmService;
|
|
if (clazz == null) {
|
|
clazz = class$com$tridium$alarm$BMemoryAlarmService = BMemoryAlarmService.class("[Lcom.tridium.alarm.BMemoryAlarmService;", false);
|
|
}
|
|
TYPE = Sys.loadType((Class)clazz);
|
|
}
|
|
}
|
|
|