Github user vdogaru commented on a diff in the pull request:

    https://github.com/apache/incubator-quarks/pull/66#discussion_r58276005
  
    --- Diff: 
runtime/jmxcontrol/src/main/java/quarks/runtime/jmxcontrol/JMXControlService.java
 ---
    @@ -127,29 +126,40 @@ public void unregister(String controlId) {
        }
     
         @Override
    -    public <T> Set<T> getControls(Class<T> controlInterface) {
    +    public <T> T  getControl(String type, String alias, Class<T> 
controlInterface) {
             try {
                 MBeanServer mBeanServer = getMbs();
    -            Set<ObjectName> names = 
getObjectNamesForInterface(controlInterface.getName());
    +            Set<ObjectName> names = getObjectNamesForInterface(type, 
alias, controlInterface.getName());
    +            
    +            if (names.isEmpty())
    +                return null;
    +            if (names.size() != 1)
    +                throw new RuntimeException("Alias " + alias + " not unique 
for type " + type);
    --- End diff --
    
    I'm thinking that I would expect JMXControlService.register to throw an 
exception if I register two controls with the same type and alias (according to 
the ControlService docs?) Instead, I get an exception later, when I query?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to