You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@edgent.apache.org by "Dale LaBossiere (JIRA)" <ji...@apache.org> on 2017/03/02 15:50:45 UTC
[jira] [Updated] (EDGENT-155) ControlService impls - need to
enhance JsonControlService?
[ https://issues.apache.org/jira/browse/EDGENT-155?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dale LaBossiere updated EDGENT-155:
-----------------------------------
Component/s: Runtime
> ControlService impls - need to enhance JsonControlService?
> ----------------------------------------------------------
>
> Key: EDGENT-155
> URL: https://issues.apache.org/jira/browse/EDGENT-155
> Project: Edgent
> Issue Type: Task
> Components: Runtime
> 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.15#6346)