/** {@inheritDoc} */ public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException { return findAttribute(attribute).getValue(); }
/** {@inheritDoc} */ public void visitManagedGroup(ManagedGroup mg) throws JMException { String prefix = domain + ":" + levels[0] + "=" + mg.getName(); visitManagedGroup(mg, prefix, 0); }
/** {@inheritDoc} */ Object getRegistrant() { return ManagementUtil.from(getName(), getDescription(), attributes, ops); } }
private void depthFirstVisit(ManagedGroup group, Map<ManagedGroup, Exception> map) { for (ManagedGroup child : group.getChildren()) { depthFirstVisit(child, map); } try { visitManagedGroup(group); } catch (Exception e) { map.put(group, e); } }
public ManagedGroup add(Object o) { group.add(o); return this; }
public Collection<ManagedGroup> getChildren() { return group.getChildren(); }
public String getDescription() { return group.getDescription(); }
/** {@inheritDoc} */ @Override public String toString() { return "Name= " + getName() + ", Description =" + getDescription(); }
void beforeMutableOperationInner() { if (parent != null) { parent.beforeMutableOperationInner(); } else { beforeMutableOperation(); } }
/** {@inheritDoc} */ public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException { findAttribute(attribute.getName()).setValue(attribute.getValue()); }
/** * Returns a ManagedVisitor that will unregister a ManagedGroup and all its children. The map returned from the * {@link ManagedVisitor#traverse(Object)} method will contain a mapping from any group that failed to unregister to * the cause of the failure. If all groups where succesfully unregistered the returned map is empty. * * @return a ManagedVisitor that will unregister a ManagedGroup and all its children. */ public static ManagedVisitor<Map<ManagedGroup, Exception>> unregister() { return new UnregisterAll(); }
/** {@inheritDoc} */ @Override public boolean equals(Object obj) { return obj instanceof OperationKey && equals((OperationKey) obj); }
/** {@inheritDoc} */ public void visitManagedGroup(ManagedGroup mg) throws JMException { mg.unregister(); }
/** {@inheritDoc} */ public Object traverse(Object node) throws JMException { visitManagedGroup((ManagedGroup) node); return Void.TYPE; }
public boolean isRegistered() { return group.isRegistered(); }
public ManagedGroup getParent() { return group.getParent(); }
public static ManagedVisitor hierarchicalRegistrant(MBeanServer server, String domain, String... levels) { return new HierarchicalRegistrant(server, domain, levels); }