Package org.apache.geronimo.datastore.impl.remote.messaging.Topology

Examples of org.apache.geronimo.datastore.impl.remote.messaging.Topology.NodePath


       
        Topology topology = new Topology();
        InetAddress address = InetAddress.getLocalHost();
        NodeInfo node1 = new NodeInfo("node1", address, 8080);
        NodeInfo node2 = new NodeInfo("node2", address, 8080);
        NodePath path1 = new NodePath(node1, node2, weight10, weight10);
        topology.addPath(path1);
        NodeInfo[] path = topology.getPath(node1, node2);
        assertEquals(1, path.length);
       
        NodeInfo node3 = new NodeInfo("node3", address, 8080);
        NodePath path2 = new NodePath(node2, node3, weight10, weight10);
        topology.addPath(path2);
        path = topology.getPath(node1, node3);
        assertEquals(2, path.length);
       
        NodeInfo node4 = new NodeInfo("node4", address, 8080);
        NodePath path3 = new NodePath(node3, node4, weight10, weight10);
        topology.addPath(path3);
        path = topology.getPath(node1, node4);
        assertEquals(3, path.length);
       
        topology.removePath(path3);
        path = topology.getPath(node1, node4);
        assertNull(path);
       
        path3 = new NodePath(node3, node1, weight30, weight10);
        topology.addPath(path3);
        path = topology.getPath(node1, node3);
        assertEquals(1, path.length);
        path = topology.getPath(node3, node1);
        assertEquals(2, path.length);
View Full Code Here


        node.join(primaryNode);
       
        // Sets the topology.
        Topology topology = new Topology();
        PathWeight weight = new PathWeight(10);
        NodePath path = new NodePath(primaryNode, secondaryNode, weight, weight);
        topology.addPath(path);

        kernel1.setAttribute(node1Name, "Topology", topology);
        kernel2.setAttribute(node2Name, "Topology", topology);
    }
View Full Code Here

        node.join(nodeInfo3);

        // Sets the topology.
        Topology topology = new Topology();
        PathWeight weight = new PathWeight(10);
        NodePath path = new NodePath(nodeInfo1, nodeInfo2, weight, weight);
        topology.addPath(path);
        path = new NodePath(nodeInfo2, nodeInfo3, weight, weight);
        topology.addPath(path);
        path = new NodePath(nodeInfo3, nodeInfo4, weight, weight);
        topology.addPath(path);
       
        kernel1.setAttribute(node1Name, "Topology", topology);
        kernel2.setAttribute(node2Name, "Topology", topology);
        kernel3.setAttribute(node3Name, "Topology", topology);
View Full Code Here

        // The second ServerNode joins the first one.
        node.join(node1Info);
       
        Topology topology = new Topology();
        PathWeight weight = new PathWeight(10);
        NodePath path = new NodePath(node1Info, node2Info, weight, weight);
        topology.addPath(path);

        kernel1.setAttribute(node1Name, "Topology", topology);
        kernel2.setAttribute(node2Name, "Topology", topology);
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.datastore.impl.remote.messaging.Topology.NodePath

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.