Java Code Examples for org.jboss.dmr.ModelType#BOOLEAN

The following examples show how to use org.jboss.dmr.ModelType#BOOLEAN . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XmlToJson.java    From revapi with Apache License 2.0 6 votes vote down vote up
private ModelNode convertObject(Xml configuration, ModelNode jsonSchema, ModelNode rootSchema) {
    ModelNode object = new ModelNode();
    object.setEmptyObject();
    ModelNode propertySchemas = jsonSchema.get("properties");
    ModelNode additionalPropSchemas = jsonSchema.get("additionalProperties");
    for (Xml childConfig : getChildren.apply(configuration)) {
        String name = getName.apply(childConfig);
        ModelNode childSchema = propertySchemas.get(name);
        if (!childSchema.isDefined()) {
            if (additionalPropSchemas.getType() == ModelType.BOOLEAN) {
                throw new IllegalArgumentException("Cannot determine the format for the '" + name +
                        "' XML tag during the XML-to-JSON conversion.");
            }
            childSchema = additionalPropSchemas;
        }

        if (!childSchema.isDefined()) {
            throw new IllegalArgumentException("Could not determine the format for the '" + name +
                    "' XML tag during the XML-to-JSON conversion.");
        }
        ModelNode jsonChild = convert(childConfig, childSchema, rootSchema);
        object.get(name).set(jsonChild);
    }
    return object;
}
 
Example 2
Source File: OptionAttributeDefinition.java    From wildfly-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@SuppressWarnings("unchecked")
public OptionMap.Builder resolveOption(final ExpressionResolver context, final ModelNode model, OptionMap.Builder builder) throws OperationFailedException {
    ModelNode value = resolveModelAttribute(context, model);
    if (value.isDefined()) {
        if (getType() == ModelType.INT) {
            builder.set((Option<Integer>) option, value.asInt());
        } else if (getType() == ModelType.LONG) {
            builder.set(option, value.asLong());
        } else if (getType() == ModelType.BOOLEAN) {
            builder.set(option, value.asBoolean());
        } else if (optionType.isEnum()) {
            builder.set(option, option.parseValue(value.asString(), option.getClass().getClassLoader()));
        }else if (option.getClass().getSimpleName().equals("SequenceOption")) {
            builder.setSequence(option, value.asString().split("\\s*,\\s*"));
        } else if (getType() == ModelType.STRING) {
            builder.set(option, value.asString());
        } else {
            throw new OperationFailedException("Don't know how to handle: " + option + " with value: " + value);
        }
    }
    return builder;
}
 
Example 3
Source File: ModelTestModelDescriptionValidator.java    From wildfly-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Override
public String validate(ModelNode currentNode, String descriptor) {
    if (currentNode.hasDefined(descriptor)) {
        List<ModelNode> list;
        try {
            list = currentNode.asList();
        } catch (Exception e) {
            return "'" + descriptor + "' is not a list";
        }
        for (ModelNode entry : list) {
            if (!entry.hasDefined(NAME)) {
                return "'" + descriptor + "." + entry + "'.name is not defined";
            }
            if (entry.get(NAME).getType() != ModelType.STRING) {
                return "'" + descriptor + "." + entry + "'.name is not of type string";
            }
            if (!entry.hasDefined(DYNAMIC)) {
                return "'" + descriptor + "." + entry + "'.dynamic is not defined";
            }
            if (!entry.hasDefined(DYNAMIC) || entry.get(DYNAMIC).getType() != ModelType.BOOLEAN) {
                return "'" + descriptor + "." + entry + "'.dynamic is not of type boolean";
            }
        }
    }
    return null;
}
 
