Package org.jboss.dmr

Examples of org.jboss.dmr.ModelNode.asInt()


                            break;
                        case DOUBLE:
                            toSet.set(modelValue.asDouble());
                            break;
                        case INT:
                            toSet.set(modelValue.asInt());
                            break;
                        case LONG:
                            toSet.set(modelValue.asLong());
                            break;
                        case STRING:
View Full Code Here


    }

    static String[] aliases(final ModelNode node) {
        if (node.hasDefined(Constants.ALIAS)) {
            final ModelNode aliases = node.require(Constants.ALIAS);
            final int size = aliases.asInt();
            final String[] array = new String[size];
            for (int i = 0; i < size; i++) array[i] = aliases.get(i).asString();
            return array;
        }
        return NO_ALIASES;
View Full Code Here

            interfaceAdd.get(OP).set(ADD);

            final ModelNode criteriaNode = interfaceAdd.get(CRITERIA);
            parseInterfaceCriteria(reader, criteriaNode);

            if (checkSpecified && criteriaNode.getType() != ModelType.STRING && criteriaNode.getType() != ModelType.EXPRESSION && criteriaNode.asInt() == 0) {
                throw unexpectedEndElement(reader);
            }
            list.add(interfaceAdd);
        }
    }
View Full Code Here

   *            the name of the property
   * @return the property as an Integer
   */
  private int getAsInteger(final ModelNode node, String propertyName) {
    final ModelNode propertyNode = node.get(propertyName);
    return propertyNode.isDefined() ? propertyNode.asInt() : 0;
  }
 
  private List<EnvironmentVariableResourceDTO> createEnvironmentVariables(ModelNode rootNode)
      throws OpenShiftException {
    final List<EnvironmentVariableResourceDTO> environmentVariables = new ArrayList<EnvironmentVariableResourceDTO>();
View Full Code Here

    }

    static String[] aliases(final ModelNode node) {
        if (node.hasDefined(Constants.ALIAS)) {
            final ModelNode aliases = node.require(Constants.ALIAS);
            final int size = aliases.asInt();
            final String[] array = new String[size];
            for (int i = 0; i < size; i++) array[i] = aliases.get(i).asString();
            return array;
        }
        return NO_ALIASES;
View Full Code Here

        if (!blocking) {
            ModelNode handoffEx = PoolAttributeDefinitions.HANDOFF_EXECUTOR.resolveModelAttribute(context, model);
            params.handoffExecutor = handoffEx.isDefined() ? handoffEx.asString() : null;
        }
        ModelNode coreTh = PoolAttributeDefinitions.CORE_THREADS.resolveModelAttribute(context, model);
        params.coreThreads = coreTh.isDefined() ? coreTh.asInt() : params.maxThreads;
        params.queueLength = PoolAttributeDefinitions.QUEUE_LENGTH.resolveModelAttribute(context, model).asInt();
        return params;
    }

View Full Code Here

        if (CommonAttributes.GROUP_NAME.equals(attributeName)) {
            final ModelNode value = PoolAttributeDefinitions.GROUP_NAME.resolveModelAttribute(context, operation);
            tf.setThreadGroupName(value.isDefined() ? value.asString() : null);
        } else if(CommonAttributes.PRIORITY.equals(attributeName)) {
            final ModelNode value = PoolAttributeDefinitions.PRIORITY.resolveModelAttribute(context, operation);
            tf.setPriority(value.isDefined() ? value.asInt() : -1);
        } else if(CommonAttributes.THREAD_NAME_PATTERN.equals(attributeName)) {
            final ModelNode value = PoolAttributeDefinitions.THREAD_NAME_PATTERN.resolveModelAttribute(context, operation);
            tf.setNamePattern(value.isDefined() ? value.asString() : null);
        } else if (!forRollback) {
            // Programming bug. Throw a RuntimeException, not OFE, as this is not a client error
View Full Code Here

        }

        @Override
        protected ModelNode correctValue(ModelNode toResolve, boolean isWriteAttribute) {
            ModelNode value = super.correctValue(toResolve, isWriteAttribute);
            return new ModelNode(value.asInt());
        }
    }

    private static final class BooleanExpressionConfig extends RejectExpressionsConfig {
View Full Code Here

    private OptionMap getChannelCreationOptions(final OperationContext context) throws OperationFailedException {
        // read the full model of the current resource
        final ModelNode fullModel = Resource.Tools.readModel(context.readResource(PathAddress.EMPTY_ADDRESS));
        final ModelNode channelCreationOptions = fullModel.get(EJB3SubsystemModel.CHANNEL_CREATION_OPTIONS);
        if (channelCreationOptions.isDefined() && channelCreationOptions.asInt() > 0) {
            final ClassLoader loader = this.getClass().getClassLoader();
            final OptionMap.Builder builder = OptionMap.builder();
            for (final Property optionProperty : channelCreationOptions.asPropertyList()) {
                final String name = optionProperty.getName();
                final ModelNode propValueModel = optionProperty.getValue();
View Full Code Here

                final ModelNode localAddrNode = CommonAttributes.LOCAL_BIND_ADDRESS.resolveModelAttribute(context, model);
                final String localAddress = localAddrNode.isDefined() ? localAddrNode.asString() : null;
                final ModelNode groupAddrNode = CommonAttributes.GROUP_ADDRESS.resolveModelAttribute(context, model);
                final String groupAddress = groupAddrNode.isDefined() ? groupAddrNode.asString() : null;
                final ModelNode groupPortNode = CommonAttributes.GROUP_PORT.resolveModelAttribute(context, model);
                final int groupPort = groupPortNode.isDefined() ? groupPortNode.asInt() : -1;

                try {

                    final InetAddress inet = localAddress != null ? InetAddress.getByName(localAddress) : InetAddressUtil.getLocalHost();
                    final NetworkInterface intf = NetworkInterface.getByInetAddress(inet);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.