use of org.jboss.as.controller.SimpleAttributeDefinition in project wildfly by wildfly.
the class AbstractFederationResourceDefinition method createAttributeWriterHandler.
@Override
protected OperationStepHandler createAttributeWriterHandler() {
List<SimpleAttributeDefinition> attributes = getAttributes();
final List<AttributeDefinition> alternativeAttributes = getAlternativesAttributes();
return new ReloadRequiredWriteAttributeHandler(attributes.toArray(new AttributeDefinition[attributes.size()])) {
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
if (!alternativeAttributes.isEmpty()) {
context.addStep(new AlternativeAttributeValidationStepHandler(alternativeAttributes.toArray(new AttributeDefinition[alternativeAttributes.size()])), OperationContext.Stage.MODEL);
}
doRegisterModelWriteAttributeHandler(context, operation);
super.execute(context, operation);
}
};
}
use of org.jboss.as.controller.SimpleAttributeDefinition in project wildfly by wildfly.
the class AbstractIDMResourceDefinition method createAttributeWriterHandler.
@Override
protected OperationStepHandler createAttributeWriterHandler() {
List<SimpleAttributeDefinition> attributes = getAttributes();
final List<AttributeDefinition> alternativeAttributes = getAlternativesAttributes();
return new IDMConfigWriteAttributeHandler(attributes.toArray(new AttributeDefinition[attributes.size()])) {
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
if (!alternativeAttributes.isEmpty()) {
context.addStep(new AlternativeAttributeValidationStepHandler(alternativeAttributes.toArray(new AttributeDefinition[alternativeAttributes.size()])), OperationContext.Stage.MODEL);
}
doRegisterModelWriteAttributeHandler(context, operation);
super.execute(context, operation);
}
};
}
use of org.jboss.as.controller.SimpleAttributeDefinition in project teiid by teiid.
the class VDBMetadataMapper method getAttributeDefinitions.
public AttributeDefinition[] getAttributeDefinitions() {
ObjectListAttributeDefinition properties = ObjectListAttributeDefinition.Builder.of(PROPERTIES, PropertyMetaDataMapper.INSTANCE.getAttributeDefinition()).build();
ObjectListAttributeDefinition vdbimports = ObjectListAttributeDefinition.Builder.of(IMPORT_VDBS, VDBImportMapper.INSTANCE.getAttributeDefinition()).build();
ObjectListAttributeDefinition models = ObjectListAttributeDefinition.Builder.of(MODELS, ModelMetadataMapper.INSTANCE.getAttributeDefinition()).build();
ObjectListAttributeDefinition translators = ObjectListAttributeDefinition.Builder.of(OVERRIDE_TRANSLATORS, VDBTranslatorMetaDataMapper.INSTANCE.getAttributeDefinition()).build();
ObjectListAttributeDefinition policies = ObjectListAttributeDefinition.Builder.of(DATA_POLICIES, DataPolicyMetadataMapper.INSTANCE.getAttributeDefinition()).build();
return new AttributeDefinition[] { new SimpleAttributeDefinition(VDBNAME, ModelType.STRING, false), new SimpleAttributeDefinition(CONNECTIONTYPE, ModelType.INT, false), new SimpleAttributeDefinition(STATUS, ModelType.BOOLEAN, false), new SimpleAttributeDefinition(VERSION, ModelType.STRING, false), new SimpleAttributeDefinition(VDB_DESCRIPTION, ModelType.BOOLEAN, true), new SimpleAttributeDefinition(XML_DEPLOYMENT, ModelType.BOOLEAN, true), properties, vdbimports, models, translators, policies };
}
use of org.jboss.as.controller.SimpleAttributeDefinition in project wildfly by wildfly.
the class EESubsystemXmlPersister method writeManagedExecutorServices.
private void writeManagedExecutorServices(final XMLExtendedStreamWriter writer, final ModelNode subModel) throws XMLStreamException {
writer.writeStartElement(Element.MANAGED_EXECUTOR_SERVICES.getLocalName());
for (Property property : subModel.asPropertyList()) {
writer.writeStartElement(Element.MANAGED_EXECUTOR_SERVICE.getLocalName());
writer.writeAttribute(Attribute.NAME.getLocalName(), property.getName());
for (SimpleAttributeDefinition ad : ManagedExecutorServiceResourceDefinition.ATTRIBUTES) {
ad.marshallAsAttribute(property.getValue(), writer);
}
writer.writeEndElement();
}
writer.writeEndElement();
}
use of org.jboss.as.controller.SimpleAttributeDefinition in project wildfly by wildfly.
the class EESubsystemXmlPersister method writeManagedThreadFactories.
private void writeManagedThreadFactories(final XMLExtendedStreamWriter writer, final ModelNode subModel) throws XMLStreamException {
writer.writeStartElement(Element.MANAGED_THREAD_FACTORIES.getLocalName());
for (Property property : subModel.asPropertyList()) {
writer.writeStartElement(Element.MANAGED_THREAD_FACTORY.getLocalName());
writer.writeAttribute(Attribute.NAME.getLocalName(), property.getName());
for (SimpleAttributeDefinition ad : ManagedThreadFactoryResourceDefinition.ATTRIBUTES) {
ad.marshallAsAttribute(property.getValue(), writer);
}
writer.writeEndElement();
}
writer.writeEndElement();
}
Aggregations