From 5efc789b49be5fbdfb5137f850036a0f42ccda2d Mon Sep 17 00:00:00 2001 From: Willem Date: Sat, 15 Oct 2022 14:12:04 +0200 Subject: [PATCH] Improved jmx --- .../bassboonyd/BãßBȍőnCoffinOpenʸᴰ.java | 11 ++++--- .../bassboonyd/jmx/AttributeLongᴶᴹˣ.java | 25 ++++++++++++++++ .../bassboonyd/jmx/DefaultEnumBaseᴶᴹˣ.java | 30 ++++++++++--------- .../jmx/DefaultEnumInstanceᴶᴹˣ.java | 5 +--- .../bassboonyd/jmx/DefaultEnumSetᴶᴹˣ.java | 5 +--- 5 files changed, 48 insertions(+), 28 deletions(-) create mode 100644 gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboonyd/jmx/AttributeLongᴶᴹˣ.java diff --git a/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboonyd/BãßBȍőnCoffinOpenʸᴰ.java b/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboonyd/BãßBȍőnCoffinOpenʸᴰ.java index 04742171..abf8f1a2 100644 --- a/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboonyd/BãßBȍőnCoffinOpenʸᴰ.java +++ b/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboonyd/BãßBȍőnCoffinOpenʸᴰ.java @@ -53,7 +53,7 @@ public interface BãßBȍőnCoffinOpenʸᴰ BãßBȍőnCoffinOpenʸᴰ newInstance() { return new BãßBȍőnCoffinOpenʸᴰ() { - private final Map initMap = new HashMap<>(); + private final Map corpseParts = new HashMap<>(); private final Map,BãßBȍőnFamilyGrave> familyGrave = new HashMap<>(); private volatile boolean deathLock = false; @@ -68,15 +68,15 @@ public interface BãßBȍőnCoffinOpenʸᴰ) Proxy.newProxyInstance(cl, new Class[]{BãßBȍőnCoffinʸᴰ.class}, new InvocationHandler() { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Method localMethod = local.getClass().getMethod(method.getName(), method.getParameterTypes()); - Object result = localMethod.invoke(local, args); - return result; + return localMethod.invoke(local, args); } }); */ diff --git a/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboonyd/jmx/AttributeLongᴶᴹˣ.java b/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboonyd/jmx/AttributeLongᴶᴹˣ.java new file mode 100644 index 00000000..06d86a2d --- /dev/null +++ b/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboonyd/jmx/AttributeLongᴶᴹˣ.java @@ -0,0 +1,25 @@ +package love.distributedrebirth.bassboonyd.jmx; + +import love.distributedrebirth.bassboonyd.info.BãßBȍőnAuthor注; + +@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天") +@MBeanAttributeType注(Long.class) +public class AttributeLongᴶᴹˣ extends AbstractMBeanAttributeᴶᴹˣ { + private Long value; + + public AttributeLongᴶᴹˣ(String name, String description) { + super(name, description); + } + + public void setValueLong(Long value) { + this.value = value; + } + + public Long getValueLong() { + return value; + } + + public Object getValue() { + return value; + } +} diff --git a/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboonyd/jmx/DefaultEnumBaseᴶᴹˣ.java b/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboonyd/jmx/DefaultEnumBaseᴶᴹˣ.java index 8693f70d..e55070c5 100644 --- a/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboonyd/jmx/DefaultEnumBaseᴶᴹˣ.java +++ b/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboonyd/jmx/DefaultEnumBaseᴶᴹˣ.java @@ -13,42 +13,44 @@ import love.distributedrebirth.bassboonyd.info.BãßBȍőnAuthor注; import love.distributedrebirth.bassboonyd.info.BãßBȍőnName注; @BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天") -@BãßBȍőnAnnotation注(required = {BãßBȍőnName注.class, BãßBȍőnAuthor注.class}) +@BãßBȍőnAnnotation注(required = {BãßBȍőnName注.class}) public interface DefaultEnumBaseᴶᴹˣ extends DefaultEnumBaseʸᴰ { public static class Ꝑŕḯṿª₮ḕ implements BãßBȍőnꝐŕḯṿª₮ḕ { private static final String GHOST_KEY_JMX = "JMX"; + private static X buildJmxGhost(DefaultEnumBaseᴶᴹˣ boon, String name, X result) { + boon.toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).GHOST_MAP_OBJ(Ꝑŕḯṿª₮ḕ.GHOST_KEY_JMX).put(name, result); + return result; + } + @BãßBȍőnSpiderEgg注() private static CounterGuageᴶᴹˣ buildGuageCounter(DefaultEnumBaseᴶᴹˣ boon, String name, String description) { - CounterGuageᴶᴹˣ result = new CounterGuageᴶᴹˣ(name, description); - boon.toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).GHOST_MAP_OBJ(Ꝑŕḯṿª₮ḕ.GHOST_KEY_JMX).put(name, result); - return result; + return buildJmxGhost(boon, name, new CounterGuageᴶᴹˣ(name, description)); } @BãßBȍőnSpiderEgg注() private static AttributeStringᴶᴹˣ buildStringAttribute(DefaultEnumBaseᴶᴹˣ boon, String name, String description) { - AttributeStringᴶᴹˣ result = new AttributeStringᴶᴹˣ(name, description); - boon.toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).GHOST_MAP_OBJ(Ꝑŕḯṿª₮ḕ.GHOST_KEY_JMX).put(name, result); - return result; + return buildJmxGhost(boon, name, new AttributeStringᴶᴹˣ(name, description)); } @BãßBȍőnSpiderEgg注() private static AttributeBooleanᴶᴹˣ buildBooleanAttribute(DefaultEnumBaseᴶᴹˣ boon, String name, String description) { - AttributeBooleanᴶᴹˣ result = new AttributeBooleanᴶᴹˣ(name, description); - boon.toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).GHOST_MAP_OBJ(Ꝑŕḯṿª₮ḕ.GHOST_KEY_JMX).put(name, result); - return result; + return buildJmxGhost(boon, name, new AttributeBooleanᴶᴹˣ(name, description)); } @BãßBȍőnSpiderEgg注() private static AttributeIntegerᴶᴹˣ buildIntegerAttribute(DefaultEnumBaseᴶᴹˣ boon, String name, String description) { - AttributeIntegerᴶᴹˣ result = new AttributeIntegerᴶᴹˣ(name, description); - boon.toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).GHOST_MAP_OBJ(Ꝑŕḯṿª₮ḕ.GHOST_KEY_JMX).put(name, result); - return result; + return buildJmxGhost(boon, name, new AttributeIntegerᴶᴹˣ(name, description)); + } + + @BãßBȍőnSpiderEgg注() + private static AttributeLongᴶᴹˣ buildLongAttribute(DefaultEnumBaseᴶᴹˣ boon, String name, String description) { + return buildJmxGhost(boon, name, new AttributeLongᴶᴹˣ(name, description)); } } - public static Map GHOST_MAP(BãßBȍőnCoffinʸᴰ BBC) { + public static Map jmxGhosts(BãßBȍőnCoffinʸᴰ BBC) { Map result = BBC.UNHOLY(Ꝑŕḯṿª₮ḕ.class).GHOST_MAP_OBJ(Ꝑŕḯṿª₮ḕ.GHOST_KEY_JMX); if (result == null) { result = new HashMap<>(); diff --git a/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboonyd/jmx/DefaultEnumInstanceᴶᴹˣ.java b/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboonyd/jmx/DefaultEnumInstanceᴶᴹˣ.java index e2cb61b5..c1b1f9ce 100644 --- a/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboonyd/jmx/DefaultEnumInstanceᴶᴹˣ.java +++ b/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboonyd/jmx/DefaultEnumInstanceᴶᴹˣ.java @@ -11,12 +11,9 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnꝐŕḯṿª₮ḕ; import love.distributedrebirth.bassboonyd.BãßBȍőnꝐŕḯṿª₮ḕInitPhaseʸᴰ; import love.distributedrebirth.bassboonyd.BãßBȍőnꝐŕḯṿª₮ḕInit注; import love.distributedrebirth.bassboonyd.DefaultEnumInstanceʸᴰ; -import love.distributedrebirth.bassboonyd.info.BãßBȍőnAnnotation注; import love.distributedrebirth.bassboonyd.info.BãßBȍőnAuthor注; -import love.distributedrebirth.bassboonyd.info.BãßBȍőnName注; @BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天") -@BãßBȍőnAnnotation注(required = {BãßBȍőnName注.class, BãßBȍőnAuthor注.class}) public interface DefaultEnumInstanceᴶᴹˣ extends DefaultEnumBaseᴶᴹˣ,DefaultEnumInstanceʸᴰ { public static class Ꝑŕḯṿª₮ḕ implements BãßBȍőnꝐŕḯṿª₮ḕ { @@ -33,7 +30,7 @@ public interface DefaultEnumInstanceᴶᴹˣ extends DefaultEnumBaseᴶᴹˣ,DefaultEnumSetʸᴰ { public static class Ꝑŕḯṿª₮ḕ implements BãßBȍőnꝐŕḯṿª₮ḕ { @@ -37,7 +34,7 @@ public interface DefaultEnumSetᴶᴹˣ