Jmx v3
This commit is contained in:
parent
a3f58468f5
commit
36e349c152
20 changed files with 356 additions and 164 deletions
|
|
@ -1,11 +1,10 @@
|
|||
package love.distributedrebirth.bassboonyd;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
|
||||
public interface BãßBȍőnCoffinOpenʸᴰ<T extends BãßBȍőnCoffinStoreKeyʸᴰ> extends BãßBȍőnCoffinʸᴰ<T> {
|
||||
public interface BãßBȍőnCoffinOpenʸᴰ<T extends BãßBȍőnCoffinStoreKeyʸᴰ> extends BãßBȍőnCoffinʸᴰ<T>, DefaultInitMethodʸᴰ {
|
||||
|
||||
void LOCK_COFFIN();
|
||||
|
||||
|
|
@ -19,18 +18,6 @@ public interface BãßBȍőnCoffinOpenʸᴰ<T extends BãßBȍőnCoffinStoreKey
|
|||
PUT_OBJ(key, new HashMap<>());
|
||||
}
|
||||
|
||||
default void BOON_INIT(Object boon) {
|
||||
try {
|
||||
for (Method m:boon.getClass().getMethods()) {
|
||||
if (m.isAnnotationPresent(BãßBȍőnInitMethodʸᴰ.class)) {
|
||||
m.invoke(boon, this);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
static <Y extends BãßBȍőnCoffinStoreKeyʸᴰ> BãßBȍőnCoffinOpenʸᴰ<Y> newInstance() {
|
||||
return new BãßBȍőnCoffinOpenʸᴰ<Y>() {
|
||||
final Map<Y,Object> initMap = new HashMap<>();
|
||||
|
|
|
|||
|
|
@ -5,8 +5,22 @@ public class BãßBȍőnConstantsʸᴰ {
|
|||
|
||||
public static final String STR_VALUES = "values";
|
||||
|
||||
public static final String STR_NAME = "name";
|
||||
|
||||
public static final String STR_TYPE = "type";
|
||||
|
||||
public static final String STR_DOT = ".";
|
||||
|
||||
public static final String STR_EMPTY = "";
|
||||
|
||||
public static final String STR_SPACE = " ";
|
||||
|
||||
public static final String STR_COMMA = ",";
|
||||
|
||||
public static final String STR_COLON = ":";
|
||||
|
||||
public static final String STR_IS = "=";
|
||||
|
||||
public static final int INT_ZERO = 0;
|
||||
|
||||
public static final int INT_ONE = 1;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ 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ʸᴰ<T> extends DefaultAuthorInfoʸᴰ,DefaultClassInfoʸᴰ,DefaultPackageInfoʸᴰ {
|
||||
public interface DefaultEnumBaseʸᴰ<T> extends DefaultAuthorInfoʸᴰ,DefaultClassInfoʸᴰ,DefaultPackageInfoʸᴰ {
|
||||
|
||||
int ordinal();
|
||||
|
||||
String name();
|
||||
|
||||
|
|
@ -23,8 +25,9 @@ public interface BãßBȍőnEnumʸᴰ<T> extends DefaultAuthorInfoʸᴰ,DefaultC
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
default String BȍőnNaamI18N() {
|
||||
return BãßClassNaam() + BãßBȍőnConstantsʸᴰ.STR_DOT + name();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
@ -1,13 +1,7 @@
|
|||
package love.distributedrebirth.bassboonyd;
|
||||
|
||||
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
|
||||
public interface BãßBȍőnEnumInstanceʸᴰ<T> extends BãßBȍőnEnumʸᴰ<T> {
|
||||
|
||||
int ordinal();
|
||||
|
||||
default T BȍőnInstance() {
|
||||
return BãßInstances()[ordinal()];
|
||||
}
|
||||
public interface DefaultEnumInstanceʸᴰ<T> extends DefaultEnumBaseʸᴰ<T> {
|
||||
|
||||
default T BãßInstance() {
|
||||
return BãßInstances()[BãßBȍőnConstantsʸᴰ.INT_ZERO];
|
||||
|
|
@ -7,9 +7,7 @@ import java.util.function.Consumer;
|
|||
import java.util.stream.Stream;
|
||||
|
||||
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
|
||||
public interface BãßBȍőnEnumSetʸᴰ<T> extends BãßBȍőnEnumʸᴰ<T> {
|
||||
|
||||
int ordinal();
|
||||
public interface DefaultEnumSetʸᴰ<T> extends DefaultEnumBaseʸᴰ<T> {
|
||||
|
||||
default int BȍőnRangTelNul() {
|
||||
return ordinal();
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package love.distributedrebirth.bassboonyd;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
|
||||
@BãßBȍőnAnnotationInfoʸᴰ(required = {})
|
||||
public interface DefaultInitMethodʸᴰ {
|
||||
|
||||
default void BOON_INIT(Object boon) {
|
||||
try {
|
||||
for (Method m:boon.getClass().getMethods()) {
|
||||
if (m.isAnnotationPresent(BãßBȍőnInitMethodʸᴰ.class)) {
|
||||
m.invoke(boon, this);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,116 +0,0 @@
|
|||
package love.distributedrebirth.bassboonyd.jmx;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.management.Attribute;
|
||||
import javax.management.AttributeList;
|
||||
import javax.management.AttributeNotFoundException;
|
||||
import javax.management.DynamicMBean;
|
||||
import javax.management.InvalidAttributeValueException;
|
||||
import javax.management.MBeanAttributeInfo;
|
||||
import javax.management.MBeanException;
|
||||
import javax.management.MBeanInfo;
|
||||
import javax.management.MBeanNotificationInfo;
|
||||
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ʸᴰ<T,K extends BãßBȍőnCoffinStoreKeyʸᴰ> extends BãßBȍőnEnumʸᴰ<T>,BãßBȍőnCoffinStoreʸᴰ<K> {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default void BȍőnJmxInit(K key) {
|
||||
BãßBȍőnCoffinOpenʸᴰ<K> coffin = BãßBȍőnCoffinOpenʸᴰ.class.cast(GET_BBC());
|
||||
coffin.PUT_MAP(key);
|
||||
try {
|
||||
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
|
||||
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ȍőnJmxInitGuageCounter(K key, String name) {
|
||||
return BȍőnJmxInitGuageCounter(key,name,"");
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
private final Map<String, Object> guages;
|
||||
|
||||
public GuageDynamicMBean(Map<String, Object> guages) {
|
||||
this.guages = guages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MBeanInfo getMBeanInfo() {
|
||||
MBeanAttributeInfo[] dAttributes = new MBeanAttributeInfo[guages.keySet().size()];
|
||||
List<String> keySet = guages.keySet().stream().collect(Collectors.toList());
|
||||
for (int i = 0; i < dAttributes.length; i++) {
|
||||
String name = keySet.get(i);
|
||||
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,
|
||||
new MBeanNotificationInfo[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAttribute(String name) throws AttributeNotFoundException, MBeanException, ReflectionException {
|
||||
MBeanAttributeᴶᴹˣ gc = MBeanAttributeᴶᴹˣ.class.cast(guages.get(name));
|
||||
return gc.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttributeList getAttributes(String[] arg0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invoke(String arg0, Object[] arg1, String[] arg2) throws MBeanException, ReflectionException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttribute(Attribute arg0)
|
||||
throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttributeList setAttributes(AttributeList arg0) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package love.distributedrebirth.bassboonyd.jmx;
|
||||
|
||||
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ȍőnCoffinStoreKeyʸᴰ;
|
||||
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinStoreʸᴰ;
|
||||
import love.distributedrebirth.bassboonyd.BãßBȍőnConstantsʸᴰ;
|
||||
import love.distributedrebirth.bassboonyd.DefaultEnumBaseʸᴰ;
|
||||
|
||||
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
|
||||
@BãßBȍőnAnnotationInfoʸᴰ(required = {BãßBȍőnClassInfoʸᴰ.class, BãßBȍőnAuthorInfoʸᴰ.class})
|
||||
public interface DefaultEnumBaseᴶᴹˣ<T,K extends BãßBȍőnCoffinStoreKeyʸᴰ> extends DefaultEnumBaseʸᴰ<T>,BãßBȍőnCoffinStoreʸᴰ<K> {
|
||||
|
||||
void BȍőnJmxInit(K key);
|
||||
|
||||
default GuageCounterᴶᴹˣ BȍőnJmxInitGuageCounter(K key, String name) {
|
||||
return BȍőnJmxInitGuageCounter(key, name, BãßBȍőnConstantsʸᴰ.STR_EMPTY);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
default StringAttributeᴶᴹˣ BȍőnJmxInitStringAttribute(K key, String name) {
|
||||
return BȍőnJmxInitStringAttribute(key, name, BãßBȍőnConstantsʸᴰ.STR_EMPTY);
|
||||
}
|
||||
|
||||
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) {
|
||||
return BȍőnJmxInitBooleanAttribute(key, name, BãßBȍőnConstantsʸᴰ.STR_EMPTY);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package love.distributedrebirth.bassboonyd.jmx;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
|
||||
import javax.management.MBeanServer;
|
||||
import javax.management.ObjectName;
|
||||
|
||||
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ȍőnConstantsʸᴰ;
|
||||
import love.distributedrebirth.bassboonyd.DefaultEnumInstanceʸᴰ;
|
||||
|
||||
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
|
||||
@BãßBȍőnAnnotationInfoʸᴰ(required = {BãßBȍőnClassInfoʸᴰ.class, BãßBȍőnAuthorInfoʸᴰ.class})
|
||||
public interface DefaultEnumInstanceᴶᴹˣ<T,K extends BãßBȍőnCoffinStoreKeyʸᴰ> extends DefaultEnumBaseᴶᴹˣ<T,K>,DefaultEnumInstanceʸᴰ<T> {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default void BȍőnJmxInit(K key) {
|
||||
BãßBȍőnCoffinOpenʸᴰ<K> coffin = BãßBȍőnCoffinOpenʸᴰ.class.cast(GET_BBC());
|
||||
coffin.PUT_MAP(key);
|
||||
try {
|
||||
StringBuilder name = new StringBuilder();
|
||||
name.append(BãßPackageNaam());
|
||||
name.append(BãßBȍőnConstantsʸᴰ.STR_COLON);
|
||||
name.append(BãßBȍőnConstantsʸᴰ.STR_TYPE);
|
||||
name.append(BãßBȍőnConstantsʸᴰ.STR_IS);
|
||||
name.append(BãßClassNaam());
|
||||
|
||||
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
|
||||
ObjectName objectName1 = new ObjectName(name.toString());
|
||||
server.registerMBean(new MBeanDynamicᴶᴹˣ(GET_BBC().GET_MAP_OBJ(key)), objectName1);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package love.distributedrebirth.bassboonyd.jmx;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
|
||||
import javax.management.MBeanServer;
|
||||
import javax.management.ObjectName;
|
||||
|
||||
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ȍőnConstantsʸᴰ;
|
||||
import love.distributedrebirth.bassboonyd.DefaultEnumSetʸᴰ;
|
||||
|
||||
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
|
||||
@BãßBȍőnAnnotationInfoʸᴰ(required = {BãßBȍőnClassInfoʸᴰ.class, BãßBȍőnAuthorInfoʸᴰ.class})
|
||||
public interface DefaultEnumSetᴶᴹˣ<T,K extends BãßBȍőnCoffinStoreKeyʸᴰ> extends DefaultEnumBaseᴶᴹˣ<T,K>,DefaultEnumSetʸᴰ<T> {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default void BȍőnJmxInit(K key) {
|
||||
BãßBȍőnCoffinOpenʸᴰ<K> coffin = BãßBȍőnCoffinOpenʸᴰ.class.cast(GET_BBC());
|
||||
coffin.PUT_MAP(key);
|
||||
try {
|
||||
StringBuilder name = new StringBuilder();
|
||||
name.append(BãßPackageNaam());
|
||||
name.append(BãßBȍőnConstantsʸᴰ.STR_COLON);
|
||||
name.append(BãßBȍőnConstantsʸᴰ.STR_TYPE);
|
||||
name.append(BãßBȍőnConstantsʸᴰ.STR_IS);
|
||||
name.append(BãßClassNaam());
|
||||
name.append(BãßBȍőnConstantsʸᴰ.STR_COMMA);
|
||||
name.append(BãßBȍőnConstantsʸᴰ.STR_NAME);
|
||||
name.append(BãßBȍőnConstantsʸᴰ.STR_IS);
|
||||
name.append(BȍőnNaam());
|
||||
|
||||
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
|
||||
ObjectName objectName1 = new ObjectName(name.toString());
|
||||
server.registerMBean(new MBeanDynamicᴶᴹˣ(GET_BBC().GET_MAP_OBJ(key)), objectName1);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -15,6 +15,10 @@ public class GuageCounterᴶᴹˣ extends AbstractMBeanAttributeᴶᴹˣ {
|
|||
counter++;
|
||||
}
|
||||
|
||||
public void increment(long value) {
|
||||
counter = counter + value;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return Long.valueOf(counter);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,65 @@
|
|||
package love.distributedrebirth.bassboonyd.jmx;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.management.Attribute;
|
||||
import javax.management.AttributeList;
|
||||
import javax.management.AttributeNotFoundException;
|
||||
import javax.management.DynamicMBean;
|
||||
import javax.management.InvalidAttributeValueException;
|
||||
import javax.management.MBeanAttributeInfo;
|
||||
import javax.management.MBeanException;
|
||||
import javax.management.MBeanInfo;
|
||||
import javax.management.MBeanNotificationInfo;
|
||||
import javax.management.ReflectionException;
|
||||
|
||||
public class MBeanDynamicᴶᴹˣ implements DynamicMBean {
|
||||
|
||||
private final Map<String, Object> guages;
|
||||
|
||||
public MBeanDynamicᴶᴹˣ(Map<String, Object> guages) {
|
||||
this.guages = guages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MBeanInfo getMBeanInfo() {
|
||||
MBeanAttributeInfo[] dAttributes = new MBeanAttributeInfo[guages.keySet().size()];
|
||||
List<String> keySet = guages.keySet().stream().collect(Collectors.toList());
|
||||
for (int i = 0; i < dAttributes.length; i++) {
|
||||
String name = keySet.get(i);
|
||||
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,
|
||||
new MBeanNotificationInfo[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAttribute(String name) throws AttributeNotFoundException, MBeanException, ReflectionException {
|
||||
MBeanAttributeᴶᴹˣ gc = MBeanAttributeᴶᴹˣ.class.cast(guages.get(name));
|
||||
return gc.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttributeList getAttributes(String[] arg0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invoke(String arg0, Object[] arg1, String[] arg2) throws MBeanException, ReflectionException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttribute(Attribute arg0)
|
||||
throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttributeList setAttributes(AttributeList arg0) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue