private String getDomainName(OperationContext context, ModelNode model, String child) throws OperationFailedException { if (!model.hasDefined(CommonAttributes.EXPOSE_MODEL)) { return null; } if (!model.get(CommonAttributes.EXPOSE_MODEL).hasDefined(child)) { return null; } ModelNode childModel = model.get(CommonAttributes.EXPOSE_MODEL, child); return ExposeModelResource.getDomainNameAttribute(child).resolveModelAttribute(context, childModel).asString(); }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { super.registerAttributes(resourceRegistration); resourceRegistration.registerReadWriteAttribute(PROPER_PROPERTY_FORMAT, null, new JMXWriteAttributeHandler(PROPER_PROPERTY_FORMAT)); }
/** * return {@code null} if the {@code child} model is not exposed in JMX. */ static String getDomainName(OperationContext context, ModelNode model, String child) throws OperationFailedException { if (!model.hasDefined(CommonAttributes.EXPOSE_MODEL)) { return null; } if (!model.get(CommonAttributes.EXPOSE_MODEL).hasDefined(child)) { return null; } ModelNode childModel = model.get(CommonAttributes.EXPOSE_MODEL, child); return ExposeModelResource.getDomainNameAttribute(child).resolveModelAttribute(context, childModel).asString(); }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { super.registerAttributes(resourceRegistration); resourceRegistration.registerReadWriteAttribute(PROPER_PROPERTY_FORMAT, null, new JMXWriteAttributeHandler(PROPER_PROPERTY_FORMAT)); }
/** * return {@code null} if the {@code child} model is not exposed in JMX. */ static String getDomainName(OperationContext context, ModelNode model, String child) throws OperationFailedException { if (!model.hasDefined(CommonAttributes.EXPOSE_MODEL)) { return null; } if (!model.get(CommonAttributes.EXPOSE_MODEL).hasDefined(child)) { return null; } ModelNode childModel = model.get(CommonAttributes.EXPOSE_MODEL, child); return ExposeModelResource.getDomainNameAttribute(child).resolveModelAttribute(context, childModel).asString(); }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { super.registerAttributes(resourceRegistration); resourceRegistration.registerReadWriteAttribute(PROPER_PROPERTY_FORMAT, null, new JMXWriteAttributeHandler(hostInfoAccessor, PROPER_PROPERTY_FORMAT)); }
protected ModelNode parseShowModelElement(XMLExtendedStreamReader reader, String showModelChild) throws XMLStreamException { ModelNode op = createOperation(ADD, CommonAttributes.EXPOSE_MODEL, showModelChild); String domainName = null; Boolean properPropertyFormat = null; for (int i = 0; i < reader.getAttributeCount(); i++) { final String value = reader.getAttributeValue(i); final String attribute = reader.getAttributeLocalName(i); switch (attribute) { case CommonAttributes.DOMAIN_NAME: ExposeModelResource.getDomainNameAttribute(showModelChild).parseAndSetParameter(value, op, reader); break; case CommonAttributes.PROPER_PROPERTY_FORMAT: if (showModelChild.equals(CommonAttributes.RESOLVED)) { ExposeModelResourceResolved.PROPER_PROPERTY_FORMAT.parseAndSetParameter(value, op, reader); } else { throw ParseUtils.unexpectedAttribute(reader, i); } break; default: throw ParseUtils.unexpectedAttribute(reader, i); } } if (domainName == null && properPropertyFormat == null) { ParseUtils.requireNoContent(reader); } return op; } }
protected ModelNode parseShowModelElement(XMLExtendedStreamReader reader, String showModelChild) throws XMLStreamException { ModelNode op = createOperation(ADD, CommonAttributes.EXPOSE_MODEL, showModelChild); String domainName = null; Boolean properPropertyFormat = null; for (int i = 0; i < reader.getAttributeCount(); i++) { final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case DOMAIN_NAME: ExposeModelResource.getDomainNameAttribute(showModelChild).parseAndSetParameter(value, op, reader); break; case PROPER_PROPETY_FORMAT: if (showModelChild.equals(CommonAttributes.RESOLVED)) { ExposeModelResourceResolved.PROPER_PROPERTY_FORMAT.parseAndSetParameter(value, op, reader); } else { throw ParseUtils.unexpectedAttribute(reader, i); } break; default: throw ParseUtils.unexpectedAttribute(reader, i); } } if (domainName == null && properPropertyFormat == null) { ParseUtils.requireNoContent(reader); } return op; } }
private ModelNode parseShowModelElement(XMLExtendedStreamReader reader, String showModelChild) throws XMLStreamException { ModelNode op = createOperation(ADD, CommonAttributes.EXPOSE_MODEL, showModelChild); String domainName = null; Boolean properPropertyFormat = null; for (int i = 0; i < reader.getAttributeCount(); i++) { final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case DOMAIN_NAME: ExposeModelResource.getDomainNameAttribute(showModelChild).parseAndSetParameter(value, op, reader); break; case PROPER_PROPETY_FORMAT: if (showModelChild.equals(CommonAttributes.RESOLVED)) { ExposeModelResourceResolved.PROPER_PROPERTY_FORMAT.parseAndSetParameter(value, op, reader); } else { throw ParseUtils.unexpectedAttribute(reader, i); } break; default: throw ParseUtils.unexpectedAttribute(reader, i); } } if (domainName == null && properPropertyFormat == null) { ParseUtils.requireNoContent(reader); } return op; } }