Example 4
Source File: OperationDialog.java    From wildfly-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
private void setInputComponent() {
    this.label = makeLabel();
    if (type == ModelType.BOOLEAN && !expressionsAllowed) {
        this.valueComponent = new JCheckBox(makeLabelString(false));
        this.valueComponent.setToolTipText(description);
        this.label = new JLabel(); // checkbox doesn't need a label
    } else if (type == ModelType.UNDEFINED) {
        JLabel jLabel = new JLabel();
        this.valueComponent = jLabel;
    } else if (props.get("allowed").isDefined()) {
        JComboBox comboBox = makeJComboBox(props.get("allowed").asList());
        this.valueComponent = comboBox;
    } else if (type == ModelType.LIST) {
        ListEditor listEditor = new ListEditor(OperationDialog.this);
        this.valueComponent = listEditor;
    } else if (type == ModelType.BYTES) {
        this.valueComponent = new BrowsePanel(OperationDialog.this);
    } else {
        JTextField textField = new JTextField(30);
        this.valueComponent = textField;
    }
}
 
Example 5
Source File: ModelTypeValidatorUnitTestCase.java    From wildfly-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Test
public void testBoolean() {
    ModelTypeValidator testee = new ModelTypeValidator(ModelType.BOOLEAN, false, false, false);
    assertOk(testee, ModelNode.TRUE);
    assertOk(testee, new ModelNode().set("true"));
    assertOk(testee, new ModelNode().set("TruE"));
    assertOk(testee, new ModelNode().set("false"));
    assertOk(testee, new ModelNode().set("fAlsE"));
    assertInvalid(testee, new ModelNode().set("fals"), true);
    assertInvalid(testee, ModelNode.ZERO);

    testee = new ModelTypeValidator(ModelType.BOOLEAN, false, false, true);
    assertOk(testee, ModelNode.TRUE);
    assertInvalid(testee, new ModelNode().set("false"));
    assertInvalid(testee, ModelNode.ZERO);
}
 
Example 6
Source File: OptionAttributeDefinition.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void setType() {
    try {
        final Field typeField;
        if (option.getClass().getSimpleName().equals("SequenceOption")) {
            typeField = option.getClass().getDeclaredField("elementType");
        } else {
            typeField = option.getClass().getDeclaredField("type");
        }

        typeField.setAccessible(true);
        optionType = (Class<?>) typeField.get(option);

        if (optionType.isAssignableFrom(Integer.class)) {
            type = ModelType.INT;
        } else if (optionType.isAssignableFrom(Long.class)) {
            type = ModelType.LONG;
        } else if (optionType.isAssignableFrom(BigInteger.class)) {
            type = ModelType.BIG_INTEGER;
        } else if (optionType.isAssignableFrom(Double.class)) {
            type = ModelType.DOUBLE;
        } else if (optionType.isAssignableFrom(BigDecimal.class)) {
            type = ModelType.BIG_DECIMAL;
        } else if (optionType.isEnum() || optionType.isAssignableFrom(String.class)) {
            type = ModelType.STRING;
        } else if (optionType.isAssignableFrom(Boolean.class)) {
            type = ModelType.BOOLEAN;
        } else {
            type = ModelType.UNDEFINED;
        }

    } catch (Exception e) {
        throw new IllegalArgumentException(e);
    }
}
 
Example 7
Source File: SchemaDrivenJSONToXmlConverter.java    From revapi with Apache License 2.0 5 votes vote down vote up
private static PlexusConfiguration convertObject(ModelNode configuration, ConversionContext ctx) {
    XmlPlexusConfiguration object = new XmlPlexusConfiguration(ctx.tagName);
    if (ctx.id != null) {
        object.setAttribute("id", ctx.id);
    }

    ModelNode propertySchemas = ctx.currentSchema.get("properties");
    ModelNode additionalPropSchemas = ctx.currentSchema.get("additionalProperties");
    for (String key : configuration.keys()) {
        ModelNode childConfig = configuration.get(key);
        ModelNode childSchema = propertySchemas.get(key);
        if (!childSchema.isDefined()) {
            if (additionalPropSchemas.getType() == ModelType.BOOLEAN) {
                throw new IllegalArgumentException("Cannot determine the format for the '" + key +
                        "' JSON value during the JSON-to-XML conversion.");
            }
            childSchema = additionalPropSchemas;
        }

        ctx.currentSchema = childSchema;
        ctx.pushTag(key);
        ctx.id = null;

        if (!childSchema.isDefined()) {
            //check if this is an ignorable path
            if (ctx.ignorablePaths.contains(ctx.getCurrentPathString())) {
                ctx.currentPath.pop();
                continue;
            }
            throw new IllegalArgumentException("Could not determine the format for the '" + key +
                    "' JSON value during the JSON-to-XML conversion.");
        }

        PlexusConfiguration xmlChild = convert(childConfig, ctx);
        ctx.currentPath.pop();
        object.addChild(xmlChild);
    }
    return object;
}
 
