[ 
https://issues.apache.org/jira/browse/QUARKS-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15222444#comment-15222444
 ] 

ASF GitHub Bot commented on QUARKS-106:
---------------------------------------

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?


> Implement JsonControlService.getControls()
> ------------------------------------------
>
>                 Key: QUARKS-106
>                 URL: https://issues.apache.org/jira/browse/QUARKS-106
>             Project: Quarks
>          Issue Type: Task
>          Components: API
>            Reporter: Victor Dogaru
>            Assignee: Daniel John Debrunner
>            Priority: Minor
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to