Package org.jboss.dmr

Examples of org.jboss.dmr.Property


        List<Property> list = operation.asPropertyList();
        Iterator<Property> it= list.iterator();
        webcontext = null;
        webhost = null;
        while(it.hasNext()) {
            Property prop= it.next();
            if (prop.getName().equals("context")) {
                webcontext = prop.getValue().toString();
            }
            if (prop.getName().equals("virtualhost")) {
                webhost = prop.getValue().toString();
            }
            if (prop.getName().equals("waittime")) {
                waittime = Integer.parseInt(RemoveQuotes(prop.getValue().toString()));
            }
        }
        if (webcontext == null || webhost == null)
            throw new OperationFailedException(new ModelNode().set(MESSAGES.needContextAndHost()));
View Full Code Here


        // Add the metric to the dynamic-load-provider.
        final ModelNode metric = new ModelNode();
        List<Property> list = operation.asPropertyList();
        Iterator<Property> it = list.iterator();
        while (it.hasNext()) {
            Property prop = it.next();
            if (prop.getName().equals("property")) {
                String properties = prop.getValue().asString();
                ModelNode props = ModelNode.fromString(properties);
                metric.get("property").set(props);
            } else if (prop.getName().equals("type")) {
                metric.get(prop.getName()).set(prop.getValue().asString());
            }
        }
        if (!metric.get("type").isDefined()) {
            throw new OperationFailedException(new ModelNode().set(MESSAGES.typeAttributeRequired("add-metric")));
        }
View Full Code Here

        String classname = null;
        if (dynamicLoadProvider.isDefined()) {
            List<Property> list = operation.asPropertyList();
            Iterator<Property> it = list.iterator();
            while (it.hasNext()) {
                Property prop = it.next();
                if (prop.getName().equals("class")) {
                    classname = prop.getValue().asString();
                    break;
                }
            }
            if (classname != null) {
                removeMetric(dynamicLoadProvider, classname);
View Full Code Here

                    ModCluster modcluster = (ModCluster) controller.getValue();
                    List<Property> list = operation.asPropertyList();
                    Iterator<Property> it= list.iterator();
                    int waittime = 10;
                    while(it.hasNext()) {
                        Property prop= it.next();
                        if (prop.getName().equals("waittime")) {
                            waittime = Integer.parseInt(ContextHost.RemoveQuotes(prop.getValue().toString()));
                        }
                    }
                    modcluster.stop(waittime);
                    context.completeStep();
                }
View Full Code Here

        }
        while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
            final Element element = Element.forName(reader.getLocalName());
            switch (element) {
                case PROPERTY:
                    final Property property = parseProperty(reader);
                    load.get(CommonAttributes.PROPERTY).add(property.getName(), property.getValue());
                    break;
                default:
                    throw unexpectedElement(reader);
            }
        }
View Full Code Here

        }
        while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
            final Element element = Element.forName(reader.getLocalName());
            switch (element) {
                case PROPERTY:
                    final Property property = parseProperty(reader);
                    load.get(CommonAttributes.PROPERTY).add(property.getName(), property.getValue());
                    break;
                default:
                    throw unexpectedElement(reader);
            }
        }
View Full Code Here

        }
        if (name == null) {
            throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.NAME.getLocalName()));
        }
        ParseUtils.requireNoContent(reader);
        return new Property(name, new ModelNode().set(value == null ? "" : value));
    }
View Full Code Here

        // Add the metric to the dynamic-load-provider.
        final ModelNode metric = new ModelNode();
        List<Property> list = operation.asPropertyList();
        Iterator<Property> it = list.iterator();
        while (it.hasNext()) {
            Property prop = it.next();
            if (prop.getName().equals("property")) {
                String properties = prop.getValue().asString();
                ModelNode props = ModelNode.fromString(properties);
                metric.get("property").set(props);
            } else if (prop.getName().equals("class")) {
                metric.get(prop.getName()).set(prop.getValue().asString());
            }
        }
        if (!metric.get("class").isDefined()) {
            throw new OperationFailedException(
                    new ModelNode().set(MESSAGES.classAttributeRequired("add-custom-metric")));
View Full Code Here

        List<Property> list = operation.asPropertyList();
        Iterator<Property> it= list.iterator();
        host = null;
        port = 0;
        while(it.hasNext()) {
            Property prop= it.next();
            if (prop.getName().equals("host")) {
                host = prop.getValue().toString();
            }
            if (prop.getName().equals("port")) {
                port = Integer.parseInt(ContextHost.RemoveQuotes(prop.getValue().toString()));
            }
        }
        if (host == null || port == 0)
            throw new OperationFailedException(new ModelNode().set(MESSAGES.needContextAndHost()));
View Full Code Here

                compare(list1.get(i), list2.get(i));
                stack.get().pop();
            }

        } else if (node1.getType() == ModelType.PROPERTY) {
            Property prop1 = node1.asProperty();
            Property prop2 = node2.asProperty();
            Assert.assertEquals(prop1 + "\n" + prop2, prop1.getName(), prop2.getName());
            stack.get().push(prop1.getName() + "/");
            compare(prop1.getValue(), prop2.getValue());
            stack.get().pop();

        } else {
            try {
                Assert.assertEquals(getCompareStackAsString() +
View Full Code Here

TOP

Related Classes of org.jboss.dmr.Property

Copyright © 2018 www.massapicom. 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.