Example 8
Source File: OperationDialog.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void addRequestProps(StringBuilder command, SortedSet<RequestProp> reqProps) {
    boolean addedProps = false;
    command.append("(");
    for (RequestProp prop : reqProps) {
        String submittedValue = prop.getValueAsString();

        if (submittedValue == null) continue;
        if (submittedValue.equals("")) continue;

        // Don't display boolean values that are already the default.
        // This only works if the default value is provided by read-operation-description.
        if (prop.type == ModelType.BOOLEAN && !prop.expressionsAllowed) {
            ModelNode defaultValue = prop.getDefaultValue();
            if ((defaultValue != null) && (defaultValue.asBoolean() == Boolean.parseBoolean(submittedValue))) continue;
        }

        addedProps = true;
        command.append(prop.getName());
        command.append("=");
        command.append(submittedValue);

        command.append(",");
    }

    if (addedProps) {
        // replace training comma with close paren
        command.replace(command.length()-1, command.length(), ")");
    } else {
        // remove opening paren
        command.deleteCharAt(command.length() - 1);
    }
}
 
Example 9
Source File: ModelNodeFormatter.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static ModelNodeFormatterBase forType(ModelType type) {
    if(type == ModelType.STRING) {
        return STRING;
    }
    if(type == ModelType.BOOLEAN) {
        return BOOLEAN;
    }
    if(type == ModelType.OBJECT || type == ModelType.LIST) {
        return LIST;
    }
    if(type == ModelType.PROPERTY) {
        return PROPERTY;
    }
    return DEFAULT;
}
 
Example 10
Source File: InterfaceManagementUnitTestCase.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
protected void populateCritieria(final ModelNode model, final Nesting nesting, final AttributeDefinition...excluded) {
    Set<AttributeDefinition> excludedCriteria = new HashSet<AttributeDefinition>(Arrays.asList(excluded));
    for(final AttributeDefinition def : InterfaceDefinition.NESTED_ATTRIBUTES) {

        if (excludedCriteria.contains(def)) {
            continue;
        }

        final ModelNode node = model.get(def.getName());
        if(def.getType() == ModelType.BOOLEAN) {
            node.set(true);
        } else if (def == InterfaceDefinition.INET_ADDRESS || def == InterfaceDefinition.LOOPBACK_ADDRESS) {
            if (nesting == Nesting.ANY && def == InterfaceDefinition.INET_ADDRESS) {
                node.add("127.0.0.1");
            } else if (nesting == Nesting.NOT && def == InterfaceDefinition.INET_ADDRESS) {
                node.add("10.0.0.1");
            } else {
                node.set("127.0.0.1");
            }
        } else if (def == InterfaceDefinition.NIC || def == InterfaceDefinition.NIC_MATCH) {
            if (nesting == Nesting.ANY) {
                node.add("lo");
            } else if (nesting == Nesting.NOT) {
                node.add("en3");
            } else {
                node.set("lo");
            }
        } else if (def == InterfaceDefinition.SUBNET_MATCH) {
            if (nesting == Nesting.ANY) {
                node.add("127.0.0.1/24");
            } else if (nesting == Nesting.NOT) {
                node.add("10.0.0.1/24");
            } else {
                node.set("127.0.0.0/24");
            }
        }
    }
}
 
