当前位置: 首页>>代码示例>>Java>>正文


Java Property.getValue方法代码示例

本文整理汇总了Java中org.jboss.dmr.Property.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java Property.getValue方法的具体用法?Java Property.getValue怎么用?Java Property.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.dmr.Property的用法示例。


在下文中一共展示了Property.getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getChildDescription

import org.jboss.dmr.Property; //导入方法依赖的package包/类
/**
 * Looks for the description of a specific child resource.
 * @param type The type of the child resource
 * @param name The name of the instance
 * @return the description of the specific child resource or {@link #EMPTY} if no such resource exists.
 */
public ResourceDescription getChildDescription(String type, String name) {
    if (hasChildrenDefined()) {
        List<Property> children = get("children").asPropertyList();
        for (Property child : children) {
            if (type.equals(child.getName()) && child.getValue().hasDefined(MODEL_DESCRIPTION)) {
                List<Property> modelDescriptions = child.getValue().get(MODEL_DESCRIPTION).asPropertyList();
                for (Property modelDescription : modelDescriptions) {
                    if (name.equals(modelDescription.getName())) {
                        return new ResourceDescription(modelDescription.getValue());
                    }
                }
            }
        }
    }
    return EMPTY;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-config-api,代码行数:23,代码来源:ResourceDescription.java

示例2: getSystemProperties

import org.jboss.dmr.Property; //导入方法依赖的package包/类
/**
 * This returns the system properties that are set in the AS JVM. This is not the system properties
 * in the JVM of this client object - it is actually the system properties in the remote
 * JVM of the AS instance that the client is talking to.
 *
 * @return the AS JVM's system properties
 * @throws Exception any error
 */
public Properties getSystemProperties() throws Exception {
    final String[] address = { CORE_SERVICE, PLATFORM_MBEAN, "type", "runtime" };
    final ModelNode op = createReadAttributeRequest(true, "system-properties", Address.root().add(address));
    final ModelNode results = execute(op);
    if (isSuccess(results)) {
        // extract the DMR representation into a java Properties object
        final Properties sysprops = new Properties();
        final ModelNode node = getResults(results);
        final List<Property> propertyList = node.asPropertyList();
        for (Property property : propertyList) {
            final String name = property.getName();
            final ModelNode value = property.getValue();
            if (name != null) {
                sysprops.put(name, value != null ? value.asString() : "");
            }
        }
        return sysprops;
    } else {
        throw new FailureException(results, "Failed to get system properties");
    }
}
 
开发者ID:hawkular,项目名称:hawkular-agent,代码行数:30,代码来源:CoreJBossASClient.java

示例3: writeProperties

import org.jboss.dmr.Property; //导入方法依赖的package包/类
void writeProperties(final XMLExtendedStreamWriter writer, final ModelNode modelNode, Element element,
        boolean standalone) throws XMLStreamException {
    final List<Property> properties = modelNode.asPropertyList();
    if (properties.size() > 0) {
        writer.writeStartElement(element.getLocalName());
        for (Property prop : properties) {
            writer.writeStartElement(Element.PROPERTY.getLocalName());
            writer.writeAttribute(NAME, prop.getName());
            ModelNode sysProp = prop.getValue();
            SystemPropertyResourceDefinition.VALUE.marshallAsAttribute(sysProp, writer);
            if (!standalone) {
                SystemPropertyResourceDefinition.BOOT_TIME.marshallAsAttribute(sysProp, writer);
            }

            writer.writeEndElement();
        }
        writer.writeEndElement();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:20,代码来源:SystemPropertiesXml.java

示例4: processSubsystems

import org.jboss.dmr.Property; //导入方法依赖的package包/类
/**
 * Create the transformers. This will remotely resolve the subsystem versions.
 *
 * @param extensions the extensions
 * @throws OperationFailedException
 */
private void processSubsystems(final Transformers transformers, final ModelNode extensions) throws OperationFailedException {
    this.transformers = transformers;
    final ModelNode subsystems = executeBlocking(new IOTask<ModelNode>() {
        @Override
        void sendMessage(FlushableDataOutput output) throws IOException {
            sendResponse(output, DomainControllerProtocol.PARAM_OK, extensions);
        }
    });
    if(failed) {
        throw new OperationFailedException("failed to setup transformers");
    }
    final TransformationTarget target = transformers.getTarget();
    for(final Property subsystem : subsystems.asPropertyList()) {
        final String subsystemName = subsystem.getName();
        final ModelNode version = subsystem.getValue();
        target.addSubsystemVersion(subsystemName, ModelVersion.fromString(version.asString()));
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:25,代码来源:HostControllerRegistrationHandler.java

示例5: testObjectWithList

import org.jboss.dmr.Property; //导入方法依赖的package包/类
@Test
public void testObjectWithList() throws Exception {
    final ModelNode value = parse("a=b,c=[d,e]");
    assertNotNull(value);
    assertEquals(ModelType.OBJECT, value.getType());
    final List<Property> list = value.asPropertyList();
    assertEquals(2, list.size());
    Property prop = list.get(0);
    assertNotNull(prop);
    assertEquals("a", prop.getName());
    assertEquals("b", prop.getValue().asString());
    prop = list.get(1);
    assertNotNull(prop);
    assertEquals("c", prop.getName());
    final ModelNode de = prop.getValue();
    assertEquals(ModelType.LIST, de.getType());
    final List<ModelNode> deList = de.asList();
    assertEquals(2, deList.size());
    assertEquals("d", deList.get(0).asString());
    assertEquals("e", deList.get(1).asString());
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:22,代码来源:ArgumentValueParsingTestCase.java

示例6: getJVMRestartOperations

import org.jboss.dmr.Property; //导入方法依赖的package包/类
private Map<Set<ServerIdentity>, ModelNode> getJVMRestartOperations(final PathAddress address, final ModelNode hostModel) {
    // See which servers are affected by this JVM change
    final String pathName = address.getElement(0).getValue();
    final Map<Set<ServerIdentity>, ModelNode> result;
    if (hostModel.hasDefined(SERVER_CONFIG)) {
        final Set<ServerIdentity> servers = new HashSet<ServerIdentity>();
        for (Property prop : hostModel.get(SERVER_CONFIG).asPropertyList()) {
            final String serverName = prop.getName();
            if (serverProxies.get(serverName) == null) {
                // No running server
                continue;
            }
            final ModelNode server = prop.getValue();
            if (server.hasDefined(JVM) && server.get(JVM).keys().contains(pathName)) {
                final String serverGroupName = server.require(GROUP).asString();
                final ServerIdentity groupedServer = new ServerIdentity(localHostName, serverGroupName, serverName);
                servers.add(groupedServer);
            }
        }
        result = getServerRestartRequiredOperations(servers);
    } else {
        result = Collections.emptyMap();
    }
    return result;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:26,代码来源:ServerOperationResolver.java

示例7: getServersForGroup

import org.jboss.dmr.Property; //导入方法依赖的package包/类
public static Set<ServerIdentity> getServersForGroup(String groupName, ModelNode hostModel, final String localHostName, final Map<String, ProxyController> serverProxies) {
    Set<ServerIdentity> result;
    if (hostModel.hasDefined(SERVER_CONFIG)) {
        result = new HashSet<ServerIdentity>();
        for (Property prop : hostModel.get(SERVER_CONFIG).asPropertyList()) {
            String serverName = prop.getName();
            if (serverProxies.get(serverName) == null) {
                continue;
            }
            ModelNode server = prop.getValue();
            String serverGroupName = server.require(GROUP).asString();
            if (groupName != null && !groupName.equals(serverGroupName)) {
                continue;
            }
            ServerIdentity groupedServer = new ServerIdentity(localHostName, serverGroupName, serverName);
            result.add(groupedServer);
        }
    } else {
        result = Collections.emptySet();
    }
    return result;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:23,代码来源:DomainServerUtils.java

示例8: getGlobalSuggestedCount

import org.jboss.dmr.Property; //导入方法依赖的package包/类
private static int getGlobalSuggestedCount(final OperationContext context, final ModelNode workers) throws OperationFailedException {
    int count = 0;
    if (!workers.isDefined()){
        return count;
    }
    for (Property property : workers.asPropertyList()) {
        ModelNode worker = property.getValue();
        ModelNode ioThreadsModel = WORKER_IO_THREADS.resolveModelAttribute(context, worker);
        ModelNode maxTaskThreadsModel = WORKER_TASK_MAX_THREADS.resolveModelAttribute(context, worker);
        if (ioThreadsModel.isDefined()) {
            count += ioThreadsModel.asInt();
        } else {
            count += getSuggestedIoThreadCount();
        }
        if (maxTaskThreadsModel.isDefined()) {
            count += maxTaskThreadsModel.asInt();
        } else {
            count += getSuggestedTaskCount();
        }
    }
    return count;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:23,代码来源:WorkerAdd.java

示例9: validateParameter

import org.jboss.dmr.Property; //导入方法依赖的package包/类
@Override
public void validateParameter(String parameterName, ModelNode values) throws OperationFailedException {
    for (Property property : values.asPropertyList()) {
        if (!VALID_PROPERTIES.containsKey(property.getName())) {
            throw new OperationFailedException("Invalid property name: " + property.getName());
        }

        if (!VALID_PROPERTIES.get(property.getName()).contains(property.getValue().asString().toUpperCase())) {
            throw new OperationFailedException(
                    "Invalid value of property " + property.getName() + ": " + property.getValue());
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:14,代码来源:PropertiesValidator.java

示例10: writeContent

import org.jboss.dmr.Property; //导入方法依赖的package包/类
/**
 * {@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(SmppMbeanDefinition.MBEAN);

    for (Property mbeanProp : mbean.asPropertyList()) {
        writer.writeStartElement(SmppMbeanDefinition.MBEAN);

        final ModelNode mbeanEntry = mbeanProp.getValue();

        SmppMbeanDefinition.NAME_ATTR.marshallAsAttribute(mbeanEntry, true, writer);
        SmppMbeanDefinition.TYPE_ATTR.marshallAsAttribute(mbeanEntry, true, writer);

        final ModelNode property = mbeanEntry.get(SmppMbeanPropertyDefinition.PROPERTY);
        if (property != null && property.isDefined()) {
            for (Property propertyProp : property.asPropertyList()) {
                writer.writeStartElement(SmppMbeanPropertyDefinition.PROPERTY);

                final ModelNode propertyEntry = propertyProp.getValue();

                SmppMbeanPropertyDefinition.NAME_ATTR.marshallAsAttribute(propertyEntry, true, writer);
                SmppMbeanPropertyDefinition.TYPE_ATTR.marshallAsAttribute(propertyEntry, true, writer);
                SmppMbeanPropertyDefinition.VALUE_ATTR.marshallAsAttribute(propertyEntry, true, writer);

                writer.writeEndElement();
            }
        }

        writer.writeEndElement();
    }

    writer.writeEndElement();
}
 
开发者ID:RestComm,项目名称:smpp-extensions,代码行数:39,代码来源:SmppSubsystemParser.java

示例11: writeThreadFactory

import org.jboss.dmr.Property; //导入方法依赖的package包/类
public void writeThreadFactory(final XMLExtendedStreamWriter writer, final Property property, final String elementName, final boolean includeName) throws XMLStreamException {
    writer.writeStartElement(elementName);
    ModelNode node = property.getValue();
    if (includeName) {
        writer.writeAttribute(Attribute.NAME.getLocalName(), property.getName());
    }
    PoolAttributeDefinitions.GROUP_NAME.marshallAsAttribute(node, writer);
    PoolAttributeDefinitions.THREAD_NAME_PATTERN.marshallAsAttribute(node, writer);
    PoolAttributeDefinitions.PRIORITY.marshallAsAttribute(node, writer);
    writer.writeEndElement();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:12,代码来源:ThreadsParser.java

示例12: writeContent

import org.jboss.dmr.Property; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException {
    context.startSubsystemElement(Namespace.CURRENT.getUriString(), false);
    ModelNode scanners = context.getModelNode();
    for (final Property list : scanners.asPropertyList()) {

        final ModelNode node = list.getValue();

        for (final Property scanner : node.asPropertyList()) {

            final String scannerName = scanner.getName();
            final ModelNode configuration = scanner.getValue();

            writer.writeEmptyElement(DEPLOYMENT_SCANNER);

            if (!DeploymentScannerExtension.DEFAULT_SCANNER_NAME.equals(scannerName)) {
                writer.writeAttribute(NAME, scannerName);
            }

            DeploymentScannerDefinition.PATH.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.RELATIVE_TO.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.SCAN_ENABLED.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.SCAN_INTERVAL.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.AUTO_DEPLOY_ZIPPED.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.AUTO_DEPLOY_EXPLODED.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.AUTO_DEPLOY_XML.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.DEPLOYMENT_TIMEOUT.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.RUNTIME_FAILURE_CAUSES_ROLLBACK.marshallAsAttribute(configuration, writer);
        }
        writer.writeEndElement();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:36,代码来源:DeploymentScannerParser_2_0.java

示例13: writeContent

import org.jboss.dmr.Property; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException {
    context.startSubsystemElement(Namespace.CURRENT.getUriString(), false);
    ModelNode scanners = context.getModelNode();
    for (final Property list : scanners.asPropertyList()) {

        final ModelNode node = list.getValue();

        for (final Property scanner : node.asPropertyList()) {

            final String scannerName = scanner.getName();
            final ModelNode configuration = scanner.getValue();

            writer.writeEmptyElement(DEPLOYMENT_SCANNER);

            if (!DeploymentScannerExtension.DEFAULT_SCANNER_NAME.equals(scannerName)) {
                writer.writeAttribute(NAME, scannerName);
            }

            DeploymentScannerDefinition.PATH.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.RELATIVE_TO.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.SCAN_ENABLED.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.SCAN_INTERVAL.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.AUTO_DEPLOY_ZIPPED.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.AUTO_DEPLOY_EXPLODED.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.AUTO_DEPLOY_XML.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.DEPLOYMENT_TIMEOUT.marshallAsAttribute(configuration, writer);
        }
        writer.writeEndElement();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:35,代码来源:DeploymentScannerParser_1_1.java

示例14: writeUnboundedQueueThreadPool

import org.jboss.dmr.Property; //导入方法依赖的package包/类
public void writeUnboundedQueueThreadPool(final XMLExtendedStreamWriter writer, final Property property, final String elementName, final boolean includeName)
        throws XMLStreamException {
    writer.writeStartElement(elementName);
    ModelNode node = property.getValue();
    if (includeName) {
        writer.writeAttribute(Attribute.NAME.getLocalName(), property.getName());
    }
    writeCountElement(PoolAttributeDefinitions.MAX_THREADS, node, writer);
    writeTime(writer, node, Element.KEEPALIVE_TIME);
    writeRef(writer, node, Element.THREAD_FACTORY, THREAD_FACTORY);

    writer.writeEndElement();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:14,代码来源:ThreadsParser.java

示例15: listDeployments

import org.jboss.dmr.Property; //导入方法依赖的package包/类
public static void listDeployments(CommandContext ctx,
        boolean l) throws CommandException {
    if (!l) {
        printList(ctx, Util.getDeployments(ctx.
                getModelControllerClient()), l);
        return;
    }
    final ModelControllerClient client = ctx.getModelControllerClient();
    final List<String> names = Util.getDeployments(client);
    if (names.isEmpty()) {
        return;
    }

    final StrictSizeTable table = new StrictSizeTable(names.size());
    final List<Property> descriptions = getDeploymentDescriptions(ctx, names).
            asPropertyList();
    for (Property prop : descriptions) {
        final ModelNode step = prop.getValue();
        if (step.hasDefined(Util.RESULT)) {
            final ModelNode result = step.get(Util.RESULT);
            table.addCell(Util.NAME, result.get(Util.NAME).asString());
            table.addCell(Util.RUNTIME_NAME, result.get(Util.RUNTIME_NAME).
                    asString());
            if (result.has(Util.ENABLED)) {
                table.addCell(Util.ENABLED, result.get(Util.ENABLED).asString());
            }
            if (result.has(Util.PERSISTENT)) {
                table.addCell(Util.PERSISTENT, result.get(Util.PERSISTENT).asString());
            }
            if (result.has(Util.STATUS)) {
                table.addCell(Util.STATUS, result.get(Util.STATUS).asString());
            }
        }
        if (!table.isAtLastRow()) {
            table.nextRow();
        }
    }
    ctx.printLine(table.toString());
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:40,代码来源:ListCommand.java


注:本文中的org.jboss.dmr.Property.getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。