@Override public void registerReadWriteAttribute(final AttributeDefinition definition, final OperationStepHandler readHandler, final OperationStepHandler writeHandler) { assert definition.getUndefinedMetricValue() == null : "Attributes cannot have undefined metric value set"; checkPermission(); if (!isAttributeRegistrationAllowed(definition)) { return; } AttributeAccess.Storage storage = definition.getImmutableFlags().contains(AttributeAccess.Flag.STORAGE_RUNTIME) ? Storage.RUNTIME : Storage.CONFIGURATION; AttributeAccess aa = new AttributeAccess(AccessType.READ_WRITE, storage, readHandler, writeHandler, definition); storeAttribute(definition, aa); }
@Override public void registerReadOnlyAttribute(final AttributeDefinition definition, final OperationStepHandler readHandler) { assert definition.getUndefinedMetricValue() == null : "Attributes cannot have undefined metric value set"; checkPermission(); if (!isAttributeRegistrationAllowed(definition)) { return; } AttributeAccess.Storage storage = definition.getImmutableFlags().contains(AttributeAccess.Flag.STORAGE_RUNTIME) ? Storage.RUNTIME : Storage.CONFIGURATION; AttributeAccess aa = new AttributeAccess(AccessType.READ_ONLY, storage, readHandler, null, definition); storeAttribute(definition, aa); }
@Override public void registerReadWriteAttribute(final AttributeDefinition definition, final OperationStepHandler readHandler, final OperationStepHandler writeHandler) { assert definition.getUndefinedMetricValue() == null : "Attributes cannot have undefined metric value set"; checkPermission(); if (!isAttributeRegistrationAllowed(definition)) { return; } AttributeAccess.Storage storage = definition.getImmutableFlags().contains(AttributeAccess.Flag.STORAGE_RUNTIME) ? Storage.RUNTIME : Storage.CONFIGURATION; AttributeAccess aa = new AttributeAccess(AccessType.READ_WRITE, storage, readHandler, writeHandler, definition); storeAttribute(definition, aa); }
@Override public void registerReadOnlyAttribute(final AttributeDefinition definition, final OperationStepHandler readHandler) { assert definition.getUndefinedMetricValue() == null : "Attributes cannot have undefined metric value set"; checkPermission(); if (!isAttributeRegistrationAllowed(definition)) { return; } AttributeAccess.Storage storage = definition.getImmutableFlags().contains(AttributeAccess.Flag.STORAGE_RUNTIME) ? Storage.RUNTIME : Storage.CONFIGURATION; AttributeAccess aa = new AttributeAccess(AccessType.READ_ONLY, storage, readHandler, null, definition); storeAttribute(definition, aa); }
private boolean assertMetricValues(AttributeDefinition definition) { if (!definition.isRequired() && definition.getUndefinedMetricValue() != null) { assert false : "Nillable metric has an undefined metric value for '" + definition.getName() + "'"; } // BES 2015/08/28 The WFCORE-831 spec does not require this assertion. The requirement is that read-attribute // not return undefined, but AttributeDefinition.getUndefinedMetricValue() is not the only way to achieve this. // The read-attribute handler can simply always work. // if (!definition.isAllowNull() && definition.getUndefinedMetricValue() == null) { // assert false : "Non-nillable metric does not have an undefined metric value for '" + definition.getName() + "'"; // } if (definition.getDefaultValue() != null) { assert false : "Metrics cannot have a default value for '" + definition.getName() + "'"; } return true; }
private boolean assertMetricValues(AttributeDefinition definition) { if (!definition.isRequired() && definition.getUndefinedMetricValue() != null) { assert false : "Nillable metric has an undefined metric value for '" + definition.getName() + "'"; } // BES 2015/08/28 The WFCORE-831 spec does not require this assertion. The requirement is that read-attribute // not return undefined, but AttributeDefinition.getUndefinedMetricValue() is not the only way to achieve this. // The read-attribute handler can simply always work. // if (!definition.isAllowNull() && definition.getUndefinedMetricValue() == null) { // assert false : "Non-nillable metric does not have an undefined metric value for '" + definition.getName() + "'"; // } if (definition.getDefaultValue() != null) { assert false : "Metrics cannot have a default value for '" + definition.getName() + "'"; } return true; }
if (!context.getResult().isDefined() && !includeUndefinedMetricValue) { ModelNode undefinedMetricValue = attributeAccess.getAttributeDefinition().getUndefinedMetricValue(); if (undefinedMetricValue != null) { context.getResult().set(undefinedMetricValue);
if (!context.getResult().isDefined() && !includeUndefinedMetricValue) { ModelNode undefinedMetricValue = attributeAccess.getAttributeDefinition().getUndefinedMetricValue(); if (undefinedMetricValue != null) { context.getResult().set(undefinedMetricValue);