ChannelManager extends ComponentManagerImpl<Channel> implements ChannelManagerMBean, ChannelRuntimeManager { @Override public boolean removeChildren(Collection<WorkflowRuntimeManager> coll) throws CoreException { int i = 0; for (WorkflowRuntimeManager bean : coll) { i += removeChild(bean) ? 1 : 0; } return i > 0; } private  ChannelManager();  ChannelManager(Channel c, AdapterManager owner);   ChannelManager(Channel c, AdapterManager owner, boolean skipBackRef); @Override ObjectName createObjectName(); @Override long requestStartTime(); @Override long requestStopTime(); @Override Collection<ObjectName> getChildren(); @Override boolean addChild(WorkflowRuntimeManager cmb); @Override boolean removeChild(WorkflowRuntimeManager cmb); @Override boolean addChildren(Collection<WorkflowRuntimeManager> coll); @Override boolean removeChildren(Collection<WorkflowRuntimeManager> coll); @Override Channel getWrappedComponent(); @Override AdapterManager getParent(); @Override boolean equals(Object o); @Override String toString(); @Override int hashCode(); @Override Collection<BaseComponentMBean> getAllDescendants(); @Override String getParentId(); @Override ObjectName getParentObjectName(); @Override String createObjectHierarchyString(); @Override Collection<ObjectName> getChildRuntimeInfoComponents(); @Override boolean addChildJmxComponent(ChildRuntimeInfoComponent comp); @Override boolean removeChildJmxComponent(ChildRuntimeInfoComponent comp); @Override void registerMBean(); @Override void unregisterMBean(); @Override ObjectName addWorkflow(String xml); @Override boolean removeWorkflow(String id); @Override void childUpdated(); @Override MBeanNotificationInfo[] getNotificationInfo();  }
@Test public void testRemoveChildren() throws Exception { String adapterName = this.getClass().getSimpleName() + "." + getName(); Adapter adapter = createAdapter(adapterName); AdapterManager adapterManager = new AdapterManager(adapter); Channel channel = createChannel(getName()); Workflow workflow1 = createWorkflow(getName() + "_1"); Workflow workflow2 = createWorkflow(getName() + "_2"); ChannelManager channelManager = new ChannelManager(channel, adapterManager); WorkflowManager child1 = new WorkflowManager(workflow1, channelManager); WorkflowManager child2 = new WorkflowManager(workflow2, channelManager); List<WorkflowRuntimeManager> workflows = new ArrayList<WorkflowRuntimeManager>(Arrays.asList(new WorkflowManager[] { child1, child2 })); assertEquals(2, channelManager.getChildren().size()); assertEquals(2, channel.getWorkflowList().size()); assertTrue(channelManager.removeChildren(workflows)); assertFalse(channelManager.removeChildren(workflows)); assertEquals(0, channelManager.getChildren().size()); assertEquals(0, channel.getWorkflowList().size()); }