Examples of Node


Examples of org.apache.servicemix.maven.plugin.jbi.JbiResolutionListener.Node

        return projectHelper;
    }

    protected void removeBranch(JbiResolutionListener listener,
            Artifact artifact) {
        Node n = listener.getNode(artifact);
        if (n != null) {
            for (Iterator it = n.getParents().iterator(); it.hasNext();) {
                Node parent = (Node) it.next();
                parent.getChildren().remove(n);
            }
        }
    }

Examples of org.apache.shale.clay.parser.Node

     * @param messages error messages
     */
    private void checkForInvalidNestedTags(String prefix, Node clayNode, List messages) {
        List children = clayNode.getChildren();
        next: for (int i = 0; i < children.size(); i++) {
            Node child = (Node) children.get(i);
            if ((!child.isComment() && !child.isCdata()) && child.isWellFormed()) {
                if (child.getQname() != null && child.getName() != null) {

                    if (child.getQname().equals("jsp") && child.getName().equals("text")) {
                        continue next;
                    else if (!child.getName().equals("symbol") || !prefix.equals(child.getQname())) {
                        messages.add(getMessage(prefix, clayNode, child));
                    }
                }

            }

Examples of org.apache.stratos.lb.common.conf.structure.Node

    }

    public final void testBuildNode() {

        // Testing a node only has properties
        Node a = new Node();
        a.setName("loadbalancer");

        content =
            "securityGroups      stratos-appserver-lb;\ninstanceType        m1.large;\n"
                + "instances           1;\nelasticIP           ${ELASTIC_IP};\n"
                + "availabilityZone    us-east-1c;\npayload             /mnt/payload.zip;";

        a = NodeBuilder.buildNode(a, content);

        assertEquals("loadbalancer", a.getName());
        assertEquals("stratos-appserver-lb", a.getProperty("securityGroups"));
        assertEquals("${ELASTIC_IP}", a.getProperty("elasticIP"));
        assertEquals("/mnt/payload.zip", a.getProperty("payload"));
        assertNull(a.getProperty("payloader"));

        // Testing a node has sub nodes and properties
        a = new Node();
        a.setName("appserver");

        content =
            "hosts                   appserver.cloud-test.wso2.com,as.cloud-test.wso2.com;\n"
                + "domains   {\n" + "wso2.as1.domain {\n" + "tenant_range    1-100;\n" + "}\n"
                + "wso2.as2.domain {\n" + "tenant_range    101-200;\n" + "}\n"
                + "wso2.as3.domain { # domain\n" + "tenant_range    *;\n" + "}\n" + "}\n"
                + "# line comment \n"
                + "payload                 resources/cluster_node.zip;# payload\n"
                + "availability_zone       us-east-1c;\n";

        a = NodeBuilder.buildNode(a, content);

        assertEquals("appserver", a.getName());
        assertEquals(1, a.getChildNodes().size());
        assertEquals("domains", a.getChildNodes().get(0).getName());
        assertEquals("appserver.cloud-test.wso2.com,as.cloud-test.wso2.com",
                            a.getProperty("hosts"));
        assertEquals("resources/cluster_node.zip", a.getProperty("payload"));
        assertEquals(null, a.getProperty("payloader"));

        Node b = a.getChildNodes().get(0);

        assertEquals(3, b.getChildNodes().size());
        assertEquals(null, b.getProperty("payload"));

        Node c = b.getChildNodes().get(0);

        assertEquals(0, c.getChildNodes().size());
        assertEquals("1-100", c.getProperty("tenant_range"));

        c = b.getChildNodes().get(2);

        assertEquals(0, c.getChildNodes().size());
        assertEquals("*", c.getProperty("tenant_range"));
       
        String nodeStr = "appserver {\n" +
                "\thosts\tappserver.cloud-test.wso2.com,as.cloud-test.wso2.com;\n" +
                "\tpayload\tresources/cluster_node.zip;\n" +
            "\tavailability_zone\tus-east-1c;\n" +
            "\tdomains {\n" +
            "\t\twso2.as1.domain {\n" +
            "\t\t\ttenant_range\t1-100;\n" +
            "\t\t}\n" +
            "\t\twso2.as2.domain {\n" +
            "\t\t\ttenant_range\t101-200;\n" +
            "\t\t}\n" +
            "\t\twso2.as3.domain {\n" +
            "\t\t\ttenant_range\t*;\n" +
            "\t\t}\n" +
            "\t}\n" +
            "}";
       
        assertEquals(nodeStr, a.toString());
       
        // test equals method
        assertEquals(true, a.equals(a));
        assertEquals(false, a.equals(b));
        assertEquals(false, c.equals(b));
       
        // test buildNode(String)
        c = NodeBuilder.buildNode(nodeStr);
       
        assertEquals(c.getName(), "appserver");
        assertEquals(c.getChildNodes().size(), 1);
        assertEquals(c.getProperty("availability_zone"), "us-east-1c");

    }

Examples of org.apache.stratos.load.balancer.conf.structure.Node

                while (scanner.hasNextLine()) {
                    configFileContent.append(scanner.nextLine().trim() + "\n");
                }

                // Build node structure
                Node loadBalancerNode = NodeBuilder.buildNode(configFileContent.toString());
                // Transform node structure to configuration
                LoadBalancerConfiguration configuration = transform(loadBalancerNode);
                return configuration;
            } catch (Exception e) {
                throw new InvalidConfigurationException(String.format("Could not read load balancer configuration: %s", configFilePath), e);

Examples of org.apache.struts2.el.parser.Node

            this.varMapper = new VariableMapperFactory(ctxVar);
        }
    }

    public final static Node createNode(String expr) throws ELException {
        Node n = createNodeInternal(expr);
        return n;
    }