Example 11
Source File: DeploymentAttributes.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public void marshallAsAttribute(AttributeDefinition attribute, ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException {
    ModelNode value = resourceModel.hasDefined(attribute.getName()) ? resourceModel.get(attribute.getName()) : ModelNode.FALSE;
    if (value.getType() != ModelType.BOOLEAN || !value.asBoolean()) {
        writer.writeAttribute(attribute.getXmlName(), value.asString());
    }
}
 
Example 12
Source File: DeploymentAttributes.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public boolean isMarshallable(AttributeDefinition attribute, ModelNode resourceModel) {
    // Unfortunately, the xsd says default is true while the mgmt API default is false.
    // So, only marshal if the value != 'true'
    return !resourceModel.has(attribute.getName())
            || resourceModel.get(attribute.getName()).getType() != ModelType.BOOLEAN
            || !resourceModel.get(attribute.getName()).asBoolean();
}
 
Example 13
Source File: ModelTypeValidatorUnitTestCase.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Test
public void testAllowExpressions() {
    ModelTypeValidator testee = new ModelTypeValidator(ModelType.BOOLEAN, false, true);
    assertOk(testee, new ModelNode().set(new ValueExpression("{test}")));

    testee = new ModelTypeValidator(ModelType.BOOLEAN, false, false);
    assertInvalid(testee, new ModelNode().set(new ValueExpression("{test}")));
}
 
Example 14
Source File: ModelTypeValidatorUnitTestCase.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Test
public void testAllowNull() {
    ModelTypeValidator testee = new ModelTypeValidator(ModelType.BOOLEAN, true);
    assertOk(testee, new ModelNode());

    testee = new ModelTypeValidator(ModelType.BOOLEAN, false);
    assertInvalid(testee, new ModelNode());
}
 
Example 15
Source File: SharedAttributeDefinitons.java    From keycloak with Apache License 2.0 5 votes vote down vote up
private static boolean isSet(ModelNode attributes, SimpleAttributeDefinition def) {
    ModelNode attribute = attributes.get(def.getName());

    if (def.getType() == ModelType.BOOLEAN) {
        return attribute.isDefined() && attribute.asBoolean();
    }

    return attribute.isDefined() && !attribute.asString().isEmpty();
}
 
Example 16
Source File: InterfaceCriteriaWriteHandler.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
boolean isAllowed(final AttributeDefinition def, final ModelNode model) {
    final String[] alternatives = def.getAlternatives();
    if(alternatives != null) {
        for(final String alternative : alternatives) {
            if(model.hasDefined(alternative)) {
                if(ATTRIBUTES.get(alternative).getType() == ModelType.BOOLEAN) {
                    return ! model.get(alternative).asBoolean();
                }
                return false;
            }
        }
    }
    return true;
}
 
Example 17
Source File: InterfaceCriteriaWriteHandler.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public void execute(final OperationContext context, final ModelNode ignored) throws OperationFailedException {
    final Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS);
    final ModelNode model = resource.getModel();
    for(final AttributeDefinition definition : InterfaceDefinition.ROOT_ATTRIBUTES) {
        final String attributeName = definition.getName();
        final boolean has = model.hasDefined(attributeName);
        if(! has && isRequired(definition, model)) {
            throw ControllerLogger.ROOT_LOGGER.required(attributeName);
        }
        if(has) {
            // Just ignore 'false'
            if(definition.getType() == ModelType.BOOLEAN && ! model.get(attributeName).asBoolean()) {
                continue;
            }
            if(! isAllowed(definition, model)) {
                // TODO probably move this into AttributeDefinition
                String[] alts = definition.getAlternatives();
                StringBuilder sb = null;
                if (alts != null) {
                    for (String alt : alts) {
                        if (model.hasDefined(alt)) {
                            if (sb == null) {
                                sb = new StringBuilder();
                            } else {
                                sb.append(", ");
                            }
                            sb.append(alt);
                        }
                    }
                }
                throw new OperationFailedException(ControllerLogger.ROOT_LOGGER.invalidAttributeCombo(attributeName, sb));
            }
        }
    }
    context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
}
 
