private ModelNode addAttributeDescription(final ResourceDescriptionResolver resolver, final Locale locale, final ResourceBundle bundle, final ModelNode node, final ModelType type, final boolean nillable, final MeasurementUnit measurementUnit, final String... suffixes) { final ModelNode valNode = node.get(suffixes[suffixes.length -1]); valNode.get(DESCRIPTION).set(resolver.getResourceAttributeValueTypeDescription(getName(), locale, bundle, suffixes)); valNode.get(TYPE).set(type); valNode.get(NILLABLE).set(nillable); if (measurementUnit != null) { valNode.get(UNIT).set(measurementUnit.getName()); } return valNode; }
.setAutoEnableContexts(AUTO_ENABLE_CONTEXTS.resolveModelAttribute(context, model).asBoolean()) .setStopContextTimeout(STOP_CONTEXT_TIMEOUT.resolveModelAttribute(context, model).asInt()) .setStopContextTimeoutUnit(TimeUnit.valueOf(STOP_CONTEXT_TIMEOUT.getDefinition().getMeasurementUnit().getName())) .setSocketTimeout(SOCKET_TIMEOUT.resolveModelAttribute(context, model).asInt() * 1000) .setSessionDrainingStrategy(Enum.valueOf(SessionDrainingStrategyEnum.class, SESSION_DRAINING_STRATEGY.resolveModelAttribute(context, model).asString()))
private static ModelNode populateAttribute(final ModelNode attributes, final String name, final ModelType type, final boolean required, MeasurementUnit measurementUnit) { final ModelNode attr = attributes.get(name); attr.get(TYPE).set(type); attr.get(NILLABLE).set(!required); if (measurementUnit != null) { attr.get(UNIT).set(measurementUnit.getName()); } return attr; }
private static void populateMemoryUsage(final ModelNode toPopulate, ResourceBundle bundle) { toPopulate.get(INIT, DESCRIPTION).set(bundle.getString("memory.usage.init")); toPopulate.get(INIT, TYPE).set(ModelType.LONG); toPopulate.get(INIT, NILLABLE).set(true); toPopulate.get(INIT, UNIT).set(MeasurementUnit.BYTES.getName()); toPopulate.get(USED, DESCRIPTION).set(bundle.getString("memory.usage.used")); toPopulate.get(USED, TYPE).set(ModelType.LONG); toPopulate.get(USED, NILLABLE).set(true); toPopulate.get(USED, UNIT).set(MeasurementUnit.BYTES.getName()); toPopulate.get(COMMITTED, DESCRIPTION).set(bundle.getString("memory.usage.committed")); toPopulate.get(COMMITTED, TYPE).set(ModelType.LONG); toPopulate.get(COMMITTED, NILLABLE).set(true); toPopulate.get(COMMITTED, UNIT).set(MeasurementUnit.BYTES.getName()); toPopulate.get(MAX, DESCRIPTION).set(bundle.getString("memory.usage.max")); toPopulate.get(MAX, TYPE).set(ModelType.LONG); toPopulate.get(MAX, NILLABLE).set(true); toPopulate.get(MAX, UNIT).set(MeasurementUnit.BYTES.getName()); }
private ModelNode addAttributeDescription(final ResourceDescriptionResolver resolver, final Locale locale, final ResourceBundle bundle, final ModelNode node, final ModelType type, final boolean nillable, final MeasurementUnit measurementUnit, final String... suffixes) { final ModelNode valNode = node.get(suffixes[suffixes.length -1]); valNode.get(DESCRIPTION).set(resolver.getResourceAttributeValueTypeDescription(getName(), locale, bundle, suffixes)); valNode.get(TYPE).set(type); valNode.get(NILLABLE).set(nillable); if (measurementUnit != null) { valNode.get(UNIT).set(measurementUnit.getName()); } return valNode; }
toPopulate.get(BLOCKED_TIME, TYPE).set(ModelType.LONG); toPopulate.get(BLOCKED_TIME, NILLABLE).set(false); toPopulate.get(BLOCKED_TIME, UNIT).set(MeasurementUnit.MILLISECONDS.getName()); toPopulate.get(BLOCKED_COUNT, DESCRIPTION).set(bundle.getString("threading.thread-info.blocked-count")); toPopulate.get(BLOCKED_COUNT, TYPE).set(ModelType.LONG); toPopulate.get(WAITED_TIME, TYPE).set(ModelType.LONG); toPopulate.get(WAITED_TIME, NILLABLE).set(false); toPopulate.get(WAITED_TIME, UNIT).set(MeasurementUnit.MILLISECONDS.getName()); toPopulate.get(WAITED_COUNT, DESCRIPTION).set(bundle.getString("threading.thread-info.waited-count")); toPopulate.get(WAITED_COUNT, TYPE).set(ModelType.STRING);
result.get(ModelDescriptionConstants.UNIT).set(measurementUnit.getName());
result.get(ModelDescriptionConstants.UNIT).set(measurementUnit.getName());
result.get(ModelDescriptionConstants.UNIT).set(measurementUnit.getName());
result.get(ModelDescriptionConstants.UNIT).set(measurementUnit.getName());
result.get(ModelDescriptionConstants.UNIT).set(measurementUnit.getName());
result.get(ModelDescriptionConstants.UNIT).set(measurementUnit.getName());
node.get(ModelDescriptionConstants.UNIT).set(measurementUnit.getName());
result.get(ModelDescriptionConstants.UNIT).set(measurementUnit.getName());
result.get(ModelDescriptionConstants.UNIT).set(measurementUnit.getName());
node.get(ModelDescriptionConstants.UNIT).set(measurementUnit.getName());
node.get(ModelDescriptionConstants.UNIT).set(measurementUnit.getName());
node.get(ModelDescriptionConstants.UNIT).set(measurementUnit.getName());
node.get(ModelDescriptionConstants.UNIT).set(measurementUnit.getName());
node.get(ModelDescriptionConstants.UNIT).set(measurementUnit.getName());