From a3f58468f5dbc2d0a8263dcd45e1ea2265ce8339 Mon Sep 17 00:00:00 2001 From: Willem Date: Sun, 6 Feb 2022 15:49:32 +0100 Subject: [PATCH] Second version of JMX --- .../bassboonyd/BãßBȍőnCoffinOpenʸᴰ.java | 2 +- .../bassboonyd/BãßBȍőnEnumJmxKeyʸᴰ.java | 10 --- .../bassboonyd/BãßBȍőnEnumʸᴰ.java | 17 +---- .../bassboonyd/BãßBȍőnPackageInfoʸᴰ.java | 14 ++++ .../bassboonyd/DefaultAuthorInfoʸᴰ.java | 14 ++++ .../bassboonyd/DefaultClassInfoʸᴰ.java | 14 ++++ .../bassboonyd/DefaultPackageInfoʸᴰ.java | 10 +++ .../jmx/AbstractMBeanAttributeᴶᴹˣ.java | 24 +++++++ .../bassboonyd/jmx/BooleanAttributeᴶᴹˣ.java | 25 +++++++ .../{ => jmx}/BãßBȍőnEnumJmxʸᴰ.java | 65 +++++++++---------- .../jmx/BãßBȍőnMBeanAttributeTypeʸᴰ.java | 16 +++++ .../bassboonyd/jmx/GuageCounterᴶᴹˣ.java | 21 ++++++ .../bassboonyd/jmx/MBeanAttributeᴶᴹˣ.java | 17 +++++ .../bassboonyd/jmx/MBeanStoreKeyᴶᴹˣ.java | 13 ++++ .../bassboonyd/jmx/StringAttributeᴶᴹˣ.java | 25 +++++++ .../numberxd/base2t/Base2Terminator.java | 2 +- .../numberxd/base2t/glyph/BaseGlyphSet.java | 2 +- .../numberxd/base2t/part/T02PartBinary.java | 2 +- .../numberxd/base2t/part/T03PartTrit.java | 2 +- .../numberxd/base2t/part/T04PartQuad.java | 2 +- .../numberxd/base2t/part/T05PartPental.java | 2 +- .../numberxd/base2t/part/T06PartSeximal.java | 2 +- .../numberxd/base2t/part/T07PartPlanIt.java | 2 +- .../numberxd/base2t/part/T08PartOctal.java | 2 +- .../numberxd/base2t/part/T09PartNonary.java | 2 +- .../numberxd/base2t/part/T10PartDecimal.java | 2 +- .../base2t/part/T11PartUndecimal.java | 2 +- .../numberxd/base2t/part/T12PartUncial.java | 2 +- .../numberxd/base2t/part/T16PartHex.java | 2 +- .../numberxd/base2t/part/T20PartScore.java | 2 +- .../base2t/part/T60PartSexagesimal.java | 2 +- .../base2t/part/warp/TOSWarpCore.java | 60 +++++++++-------- 32 files changed, 272 insertions(+), 107 deletions(-) delete mode 100644 demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnEnumJmxKeyʸᴰ.java create mode 100644 demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnPackageInfoʸᴰ.java create mode 100644 demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/DefaultAuthorInfoʸᴰ.java create mode 100644 demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/DefaultClassInfoʸᴰ.java create mode 100644 demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/DefaultPackageInfoʸᴰ.java create mode 100644 demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/AbstractMBeanAttributeᴶᴹˣ.java create mode 100644 demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/BooleanAttributeᴶᴹˣ.java rename demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/{ => jmx}/BãßBȍőnEnumJmxʸᴰ.java (60%) create mode 100644 demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/BãßBȍőnMBeanAttributeTypeʸᴰ.java create mode 100644 demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/GuageCounterᴶᴹˣ.java create mode 100644 demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/MBeanAttributeᴶᴹˣ.java create mode 100644 demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/MBeanStoreKeyᴶᴹˣ.java create mode 100644 demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/StringAttributeᴶᴹˣ.java diff --git a/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnCoffinOpenʸᴰ.java b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnCoffinOpenʸᴰ.java index fbb4e084..70f6b5fd 100644 --- a/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnCoffinOpenʸᴰ.java +++ b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnCoffinOpenʸᴰ.java @@ -19,7 +19,7 @@ public interface BãßBȍőnCoffinOpenʸᴰ()); } - default void INIT_BOON(Object boon) { + default void BOON_INIT(Object boon) { try { for (Method m:boon.getClass().getMethods()) { if (m.isAnnotationPresent(BãßBȍőnInitMethodʸᴰ.class)) { diff --git a/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnEnumJmxKeyʸᴰ.java b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnEnumJmxKeyʸᴰ.java deleted file mode 100644 index 2edfadb1..00000000 --- a/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnEnumJmxKeyʸᴰ.java +++ /dev/null @@ -1,10 +0,0 @@ -package love.distributedrebirth.bassboonyd; - -/** - * Only use when no other keys are needed on instance enum. - */ -@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") -public enum BãßBȍőnEnumJmxKeyʸᴰ implements BãßBȍőnCoffinStoreKeyʸᴰ { - JMX, - ; -} diff --git a/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnEnumʸᴰ.java b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnEnumʸᴰ.java index da6421df..3979e6a2 100644 --- a/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnEnumʸᴰ.java +++ b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnEnumʸᴰ.java @@ -2,7 +2,7 @@ package love.distributedrebirth.bassboonyd; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") @BãßBȍőnAnnotationInfoʸᴰ(required = {BãßBȍőnClassInfoʸᴰ.class, BãßBȍőnAuthorInfoʸᴰ.class}) -public interface BãßBȍőnEnumʸᴰ { +public interface BãßBȍőnEnumʸᴰ extends DefaultAuthorInfoʸᴰ,DefaultClassInfoʸᴰ,DefaultPackageInfoʸᴰ { String name(); @@ -23,21 +23,6 @@ public interface BãßBȍőnEnumʸᴰ { } } - default String BãßClassNaam() { - return getClass().getAnnotation(BãßBȍőnClassInfoʸᴰ.class).name(); - } - - default String BãßClassPurpose() { - return getClass().getAnnotation(BãßBȍőnClassInfoʸᴰ.class).purpose(); - } - - default String BãßAuthorNaam() { - return getClass().getAnnotation(BãßBȍőnAuthorInfoʸᴰ.class).name(); - } - - default String BãßAuthorCopyright() { - return getClass().getAnnotation(BãßBȍőnAuthorInfoʸᴰ.class).copyright(); - } default String BȍőnNaamI18N() { return BãßClassNaam() + BãßBȍőnConstantsʸᴰ.STR_DOT + name(); diff --git a/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnPackageInfoʸᴰ.java b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnPackageInfoʸᴰ.java new file mode 100644 index 00000000..88e92426 --- /dev/null +++ b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnPackageInfoʸᴰ.java @@ -0,0 +1,14 @@ +package love.distributedrebirth.bassboonyd; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE}) +public @interface BãßBȍőnPackageInfoʸᴰ { + + String name(); +} diff --git a/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/DefaultAuthorInfoʸᴰ.java b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/DefaultAuthorInfoʸᴰ.java new file mode 100644 index 00000000..c5190604 --- /dev/null +++ b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/DefaultAuthorInfoʸᴰ.java @@ -0,0 +1,14 @@ +package love.distributedrebirth.bassboonyd; + +@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") +@BãßBȍőnAnnotationInfoʸᴰ(required = {BãßBȍőnAuthorInfoʸᴰ.class}) +public interface DefaultAuthorInfoʸᴰ { + + default String BãßAuthorNaam() { + return getClass().getAnnotation(BãßBȍőnAuthorInfoʸᴰ.class).name(); + } + + default String BãßAuthorCopyright() { + return getClass().getAnnotation(BãßBȍőnAuthorInfoʸᴰ.class).copyright(); + } +} diff --git a/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/DefaultClassInfoʸᴰ.java b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/DefaultClassInfoʸᴰ.java new file mode 100644 index 00000000..286b4650 --- /dev/null +++ b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/DefaultClassInfoʸᴰ.java @@ -0,0 +1,14 @@ +package love.distributedrebirth.bassboonyd; + +@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") +@BãßBȍőnAnnotationInfoʸᴰ(required = {BãßBȍőnClassInfoʸᴰ.class}) +public interface DefaultClassInfoʸᴰ { + + default String BãßClassNaam() { + return getClass().getAnnotation(BãßBȍőnClassInfoʸᴰ.class).name(); + } + + default String BãßClassPurpose() { + return getClass().getAnnotation(BãßBȍőnClassInfoʸᴰ.class).purpose(); + } +} diff --git a/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/DefaultPackageInfoʸᴰ.java b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/DefaultPackageInfoʸᴰ.java new file mode 100644 index 00000000..bbc5bb75 --- /dev/null +++ b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/DefaultPackageInfoʸᴰ.java @@ -0,0 +1,10 @@ +package love.distributedrebirth.bassboonyd; + +@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") +@BãßBȍőnAnnotationInfoʸᴰ(required = {BãßBȍőnPackageInfoʸᴰ.class}) +public interface DefaultPackageInfoʸᴰ { + + default String BãßPackageNaam() { + return getClass().getAnnotation(BãßBȍőnPackageInfoʸᴰ.class).name(); + } +} diff --git a/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/AbstractMBeanAttributeᴶᴹˣ.java b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/AbstractMBeanAttributeᴶᴹˣ.java new file mode 100644 index 00000000..2e495c55 --- /dev/null +++ b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/AbstractMBeanAttributeᴶᴹˣ.java @@ -0,0 +1,24 @@ +package love.distributedrebirth.bassboonyd.jmx; + +import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; + +@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") +abstract public class AbstractMBeanAttributeᴶᴹˣ implements MBeanAttributeᴶᴹˣ { + private final String name; + private final String description; + + public AbstractMBeanAttributeᴶᴹˣ(String name, String description) { + this.name = name; + this.description = description; + } + + @Override + public String getName() { + return name; + } + + @Override + public String getDescription() { + return description; + } +} \ No newline at end of file diff --git a/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/BooleanAttributeᴶᴹˣ.java b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/BooleanAttributeᴶᴹˣ.java new file mode 100644 index 00000000..75ef413f --- /dev/null +++ b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/BooleanAttributeᴶᴹˣ.java @@ -0,0 +1,25 @@ +package love.distributedrebirth.bassboonyd.jmx; + +import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; + +@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") +@BãßBȍőnMBeanAttributeTypeʸᴰ(Boolean.class) +public class BooleanAttributeᴶᴹˣ extends AbstractMBeanAttributeᴶᴹˣ { + private Boolean value; + + public BooleanAttributeᴶᴹˣ(String name, String description) { + super(name, description); + } + + public void setValueBoolean(Boolean value) { + this.value = value; + } + + public Boolean getValueBoolean() { + return value; + } + + public Object getValue() { + return value; + } +} diff --git a/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnEnumJmxʸᴰ.java b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/BãßBȍőnEnumJmxʸᴰ.java similarity index 60% rename from demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnEnumJmxʸᴰ.java rename to demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/BãßBȍőnEnumJmxʸᴰ.java index 31034551..6d8bbf5f 100644 --- a/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/BãßBȍőnEnumJmxʸᴰ.java +++ b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/BãßBȍőnEnumJmxʸᴰ.java @@ -1,4 +1,4 @@ -package love.distributedrebirth.bassboonyd; +package love.distributedrebirth.bassboonyd.jmx; import java.lang.management.ManagementFactory; import java.util.List; @@ -18,58 +18,51 @@ import javax.management.MBeanServer; import javax.management.ObjectName; import javax.management.ReflectionException; +import love.distributedrebirth.bassboonyd.BãßBȍőnAnnotationInfoʸᴰ; +import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; +import love.distributedrebirth.bassboonyd.BãßBȍőnClassInfoʸᴰ; +import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ; +import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinStoreKeyʸᴰ; +import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinStoreʸᴰ; +import love.distributedrebirth.bassboonyd.BãßBȍőnEnumʸᴰ; + @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") @BãßBȍőnAnnotationInfoʸᴰ(required = {BãßBȍőnClassInfoʸᴰ.class, BãßBȍőnAuthorInfoʸᴰ.class}) public interface BãßBȍőnEnumJmxʸᴰ extends BãßBȍőnEnumʸᴰ,BãßBȍőnCoffinStoreʸᴰ { @SuppressWarnings("unchecked") - default void initJmx(K key) { + default void BȍőnJmxInit(K key) { BãßBȍőnCoffinOpenʸᴰ coffin = BãßBȍőnCoffinOpenʸᴰ.class.cast(GET_BBC()); coffin.PUT_MAP(key); try { MBeanServer server = ManagementFactory.getPlatformMBeanServer(); - ObjectName objectName1 = new ObjectName(BȍőnNaamI18N() + ":name=counters"); + ObjectName objectName1 = new ObjectName(BãßPackageNaam() + ":name=" + BãßClassNaam()); server.registerMBean(new GuageDynamicMBean(GET_BBC().GET_MAP_OBJ(key)), objectName1); } catch (Exception e) { throw new RuntimeException(e); } } - default GuageCounter BȍőnInitGuage(K key, String name) { - return BȍőnInitGuage(key,name,""); + default GuageCounterᴶᴹˣ BȍőnJmxInitGuageCounter(K key, String name) { + return BȍőnJmxInitGuageCounter(key,name,""); } - default GuageCounter BȍőnInitGuage(K key, String name, String description) { - GuageCounter result = new GuageCounter(name, description); + default GuageCounterᴶᴹˣ BȍőnJmxInitGuageCounter(K key, String name, String description) { + GuageCounterᴶᴹˣ result = new GuageCounterᴶᴹˣ(name, description); GET_BBC().GET_MAP_OBJ(key).put(name, result); return result; } - public class GuageCounter { - private volatile long counter; - private final String name; - private final String description; - - public GuageCounter(String name, String description) { - this.name = name; - this.description = description; - } - - public void increment() { - counter++; - } - - public long getCounter() { - return counter; - } - - public String getName() { - return name; - } - - public String getDescription() { - return description; - } + default StringAttributeᴶᴹˣ BȍőnJmxInitStringAttribute(K key, String name, String description) { + StringAttributeᴶᴹˣ result = new StringAttributeᴶᴹˣ(name, description); + GET_BBC().GET_MAP_OBJ(key).put(name, result); + return result; + } + + default BooleanAttributeᴶᴹˣ BȍőnJmxInitBooleanAttribute(K key, String name, String description) { + BooleanAttributeᴶᴹˣ result = new BooleanAttributeᴶᴹˣ(name, description); + GET_BBC().GET_MAP_OBJ(key).put(name, result); + return result; } class GuageDynamicMBean implements DynamicMBean { @@ -86,8 +79,8 @@ public interface BãßBȍőnEnumJmxʸᴰ keySet = guages.keySet().stream().collect(Collectors.toList()); for (int i = 0; i < dAttributes.length; i++) { String name = keySet.get(i); - GuageCounter gc = GuageCounter.class.cast(guages.get(name)); - dAttributes[i] = new MBeanAttributeInfo(gc.getName(), Long.class.getSimpleName(), + MBeanAttributeᴶᴹˣ gc = MBeanAttributeᴶᴹˣ.class.cast(guages.get(name)); + dAttributes[i] = new MBeanAttributeInfo(gc.getName(), gc.BãßValueType().getSimpleName(), gc.getDescription(), true, false, false); } return new MBeanInfo(this.getClass().getName(), null, dAttributes, null, null, @@ -96,8 +89,8 @@ public interface BãßBȍőnEnumJmxʸᴰ value(); +} diff --git a/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/GuageCounterᴶᴹˣ.java b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/GuageCounterᴶᴹˣ.java new file mode 100644 index 00000000..6ec575b1 --- /dev/null +++ b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/GuageCounterᴶᴹˣ.java @@ -0,0 +1,21 @@ +package love.distributedrebirth.bassboonyd.jmx; + +import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; + +@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") +@BãßBȍőnMBeanAttributeTypeʸᴰ(Long.class) +public class GuageCounterᴶᴹˣ extends AbstractMBeanAttributeᴶᴹˣ { + private volatile long counter; + + public GuageCounterᴶᴹˣ(String name, String description) { + super(name, description); + } + + public void increment() { + counter++; + } + + public Object getValue() { + return Long.valueOf(counter); + } +} diff --git a/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/MBeanAttributeᴶᴹˣ.java b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/MBeanAttributeᴶᴹˣ.java new file mode 100644 index 00000000..e20053b4 --- /dev/null +++ b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/MBeanAttributeᴶᴹˣ.java @@ -0,0 +1,17 @@ +package love.distributedrebirth.bassboonyd.jmx; + +import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; + +@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") +public interface MBeanAttributeᴶᴹˣ { + + default Class BãßValueType() { + return getClass().getAnnotation(BãßBȍőnMBeanAttributeTypeʸᴰ.class).value(); + } + + Object getValue(); + + String getName(); + + String getDescription(); +} \ No newline at end of file diff --git a/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/MBeanStoreKeyᴶᴹˣ.java b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/MBeanStoreKeyᴶᴹˣ.java new file mode 100644 index 00000000..6bb4729c --- /dev/null +++ b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/MBeanStoreKeyᴶᴹˣ.java @@ -0,0 +1,13 @@ +package love.distributedrebirth.bassboonyd.jmx; + +import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; +import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinStoreKeyʸᴰ; + +/** + * Only use when no other coffin keys are needed on instance or enum. + */ +@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") +public enum MBeanStoreKeyᴶᴹˣ implements BãßBȍőnCoffinStoreKeyʸᴰ { + JMX, + ; +} diff --git a/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/StringAttributeᴶᴹˣ.java b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/StringAttributeᴶᴹˣ.java new file mode 100644 index 00000000..d63771d7 --- /dev/null +++ b/demo4d-bassboonyd/src/main/love/distributedrebirth/bassboonyd/jmx/StringAttributeᴶᴹˣ.java @@ -0,0 +1,25 @@ +package love.distributedrebirth.bassboonyd.jmx; + +import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; + +@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") +@BãßBȍőnMBeanAttributeTypeʸᴰ(String.class) +public class StringAttributeᴶᴹˣ extends AbstractMBeanAttributeᴶᴹˣ { + private String value; + + public StringAttributeᴶᴹˣ(String name, String description) { + super(name, description); + } + + public void setValueString(String value) { + this.value = value; + } + + public String getValueString() { + return value; + } + + public Object getValue() { + return value; + } +} diff --git a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/Base2Terminator.java b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/Base2Terminator.java index c01e61ba..b691d7df 100644 --- a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/Base2Terminator.java +++ b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/Base2Terminator.java @@ -33,7 +33,7 @@ public enum Base2Terminator implements BãßBȍőnEnumInstanceʸᴰ GET_BBC() { return BBC; } private Base2Terminator() { - BBC.INIT_BOON(this); + BBC.BOON_INIT(this); } public int Bãß2ReadTong(InputStream input, List output) throws IOException { diff --git a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/glyph/BaseGlyphSet.java b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/glyph/BaseGlyphSet.java index 8eb68d80..76c4666b 100644 --- a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/glyph/BaseGlyphSet.java +++ b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/glyph/BaseGlyphSet.java @@ -85,6 +85,6 @@ public enum BaseGlyphSet implements BãßBȍőnGlyphSetʸᴰ { BBC.PUT_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.NUMBERS, numbers); BBC.PUT_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.HEXIMALS, hex); BBC.PUT_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.GEMATRIA, gematria); - BBC.INIT_BOON(this); + BBC.BOON_INIT(this); } } diff --git a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T02PartBinary.java b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T02PartBinary.java index 1fa16140..534e618b 100644 --- a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T02PartBinary.java +++ b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T02PartBinary.java @@ -21,6 +21,6 @@ public enum T02PartBinary implements BãßBȍőnPartʸᴰ { BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.DIAL_TONE, dialTone); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_KEY, chinaKey); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_VALUE, chinaValue); - BBC.INIT_BOON(this); + BBC.BOON_INIT(this); } } diff --git a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T03PartTrit.java b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T03PartTrit.java index 18739b6e..82718691 100644 --- a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T03PartTrit.java +++ b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T03PartTrit.java @@ -22,6 +22,6 @@ public enum T03PartTrit implements BãßBȍőnPartʸᴰ { BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.DIAL_TONE, dialTone); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_KEY, chinaKey); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_VALUE, chinaValue); - BBC.INIT_BOON(this); + BBC.BOON_INIT(this); } } diff --git a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T04PartQuad.java b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T04PartQuad.java index 479bd593..ef5f0970 100644 --- a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T04PartQuad.java +++ b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T04PartQuad.java @@ -25,7 +25,7 @@ public enum T04PartQuad implements BãßBȍőnPartAlt1ʸᴰ { BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_KEY, chinaKey); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_VALUE, chinaValue); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.ALT_1_VALUE, alt1Value); - BBC.INIT_BOON(this); + BBC.BOON_INIT(this); } public T02PartBinary splitPartBinary(T02PartBinary part) { diff --git a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T05PartPental.java b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T05PartPental.java index d9d5a130..0591a65d 100644 --- a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T05PartPental.java +++ b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T05PartPental.java @@ -28,6 +28,6 @@ public enum T05PartPental implements BãßBȍőnPartAlt2ʸᴰ { BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_VALUE, chinaValue); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.ALT_1_VALUE, alt1Value); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.ALT_2_VALUE, alt2Value); - BBC.INIT_BOON(this); + BBC.BOON_INIT(this); } } diff --git a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T06PartSeximal.java b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T06PartSeximal.java index d66cb588..5c7dee90 100644 --- a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T06PartSeximal.java +++ b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T06PartSeximal.java @@ -27,7 +27,7 @@ public enum T06PartSeximal implements BãßBȍőnPartAlt1ʸᴰ { BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_KEY, chinaKey); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_VALUE, chinaValue); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.ALT_1_VALUE, alt1Value); - BBC.INIT_BOON(this); + BBC.BOON_INIT(this); } public T02PartBinary splitPartBinary() { diff --git a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T07PartPlanIt.java b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T07PartPlanIt.java index 7a8b8981..c9c9bbf1 100644 --- a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T07PartPlanIt.java +++ b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T07PartPlanIt.java @@ -28,6 +28,6 @@ public enum T07PartPlanIt implements BãßBȍőnPartAlt1ʸᴰ { BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_KEY, chinaKey); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_VALUE, chinaValue); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.ALT_1_VALUE, alt1Value); - BBC.INIT_BOON(this); + BBC.BOON_INIT(this); } } diff --git a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T08PartOctal.java b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T08PartOctal.java index ad5e614c..0c23c90d 100644 --- a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T08PartOctal.java +++ b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T08PartOctal.java @@ -30,7 +30,7 @@ public enum T08PartOctal implements BãßBȍőnPartʸᴰ,BãßBȍ BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_KEY, chinaKey); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_VALUE, chinaValue); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.SHIFT_BITS, Integer.valueOf(shiftBits)); - BBC.INIT_BOON(this); + BBC.BOON_INIT(this); } public static T08PartOctal indexOf(T08PartOctal group, int value) { diff --git a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T09PartNonary.java b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T09PartNonary.java index 47b888ce..1ab9bc41 100644 --- a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T09PartNonary.java +++ b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T09PartNonary.java @@ -28,6 +28,6 @@ public enum T09PartNonary implements BãßBȍőnPartʸᴰ { BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.DIAL_TONE, dialTone); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_KEY, chinaKey); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_VALUE, chinaValue); - BBC.INIT_BOON(this); + BBC.BOON_INIT(this); } } diff --git a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T10PartDecimal.java b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T10PartDecimal.java index 0dca632f..eb4bbd59 100644 --- a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T10PartDecimal.java +++ b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T10PartDecimal.java @@ -33,6 +33,6 @@ public enum T10PartDecimal implements BãßBȍőnPartAlt2ʸᴰ { BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_VALUE, chinaValue); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.ALT_1_VALUE, alt1Value); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.ALT_2_VALUE, alt2Value); - BBC.INIT_BOON(this); + BBC.BOON_INIT(this); } } diff --git a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T11PartUndecimal.java b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T11PartUndecimal.java index d8774ba5..e0f0ee8f 100644 --- a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T11PartUndecimal.java +++ b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T11PartUndecimal.java @@ -32,6 +32,6 @@ public enum T11PartUndecimal implements BãßBȍőnPartAlt1ʸᴰ { BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_KEY, chinaKey); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_VALUE, chinaValue); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.ALT_1_VALUE, alt1Value); - BBC.INIT_BOON(this); + BBC.BOON_INIT(this); } } diff --git a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T16PartHex.java b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T16PartHex.java index 4519b0a7..e4f9bdc0 100644 --- a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T16PartHex.java +++ b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T16PartHex.java @@ -37,7 +37,7 @@ public enum T16PartHex implements BãßBȍőnPartAlt1ʸᴰ { BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_KEY, chinaKey); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.CHINA_VALUE, chinaValue); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.ALT_1_VALUE, alt1Value); - BBC.INIT_BOON(this); + BBC.BOON_INIT(this); } public T02PartBinary splitPartBinary(T04PartQuad part) { diff --git a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T20PartScore.java b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T20PartScore.java index 74f3c432..72673c9e 100644 --- a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T20PartScore.java +++ b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T20PartScore.java @@ -55,7 +55,7 @@ public enum T20PartScore implements BãßBȍőnPartAlt4ʸᴰ { BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.ALT_2_VALUE, alt2Value); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.ALT_3_VALUE, alt3Value); BBC.PUT_OBJ(BãßBȍőnPartKeyʸᴰ.ALT_4_VALUE, alt4Value); - BBC.INIT_BOON(this); + BBC.BOON_INIT(this); } public T20PartScore BãßValueOfOpenLC(String openLCKey) { diff --git a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T60PartSexagesimal.java b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T60PartSexagesimal.java index 4847df52..3a62c4ac 100644 --- a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T60PartSexagesimal.java +++ b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/T60PartSexagesimal.java @@ -79,6 +79,6 @@ public enum T60PartSexagesimal implements BãßBȍőnPartʸᴰ,BãßBȍőnEnumJmxʸᴰ { +@BãßBȍőnPackageInfoʸᴰ(name = "love.distributedrebirth.numberxd") +public enum TOSWarpCore implements BãßBȍőnEnumInstanceʸᴰ,BãßBȍőnEnumJmxʸᴰ { INSTANCE; - private final BãßBȍőnCoffinOpenʸᴰ BBC = BãßBȍőnCoffinOpenʸᴰ.newInstance(); - public BãßBȍőnCoffinʸᴰ GET_BBC() { return BBC; } + private final BãßBȍőnCoffinOpenʸᴰ BBC = BãßBȍőnCoffinOpenʸᴰ.newInstance(); + public BãßBȍőnCoffinʸᴰ GET_BBC() { return BBC; } - private String armedWarpCipherName; - private String armedWarpCipherDescription; - - private final GuageCounter readCounter; - private final GuageCounter writeCounter; + private final BooleanAttributeᴶᴹˣ armedWarpCipherLock; + private final StringAttributeᴶᴹˣ armedWarpWaterName; + private final StringAttributeᴶᴹˣ armedWarpWaterDesc; + private final GuageCounterᴶᴹˣ warpCoreReads; + private final GuageCounterᴶᴹˣ warpCoreWrites; private TOSWarpCore() { - BBC.INIT_BOON(this); - initJmx(BãßBȍőnEnumJmxKeyʸᴰ.JMX); - readCounter = BȍőnInitGuage(BãßBȍőnEnumJmxKeyʸᴰ.JMX, "reads", "The amount of warpcore reads."); - writeCounter = BȍőnInitGuage(BãßBȍőnEnumJmxKeyʸᴰ.JMX, "writes", "The amount of warpcore writes."); + BBC.BOON_INIT(this); + BȍőnJmxInit(MBeanStoreKeyᴶᴹˣ.JMX); + warpCoreReads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "warpCoreReads", "The amount of warpcore reads."); + warpCoreWrites = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "warpCoreWrites", "The amount of warpcore writes."); + armedWarpWaterName = BȍőnJmxInitStringAttribute(MBeanStoreKeyᴶᴹˣ.JMX, "armedWarpWaterName", "The armed water cipher name."); + armedWarpWaterName.setValueString("default"); + armedWarpWaterDesc = BȍőnJmxInitStringAttribute(MBeanStoreKeyᴶᴹˣ.JMX, "armedWarpWaterDesc", "The armed water cipher description."); + armedWarpWaterDesc.setValueString("Current active cipher."); + armedWarpCipherLock = BȍőnJmxInitBooleanAttribute(MBeanStoreKeyᴶᴹˣ.JMX, "armedWarpCipherLock", "Is the water cipher locked."); + armedWarpCipherLock.setValueBoolean(false); } public void BãßLockWarpCipher() { + armedWarpCipherLock.setValueBoolean(true); for (int base:BasePartFactory.INSTANCE.BãßBases()) { for (BãßBȍőnPartʸᴰ part:BasePartFactory.INSTANCE.BãßBuildPartsByBase(base)) { BãßBȍőnCoffinOpenʸᴰ.class.cast(part.GET_BBC()).LOCK_COFFIN(); @@ -45,18 +57,10 @@ public enum TOSWarpCore implements BãßBȍőnEnumInstanceʸᴰ,Bã } public WaterBucket BãßCurrentWarpCore() { - readCounter.increment(); + warpCoreReads.increment(); WaterCipher warpCipher = new WaterCipher(); - if (armedWarpCipherName == null) { - warpCipher.setName("default"); - } else { - warpCipher.setName(armedWarpCipherName); - } - if (armedWarpCipherDescription == null) { - warpCipher.setName("Current active cipher."); - } else { - warpCipher.setDescription(armedWarpCipherDescription); - } + warpCipher.setName(armedWarpWaterName.getValueString()); + warpCipher.setDescription(armedWarpWaterDesc.getValueString()); for (int base:BasePartFactory.INSTANCE.BãßBases()) { WaterCipherHeart heart = new WaterCipherHeart(); BãßBȍőnPartʸᴰ[] bases = BasePartFactory.INSTANCE.BãßBuildPartsByBase(base); @@ -77,9 +81,9 @@ public enum TOSWarpCore implements BãßBȍőnEnumInstanceʸᴰ,Bã } public void BãßArmWarpCore(WaterBucket warpBucket) { - writeCounter.increment(); - armedWarpCipherName = warpBucket.theWater().getName(); - armedWarpCipherDescription = warpBucket.theWater().getDescription(); + warpCoreWrites.increment(); + armedWarpWaterName.setValueString(warpBucket.theWater().getName()); + armedWarpWaterDesc.setValueString(warpBucket.theWater().getDescription()); for (WaterCipherHeart heart:warpBucket.theWater().getCipherHearts()) { BãßBȍőnPartʸᴰ[] bases = BasePartFactory.INSTANCE.BãßBuildPartsByBase(heart.getBass()); Map> baseParts = new HashMap<>();