Example 18
Source File: OperationValidator.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void checkAllRequiredPropertiesArePresent(final ModelNode description, final ModelNode operation, final Map<String, ModelNode> describedProperties, final Map<String, ModelNode> actualParams) {
    for (String paramName : describedProperties.keySet()) {
        final ModelNode described = describedProperties.get(paramName);
        final boolean required;
        if (described.hasDefined(REQUIRED)) {
            if (ModelType.BOOLEAN != described.get(REQUIRED).getType()) {
                throwOrWarnAboutDescriptorProblem(ControllerLogger.ROOT_LOGGER.invalidDescriptionRequiredFlagIsNotABoolean(paramName, getPathAddress(operation), description));
                required = false;
            } else {
                required = described.get(REQUIRED).asBoolean();
            }
        } else {
            required = true;
        }
        Collection<ModelNode> alternatives = null;
        if(described.hasDefined(ALTERNATIVES)) {
            alternatives = described.get(ALTERNATIVES).asList();
        }
        final boolean exist = actualParams.containsKey(paramName) && actualParams.get(paramName).isDefined();
        final String alternative = hasAlternative(actualParams.keySet(), alternatives);
        final boolean alternativeExist = alternative != null && actualParams.get(alternative).isDefined();
        if (required) {
            if(!exist && !alternativeExist) {
                throw ControllerLogger.ROOT_LOGGER.validationFailedRequiredParameterNotPresent(paramName, formatOperationForMessage(operation));
            }
        }
        if(exist && alternativeExist) {
            throw ControllerLogger.ROOT_LOGGER.validationFailedRequiredParameterPresentAsWellAsAlternative(alternative, paramName, formatOperationForMessage(operation));
        }
    }
}
 
Example 19
Source File: ResourceCompositeOperationHandler.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
protected Map<String, ArgumentWithValue> getOperationArguments(CommandContext ctx, String opName) throws CommandLineException {
    Map<String, ArgumentWithValue> args = opArgs.get(opName);
    if(args != null) {
        return args;
    }

    final ModelNode descr = getOperationDescription(ctx, opName);
    if(descr.has(Util.REQUEST_PROPERTIES)) {
        args = new HashMap<String,ArgumentWithValue>();
        final List<Property> propList = descr.get(Util.REQUEST_PROPERTIES).asPropertyList();
        for (Property prop : propList) {
            CommandLineCompleter valueCompleter = null;
            ArgumentValueConverter valueConverter = null;
            if(propConverters != null) {
                valueConverter = propConverters.get(prop.getName());
            }
            if(valueCompleters != null) {
                valueCompleter = valueCompleters.get(prop.getName());
            }
            if(valueConverter == null) {
                valueConverter = ArgumentValueConverter.DEFAULT;
                final ModelType propType = getType(prop.getValue());
                if(propType != null) {
                    if(ModelType.BOOLEAN == propType) {
                        if(valueCompleter == null) {
                            valueCompleter = SimpleTabCompleter.BOOLEAN;
                        }
                    } else if(ModelType.STRING == propType) {
                        valueConverter = ArgumentValueConverter.NON_OBJECT;
                    } else if(prop.getName().endsWith("properties")) { // TODO this is bad but can't rely on proper descriptions
                        valueConverter = ArgumentValueConverter.PROPERTIES;
                    } else if(ModelType.LIST == propType) {
                        if(asType(descr.get(Util.VALUE_TYPE)) == ModelType.PROPERTY) {
                            valueConverter = ArgumentValueConverter.PROPERTIES;
                        } else {
                            valueConverter = ArgumentValueConverter.LIST;
                        }
                    }
                }
            }
            final ArgumentWithValue arg = new ArgumentWithValue(ResourceCompositeOperationHandler.this, valueCompleter, valueConverter, "--" + prop.getName());
            args.put(arg.getFullName(), arg);
        }
    } else {
        args = Collections.emptyMap();
    }
    opArgs.put(opName, args);
    return args;
}
 
