use of org.jboss.dmr.Property in project wildfly by wildfly.
the class ServerAdd method processAddressSettings.
/**
* Process the address settings.
*
* @param configuration the ActiveMQ configuration
* @param params the detyped operation parameters
*/
/**
* Process the address settings.
*
* @param configuration the ActiveMQ configuration
* @param params the detyped operation parameters
* @throws org.jboss.as.controller.OperationFailedException
*/
static void processAddressSettings(final OperationContext context, final Configuration configuration, final ModelNode params) throws OperationFailedException {
if (params.hasDefined(ADDRESS_SETTING)) {
for (final Property property : params.get(ADDRESS_SETTING).asPropertyList()) {
final String match = property.getName();
final ModelNode config = property.getValue();
final AddressSettings settings = AddressSettingAdd.createSettings(context, config);
configuration.getAddressesSettings().put(match, settings);
}
}
}
use of org.jboss.dmr.Property in project wildfly by wildfly.
the class PartitionManagerRemoveHandler method removeIdentityStoreServices.
void removeIdentityStoreServices(OperationContext context, ModelNode model, String partitionManagerName, String... configurationNames) throws OperationFailedException {
ModelNode identityConfigurationNode = model.get(IDENTITY_CONFIGURATION.getName());
List<String> expectedConfigNames = Arrays.asList(configurationNames);
if (identityConfigurationNode.isDefined()) {
for (Property identityConfiguration : identityConfigurationNode.asPropertyList()) {
String configurationName = identityConfiguration.getName();
if (!expectedConfigNames.isEmpty() && !expectedConfigNames.contains(configurationName)) {
continue;
}
ModelNode value = identityConfiguration.getValue();
if (value.isDefined()) {
for (Property store : value.asPropertyList()) {
context.removeService(PartitionManagerService.createIdentityStoreServiceName(partitionManagerName, configurationName, store.getName()));
}
}
}
}
}
use of org.jboss.dmr.Property in project smscgateway by RestComm.
the class SmscSubsystemParser method writeContent.
/**
* {@inheritDoc}
*/
@Override
public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException {
context.startSubsystemElement(Namespace.CURRENT.getUriString(), false);
final ModelNode node = context.getModelNode();
final ModelNode mbean = node.get(SmscMbeanDefinition.MBEAN);
for (Property mbeanProp : mbean.asPropertyList()) {
writer.writeStartElement(SmscMbeanDefinition.MBEAN);
final ModelNode mbeanEntry = mbeanProp.getValue();
SmscMbeanDefinition.NAME_ATTR.marshallAsAttribute(mbeanEntry, true, writer);
SmscMbeanDefinition.TYPE_ATTR.marshallAsAttribute(mbeanEntry, true, writer);
final ModelNode property = mbeanEntry.get(SmscMbeanPropertyDefinition.PROPERTY);
if (property != null && property.isDefined()) {
for (Property propertyProp : property.asPropertyList()) {
writer.writeStartElement(SmscMbeanPropertyDefinition.PROPERTY);
final ModelNode propertyEntry = propertyProp.getValue();
SmscMbeanPropertyDefinition.NAME_ATTR.marshallAsAttribute(propertyEntry, true, writer);
SmscMbeanPropertyDefinition.TYPE_ATTR.marshallAsAttribute(propertyEntry, true, writer);
SmscMbeanPropertyDefinition.VALUE_ATTR.marshallAsAttribute(propertyEntry, true, writer);
writer.writeEndElement();
}
}
writer.writeEndElement();
}
writer.writeEndElement();
}
use of org.jboss.dmr.Property in project wildfly-swarm by wildfly-swarm.
the class InterfaceMarshaller method hasInterface.
private boolean hasInterface(Interface iface, List<ModelNode> list) {
return list.stream().anyMatch(e -> {
if (!e.get(OP).asString().equals(ADD)) {
return false;
}
ModelNode addr = e.get(OP_ADDR);
if (addr.getType() != ModelType.LIST) {
return false;
}
List<ModelNode> addrList = addr.asList();
if (addrList.size() != 1) {
return false;
}
Property addrProp = addrList.get(0).asProperty();
String propName = addrProp.getName();
String propValue = addrProp.getValue().asString();
return (propName.equals(INTERFACE_NAME) && propValue.equals(iface.getName()));
});
}
use of org.jboss.dmr.Property in project camunda-bpm-platform by camunda.
the class JobAcquisitionAdd method performRuntime.
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {
String acquisitionName = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.ADDRESS)).getLastElement().getValue();
MscRuntimeContainerJobExecutor mscRuntimeContainerJobExecutor = new MscRuntimeContainerJobExecutor();
if (model.hasDefined(SubsystemAttributeDefinitons.PROPERTIES.getName())) {
List<Property> properties = SubsystemAttributeDefinitons.PROPERTIES.resolveModelAttribute(context, model).asPropertyList();
for (Property property : properties) {
PropertyHelper.applyProperty(mscRuntimeContainerJobExecutor, property.getName(), property.getValue().asString());
}
}
// start new service for job executor
ServiceController<RuntimeContainerJobExecutor> serviceController = context.getServiceTarget().addService(ServiceNames.forMscRuntimeContainerJobExecutorService(acquisitionName), mscRuntimeContainerJobExecutor).addDependency(ServiceNames.forMscRuntimeContainerDelegate()).addDependency(ServiceNames.forMscExecutorService()).addListener(verificationHandler).setInitialMode(Mode.ACTIVE).install();
newControllers.add(serviceController);
}
Aggregations