You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@edgent.apache.org by "Saurabh Jinturkar (JIRA)" <ji...@apache.org> on 2016/06/16 07:04:05 UTC

[jira] [Commented] (QUARKS-155) ControlService impls - need to enhance JsonControlService?

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

Saurabh Jinturkar commented on QUARKS-155:
------------------------------------------

Hi [~dlaboss],

I would like to take this issue. Could you please guide me over this?

Thanks!
-Saurabh

> ControlService impls - need to enhance JsonControlService?
> ----------------------------------------------------------
>
>                 Key: QUARKS-155
>                 URL: https://issues.apache.org/jira/browse/QUARKS-155
>             Project: Quarks
>          Issue Type: Task
>            Reporter: Dale LaBossiere
>
> JMXControlService allows multiple mbeans (of a different type) registered for a single ``<type,alias,id>``.  The code below passes.
> When tweaked to use the JsonControlService it throws an ISE as noted in the comments below.
> Which behavior is correct?  Does JsonControlService need to be enhanced?
> ```
>     @Test
>     public void testMultiBeanSameId() throws Exception {
>       
>         ControlService cs = new JMXControlService(DOMAIN, new Hashtable<>());
>         // ControlService cs = new JsonControlService();
>         
>         MyControlX myControlX = new MyControlX();
>         MyControlY myControlY = new MyControlY();
>         String type = "stream";
>         String id = "a";
>         String alias = "myStream";
>         String controlIdX = cs.registerControl(type, id, alias, MyControlXMBean.class, myControlX);
>         // following registerControl throws ISE when using JsonControlService as its
>         // limited to a single registration for a <type,alias> pair.
>         // note: it ignores the id.
>         String controlIdY = cs.registerControl(type, id, alias, MyControlYMBean.class, myControlY);
>         assertTrue(controlIdX, !controlIdX.equals(controlIdY));
>         assertTrue(cs.getControl(type, alias, MyControlXMBean.class) instanceof MyControlXMBean);
>         assertTrue(cs.getControl(type, alias, MyControlYMBean.class) instanceof MyControlYMBean);
>         cs.unregister(controlIdX);
>         cs.unregister(controlIdY);
>     }
> ``` 



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