Skip to content

Commit

Permalink
Resolve merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
akats7 committed Jul 28, 2023
1 parent 54f09d4 commit 1b2cfe5
Showing 1 changed file with 55 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,73 +30,73 @@ import java.util.logging.Logger
*
*/
class MBeanHelper {
private static final Logger logger = Logger.getLogger(MBeanHelper.class.getName());
private static final Logger logger = Logger.getLogger(MBeanHelper.class.getName());

private final JmxClient jmxClient
private final boolean isSingle
private final List<String> objectNames
private final Map<String, Closure> attributeTransformation
private final JmxClient jmxClient
private final boolean isSingle
private final List<String> objectNames
private final Map<String, Closure> attributeTransformation

private List<GroovyMBean> mbeans
private List<GroovyMBean> mbeans

MBeanHelper(JmxClient jmxClient, String objectName, boolean isSingle) {
this.jmxClient = jmxClient
this.objectNames = Collections.unmodifiableList([objectName])
this.isSingle = isSingle
this.attributeTransformation = [:] as Map<String,Closure<?>>
}
MBeanHelper(JmxClient jmxClient, String objectName, boolean isSingle) {
this.jmxClient = jmxClient
this.objectNames = Collections.unmodifiableList([objectName])
this.isSingle = isSingle
this.attributeTransformation = [:] as Map<String,Closure<?>>
}

MBeanHelper(JmxClient jmxClient, List<String> objectNames) {
this.jmxClient = jmxClient
this.objectNames = Collections.unmodifiableList(objectNames)
this.isSingle = false
this.attributeTransformation = [:] as Map<String,Closure<?>>
}
MBeanHelper(JmxClient jmxClient, List<String> objectNames) {
this.jmxClient = jmxClient
this.objectNames = Collections.unmodifiableList(objectNames)
this.isSingle = false
this.attributeTransformation = [:] as Map<String,Closure<?>>
}

MBeanHelper(JmxClient jmxClient, String objectName, boolean isSingle, Map<String,Closure<?>> attributeTransformation ) {
this.jmxClient = jmxClient
this.objectNames = Collections.unmodifiableList([objectName])
this.isSingle = isSingle
this.attributeTransformation = attributeTransformation
}
MBeanHelper(JmxClient jmxClient, String objectName, boolean isSingle, Map<String,Closure<?>> attributeTransformation ) {
this.jmxClient = jmxClient
this.objectNames = Collections.unmodifiableList([objectName])
this.isSingle = isSingle
this.attributeTransformation = attributeTransformation
}

MBeanHelper(JmxClient jmxClient, List<String> objectNames, Map<String,Closure<?>> attributeTransformation) {
this.jmxClient = jmxClient
this.objectNames = Collections.unmodifiableList(objectNames)
this.isSingle = false
this.attributeTransformation = attributeTransformation
}
MBeanHelper(JmxClient jmxClient, List<String> objectNames, Map<String,Closure<?>> attributeTransformation) {
this.jmxClient = jmxClient
this.objectNames = Collections.unmodifiableList(objectNames)
this.isSingle = false
this.attributeTransformation = attributeTransformation
}

@PackageScope static List<GroovyMBean> queryJmx(JmxClient jmxClient, String objNameStr) {
return queryJmx(jmxClient, new ObjectName(objNameStr))
}
@PackageScope static List<GroovyMBean> queryJmx(JmxClient jmxClient, String objNameStr) {
return queryJmx(jmxClient, new ObjectName(objNameStr))
}

@PackageScope static List<GroovyMBean> queryJmx(JmxClient jmxClient, ObjectName objName) {
List<ObjectName> names = jmxClient.query(objName)
MBeanServerConnection server = jmxClient.connection
return names.collect { new GroovyMBean(server, it) }
}
@PackageScope static List<GroovyMBean> queryJmx(JmxClient jmxClient, ObjectName objName) {
List<ObjectName> names = jmxClient.query(objName)
MBeanServerConnection server = jmxClient.connection
return names.collect { new GroovyMBean(server, it) }
}

void fetch() {
this.mbeans = []
for(objectName in objectNames){
def tmpMbeans = queryJmx(jmxClient, objectName)
if (tmpMbeans.size() == 0) {
logger.warning("Failed to fetch MBean ${objectName}.")
} else {
this.mbeans.addAll(tmpMbeans)
logger.fine("Fetched ${tmpMbeans.size()} MBeans - ${tmpMbeans}")
}
}
void fetch() {
this.mbeans = []
for(objectName in objectNames){
def tmpMbeans = queryJmx(jmxClient, objectName)
if (tmpMbeans.size() == 0) {
logger.warning("Failed to fetch MBean ${objectName}.")
} else {
this.mbeans.addAll(tmpMbeans)
logger.fine("Fetched ${tmpMbeans.size()} MBeans - ${tmpMbeans}")
}
}
}

@PackageScope List<GroovyMBean> getMBeans() {
if (mbeans == null) {
logger.warning("No active MBeans. Be sure to fetch() before updating any applicable instruments.")
return []
}
return mbeans
@PackageScope List<GroovyMBean> getMBeans() {
if (mbeans == null) {
logger.warning("No active MBeans. Be sure to fetch() before updating any applicable instruments.")
return []
}
return mbeans
}

@PackageScope List<Object> getAttribute(String attribute) {
if (mbeans == null || mbeans.size() == 0) {
Expand Down

0 comments on commit 1b2cfe5

Please sign in to comment.