Example 20
Source File: WorkerAdd.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
    final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));
    Resource resource = context.readResourceFromRoot(address.subAddress(0, address.size() - 1));
    ModelNode workers = Resource.Tools.readModel(resource).get(IOExtension.WORKER_PATH.getKey());
    int allWorkerCount = workers.asList().size();
    final String name = context.getCurrentAddressValue();
    final XnioWorker.Builder builder = Xnio.getInstance().createWorkerBuilder();

    final OptionMap.Builder optionMapBuilder = OptionMap.builder();

    for (OptionAttributeDefinition attr : WorkerResourceDefinition.ATTRIBUTES) {
        Option option = attr.getOption();
        ModelNode value = attr.resolveModelAttribute(context, model);
        if (!value.isDefined()) {
            continue;
        }
        if (attr.getType() == ModelType.INT) {
            optionMapBuilder.set((Option<Integer>) option, value.asInt());
        } else if (attr.getType() == ModelType.LONG) {
            optionMapBuilder.set(option, value.asLong());
        } else if (attr.getType() == ModelType.BOOLEAN) {
            optionMapBuilder.set(option, value.asBoolean());
        }
    }
    builder.populateFromOptions(optionMapBuilder.getMap());
    builder.setWorkerName(name);

    ModelNode ioThreadsModel = WORKER_IO_THREADS.resolveModelAttribute(context, model);
    ModelNode coreTaskThreadsModel = WORKER_TASK_CORE_THREADS.resolveModelAttribute(context, model);
    ModelNode maxTaskThreadsModel = WORKER_TASK_MAX_THREADS.resolveModelAttribute(context, model);
    int cpuCount = getCpuCount();
    int ioThreadsCalculated = getSuggestedIoThreadCount();
    int workerThreads = builder.getMaxWorkerPoolSize();
    int coreWorkerThreads = coreTaskThreadsModel.asInt();
    if (!ioThreadsModel.isDefined() && !maxTaskThreadsModel.isDefined()) {
        workerThreads = getWorkerThreads(name, allWorkerCount);
        builder.setWorkerIoThreads(ioThreadsCalculated);
        builder.setCoreWorkerPoolSize(coreWorkerThreads);
        builder.setMaxWorkerPoolSize(workerThreads);
        IOLogger.ROOT_LOGGER.printDefaults(name, ioThreadsCalculated, workerThreads, cpuCount);
    } else {
        if (!ioThreadsModel.isDefined()) {
            builder.setWorkerIoThreads(ioThreadsCalculated);
            IOLogger.ROOT_LOGGER.printDefaultsIoThreads(name, ioThreadsCalculated, cpuCount);
        }
        if (!maxTaskThreadsModel.isDefined()) {
            workerThreads = getWorkerThreads(name, allWorkerCount);
            builder.setCoreWorkerPoolSize(coreWorkerThreads);
            builder.setMaxWorkerPoolSize(workerThreads);
            IOLogger.ROOT_LOGGER.printDefaultsWorkerThreads(name, workerThreads, cpuCount);
        }
    }

    registerMax(context, name, workerThreads);

    final CapabilityServiceBuilder<?> capBuilder = context.getCapabilityServiceTarget().addCapability(IO_WORKER_RUNTIME_CAPABILITY);
    final Consumer<XnioWorker> workerConsumer = capBuilder.provides(IO_WORKER_RUNTIME_CAPABILITY);
    final Supplier<ExecutorService> executorSupplier = capBuilder.requiresCapability("org.wildfly.management.executor", ExecutorService.class);
    capBuilder.setInstance(new WorkerService(workerConsumer, executorSupplier, builder));
    capBuilder.setInitialMode(ServiceController.Mode.ON_DEMAND);
    capBuilder.install();
}