Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
}

private void handleGetAttribute(MBeanServer proxy, ObjectName objectName, String attributeName) throws JMException, IOException {
MBeanInfo info = proxy.getMBeanInfo(objectName);
handleGetAttribute(proxy.getMBeanInfo(objectName), objectName, attributeName);
}

private void handleGetAttribute(MBeanInfo info, ObjectName objectName, String attributeName) throws JMException, IOException {
String prefix = null;
for (MBeanAttributeInfo attr : info.getAttributes()) {
if (attr.getName().equals(attributeName)) {
Expand All @@ -93,14 +96,18 @@ private void handleGetAttribute(MBeanServer proxy, ObjectName objectName, String
}

private void handleGetAttributes(MBeanServer proxy, ObjectName objectName, String[] attributeNames) throws JMException, IOException {
MBeanInfo info = proxy.getMBeanInfo(objectName);
for (String attr : attributeNames) {
handleGetAttribute(proxy, objectName, attr);
handleGetAttribute(info, objectName, attr);
}
}

private void handleSetAttribute(MBeanServer proxy, ObjectName objectName, Attribute attribute) throws JMException, IOException {
handleSetAttribute(proxy.getMBeanInfo(objectName), objectName, attribute);
}

private void handleSetAttribute(MBeanInfo info, ObjectName objectName, Attribute attribute) throws JMException, IOException {
String dataType = null;
MBeanInfo info = proxy.getMBeanInfo(objectName);
for (MBeanAttributeInfo attr : info.getAttributes()) {
if (attr.getName().equals(attribute.getName())) {
dataType = attr.getType();
Expand All @@ -116,8 +123,9 @@ private void handleSetAttribute(MBeanServer proxy, ObjectName objectName, Attrib
}

private void handleSetAttributes(MBeanServer proxy, ObjectName objectName, AttributeList attributes) throws JMException, IOException {
MBeanInfo info = proxy.getMBeanInfo(objectName);
for (Attribute attr : attributes.asList()) {
handleSetAttribute(proxy, objectName, attr);
handleSetAttribute(info, objectName, attr);
}
}

Expand Down
Loading