Examples of org.apache.tapestry5.dom.Node

  private Element findTable(Element container) {
    List<Node> topChildren = container.getChildren();
    if (topChildren.isEmpty()) {
      throw new IllegalStateException(String.format("Element has no children (%s)", container));
    }
    Node lastChild = topChildren.get(topChildren.size() - 1);
    if (lastChild instanceof Element) {
      Element table = ((Element) lastChild).find("table");
      if (table != null) {
        return table;
      }

Examples of org.apache.tuscany.sca.Node

public class TuscanyRuntimeTestCase {

    @Test
    public void testInstallDeployable() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
        Node node = TuscanyRuntime.newInstance().createNode("default");
        node.installContribution("helloworld", "src/test/resources/sample-helloworld.jar", null, null, true);

        Helloworld helloworldService = node.getService(Helloworld.class, "HelloworldComponent");
        Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
    }

Examples of org.apache.tuscany.sca.domain.model.Node

   
    public String addNode(String nodeURI, String nodeURL){
        // try and remove it first just in case it's already registered
        removeNode(nodeURI);
       
        Node node = domainModelFactory.createNode();
        node.setNodeURI(nodeURI);
        node.setNodeURL(nodeURL);
        domainModel.getNodes().put(nodeURI, node);    
       
        logger.log(Level.INFO, "Registered node: " +
                               nodeURI +
                               " at endpoint " +

Examples of org.apache.tuscany.sca.node.Node

    }

    List<?> start(final String name, final String cloc, final String dcuri) {
        if(nodes.containsKey(name))
            return emptyList();
        final Node node = dcuri != null? nf.createNode(dcuri, new Contribution(cloc, cloc)) : nf.createNode(new Contribution(cloc, cloc));
        nodes.put(name, new Nodeconf(name, cloc, dcuri, node));
        node.start();
        return emptyList();
    }

Examples of org.apache.tuscany.sca.node2.Node

                if (domainURI.equals(node.getDomainName())) {
                    currentDomain = node.getDomainName();
                    return true;
                }
            }
            Node node = factory.createNode(domainURI);
            currentDomain = node.getDomainName();
            nodes.put(currentDomain, node);
        }
        return true;
    }
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.