Examples of asList()


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

        ModelNode result = execute(op);
        Set<String> names = new HashSet<String>();
        if(! result.isDefined()) {
            return Collections.emptySet();
        }
        for (ModelNode deployment : result.asList()) {
            names.add(deployment.asString());
        }
        return names;
    }
View Full Code Here

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

                } else {
                    // we should never get here
                    throw new RuntimeException("Unkown criteria type: " + value);
                }
            } else if (criteria.getType() == ModelType.LIST) {
                List<ModelNode> values = criteria.asList();
                writeInterfaceCriteria(writer, values);

            } else {
                throw new RuntimeException("Unkown type for criteria node " + criteria);
            }
View Full Code Here

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

    public static void addHandlers(final AttributeDefinition attribute, final ModelNode node, final OperationContext context,
                                   final String asyncHandlerName) throws OperationFailedException {
        final ModelNode handlers = attribute.resolveModelAttribute(context, node);
        if (handlers.isDefined()) {
            if (handlers.getType() == ModelType.LIST) {
                for (ModelNode handler : handlers.asList()) {
                    addHandler(context, asyncHandlerName, handler.asString());
                }
            }
        }
    }
View Full Code Here

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

        if (handlerExists(handlerName, handlerAttribute, model)) {
            // Get the current subhandlers
            final ModelNode currentSubhandlers = model.get(handlerAttribute.getName());
            // Create new list of subhandlers without the handler being removed
            final List<ModelNode> newSubhandlers = new ArrayList<ModelNode>();
            for (ModelNode node : currentSubhandlers.asList()) {
                if (node.asString().equals(handlerName)) {
                    continue;
                }
                newSubhandlers.add(node);
            }
View Full Code Here

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

     * @throws OperationFailedException if an operation failure occurs.
     */
    protected boolean handlerExists(final String handlerName, final AttributeDefinition handlerAttribute, final ModelNode model) throws OperationFailedException {
        final ModelNode assignedHandlers = model.get(handlerAttribute.getName());
        if (assignedHandlers.isDefined()) {
            final List<ModelNode> handlers = assignedHandlers.asList();
            for (ModelNode handler : handlers) {
                if (handler.asString().equals(handlerName)) {
                    return true;
                }
            }
View Full Code Here

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

    @Override
    protected void updateRuntime(final OperationContext context, final ServiceBuilder<Handler> serviceBuilder, final String name, final AsyncHandlerService service, final ModelNode model) throws OperationFailedException {
        final List<InjectedValue<Handler>> list = new ArrayList<InjectedValue<Handler>>();
        final ModelNode subhandlers = SUBHANDLERS.resolveModelAttribute(context, model);
        if (subhandlers.isDefined()) {
            for (final ModelNode handlerName : subhandlers.asList()) {
                final InjectedValue<Handler> injectedValue = new InjectedValue<Handler>();
                serviceBuilder.addDependency(LogServices.handlerName(handlerName.asString()), Handler.class, injectedValue);
                list.add(injectedValue);
            }
        }
View Full Code Here

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

    public static void removeHandlers(final AttributeDefinition attribute, final ModelNode node, final OperationContext context,
                                   final String asyncHandlerName) throws OperationFailedException {
        final ModelNode handlers = attribute.resolveModelAttribute(context, node);
        if (handlers.isDefined()) {
            if (handlers.getType() == ModelType.LIST) {
                for (ModelNode handler : handlers.asList()) {
                    removeHandler(context, asyncHandlerName, handler.asString());
                }
            }
        }
    }
View Full Code Here

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

        ModelNode op = new ModelNode();
        op.get("operation").set("read-children-names");
        op.get("child-type").set("host");
        ModelNode result = executeForResult(new OperationBuilder(op).build());
        List<String> hosts = new ArrayList<String>();
        for (ModelNode host : result.asList()) {
            hosts.add(host.asString());
        }
        return hosts;
    }
View Full Code Here

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

        op.get("operation").set("read-children-names");
        op.get("child-type").set("server-config");
        op.get("address").add("host", host);
        ModelNode result = executeForResult(new OperationBuilder(op).build());
        Set<String> servers = new HashSet<String>();
        for (ModelNode server : result.asList()) {
            servers.add(server.asString());
        }
        return servers;
    }
View Full Code Here

Examples of org.jboss.dmr.client.ModelNode.asList()

                        value = "";
                }
                else if ("java.util.List".equals(propBinding.getJavaTypeName()))
                {
                    ModelNode list = actualPayload.get(splitDetypedName);
                    if (list.isDefined() && propValue.isDefined() && !list.asList().isEmpty()) {
                        if (list.asList().get(0).getType().equals(ModelType.PROPERTY)) {
                            value = propBinding.getEntityAdapterForList().fromDMRPropertyList(list.asPropertyList());
                        } else {
                            value = propBinding.getEntityAdapterForList().fromDMRList(list.asList());
                        }
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.