Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -72,7 +72,7 @@ public class MethodNameBasedMBeanInfoAssembler extends AbstractConfigurableMBean
|
||||
* @param methodNames an array of method names indicating the methods to use
|
||||
* @see #setMethodMappings
|
||||
*/
|
||||
public void setManagedMethods(String[] methodNames) {
|
||||
public void setManagedMethods(String... methodNames) {
|
||||
this.managedMethods = new HashSet<String>(Arrays.asList(methodNames));
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public class MethodNameBasedMBeanInfoAssemblerMappedTests extends AbstractJmxAss
|
||||
public void testWithFallThrough() throws Exception {
|
||||
MethodNameBasedMBeanInfoAssembler assembler =
|
||||
getWithMapping("foobar", "add,myOperation,getName,setName,getAge");
|
||||
assembler.setManagedMethods(new String[]{"getNickName", "setNickName"});
|
||||
assembler.setManagedMethods("getNickName", "setNickName");
|
||||
|
||||
ModelMBeanInfo inf = assembler.getMBeanInfo(getBean(), getObjectName());
|
||||
MBeanAttributeInfo attr = inf.getAttribute("NickName");
|
||||
|
||||
@@ -52,7 +52,7 @@ public class MethodNameBasedMBeanInfoAssemblerTests extends AbstractJmxAssembler
|
||||
@Override
|
||||
protected MBeanInfoAssembler getAssembler() {
|
||||
MethodNameBasedMBeanInfoAssembler assembler = new MethodNameBasedMBeanInfoAssembler();
|
||||
assembler.setManagedMethods(new String[] {"add", "myOperation", "getName", "setName", "getAge"});
|
||||
assembler.setManagedMethods("add", "myOperation", "getName", "setName", "getAge");
|
||||
return assembler;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user