use of org.jboss.dmr.Property in project camunda-bpm-platform by camunda.
the class BpmPlatformParser method writeProperties.
private void writeProperties(final XMLExtendedStreamWriter writer, ModelNode entry) throws XMLStreamException {
if (entry.hasDefined(Element.PROPERTIES.getLocalName())) {
writer.writeStartElement(Element.PROPERTIES.getLocalName());
List<Property> propertyList = entry.get(Element.PROPERTIES.getLocalName()).asPropertyList();
if (!propertyList.isEmpty()) {
for (Property property : propertyList) {
writer.writeStartElement(Element.PROPERTY.getLocalName());
writer.writeAttribute(Attribute.NAME.getLocalName(), property.getName());
writer.writeCharacters(property.getValue().asString());
writer.writeEndElement();
}
}
writer.writeEndElement();
}
}
use of org.jboss.dmr.Property in project camunda-bpm-platform by camunda.
the class BpmPlatformParser method writeProcessEnginesContent.
private void writeProcessEnginesContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context) throws XMLStreamException {
writer.writeStartElement(Element.PROCESS_ENGINES.getLocalName());
ModelNode node = context.getModelNode();
ModelNode processEngineConfigurations = node.get(Element.PROCESS_ENGINES.getLocalName());
if (processEngineConfigurations.isDefined()) {
for (Property property : processEngineConfigurations.asPropertyList()) {
// write each child element to xml
writer.writeStartElement(Element.PROCESS_ENGINE.getLocalName());
writer.writeAttribute(Attribute.NAME.getLocalName(), property.getName());
ModelNode entry = property.getValue();
writeAttribute(Attribute.DEFAULT, writer, entry);
writeElement(Element.DATASOURCE, writer, entry);
writeElement(Element.HISTORY_LEVEL, writer, entry);
writeElement(Element.CONFIGURATION, writer, entry);
writeProperties(writer, entry);
writePlugins(writer, entry);
writer.writeEndElement();
}
}
// end process-engines
writer.writeEndElement();
}
use of org.jboss.dmr.Property in project camunda-bpm-platform by camunda.
the class ProcessEngineAdd method getPropertiesMap.
protected Map<String, String> getPropertiesMap(ModelNode model) {
Map<String, String> properties = new HashMap<String, String>();
if (model.hasDefined(Element.PROPERTIES.getLocalName())) {
ModelNode propertiesNode = model.get(Element.PROPERTIES.getLocalName());
List<Property> propertyList = propertiesNode.asPropertyList();
if (!propertyList.isEmpty()) {
for (Property property : propertyList) {
properties.put(property.getName(), property.getValue().asString());
}
}
}
return properties;
}
use of org.jboss.dmr.Property in project wildfly by wildfly.
the class JGroupsSubsystemXMLWriter method writeRelay.
private static void writeRelay(XMLExtendedStreamWriter writer, ModelNode relay) throws XMLStreamException {
writer.writeStartElement(XMLElement.RELAY.getLocalName());
writeAttributes(writer, relay, RelayResourceDefinition.Attribute.class);
if (relay.hasDefined(RemoteSiteResourceDefinition.WILDCARD_PATH.getKey())) {
for (Property property : relay.get(RemoteSiteResourceDefinition.WILDCARD_PATH.getKey()).asPropertyList()) {
writer.writeStartElement(XMLElement.REMOTE_SITE.getLocalName());
writer.writeAttribute(XMLAttribute.NAME.getLocalName(), property.getName());
writeAttributes(writer, property.getValue(), EnumSet.allOf(RemoteSiteResourceDefinition.Attribute.class));
writer.writeEndElement();
}
}
writer.writeEndElement();
}
use of org.jboss.dmr.Property in project wildfly by wildfly.
the class RemoteCacheContainerConfigurationServiceConfigurator method configure.
@Override
public ServiceConfigurator configure(OperationContext context, ModelNode model) throws OperationFailedException {
this.connectionTimeout = Attribute.CONNECTION_TIMEOUT.resolveModelAttribute(context, model).asInt();
this.defaultRemoteCluster = Attribute.DEFAULT_REMOTE_CLUSTER.resolveModelAttribute(context, model).asString();
this.maxRetries = Attribute.MAX_RETRIES.resolveModelAttribute(context, model).asInt();
this.protocolVersion = Attribute.PROTOCOL_VERSION.resolveModelAttribute(context, model).asString();
this.socketTimeout = Attribute.SOCKET_TIMEOUT.resolveModelAttribute(context, model).asInt();
this.tcpNoDelay = Attribute.TCP_NO_DELAY.resolveModelAttribute(context, model).asBoolean();
this.tcpKeepAlive = Attribute.TCP_KEEP_ALIVE.resolveModelAttribute(context, model).asBoolean();
this.statisticsEnabled = Attribute.STATISTICS_ENABLED.resolveModelAttribute(context, model).asBoolean();
this.transactionTimeout = Attribute.TRANSACTION_TIMEOUT.resolveModelAttribute(context, model).asLong();
this.marshallerFactory = HotRodMarshallerFactory.valueOf(Attribute.MARSHALLER.resolveModelAttribute(context, model).asString());
this.clusters.clear();
Resource container = context.readResource(PathAddress.EMPTY_ADDRESS);
for (Resource.ResourceEntry entry : container.getChildren(RemoteClusterResourceDefinition.WILDCARD_PATH.getKey())) {
String clusterName = entry.getName();
ModelNode cluster = entry.getModel();
List<String> bindings = StringListAttributeDefinition.unwrapValue(context, RemoteClusterResourceDefinition.Attribute.SOCKET_BINDINGS.resolveModelAttribute(context, cluster));
List<SupplierDependency<OutboundSocketBinding>> bindingDependencies = new ArrayList<>(bindings.size());
for (String binding : bindings) {
bindingDependencies.add(new ServiceSupplierDependency<>(CommonUnaryRequirement.OUTBOUND_SOCKET_BINDING.getServiceName(context, binding)));
}
this.clusters.put(clusterName, bindingDependencies);
}
this.server = context.hasOptionalCapability(CommonRequirement.MBEAN_SERVER.getName(), null, null) ? new ServiceSupplierDependency<>(CommonRequirement.MBEAN_SERVER.getServiceName(context)) : null;
this.properties.clear();
for (Property property : Attribute.PROPERTIES.resolveModelAttribute(context, model).asPropertyListOrEmpty()) {
this.properties.setProperty(property.getName(), property.getValue().asString());
}
return this;
}
Aggregations