Examples of TribesClusteringAgent


Examples of org.apache.axis2.clustering.tribes.TribesClusteringAgent

        throw new CartridgeAgentException(msg, e);
    }

    private ClusteringAgent createClusteringAgent(ConfigurationContext configurationContext,
                                                  String clusterDomain) throws ClusteringFault {
        TribesClusteringAgent agent = new TribesClusteringAgent();
        addParameter(agent, "AvoidInitiation", "true");
        for (String key : conf.stringPropertyNames()) {
            if (key.startsWith("clustering.")) {
                addParameter(agent,
                             key.substring(key.indexOf(".") + 1),
                             conf.getProperty(key));
            }
        }

        List<Member> members = new ArrayList<Member>();
        for (int i = 1; i < Integer.MAX_VALUE; i++) {
            String host = conf.getProperty("members." + i + ".host");
            String port = conf.getProperty("members." + i + ".port");
            if (host == null || port == null) {
                break;
            }
            members.add(new Member(host, Integer.parseInt(port)));
        }
        agent.setMembers(members);

        addParameter(agent, "domain", clusterDomain);
        agent.setConfigurationContext(configurationContext);

        List<MembershipListener> membershipListeners = new ArrayList<MembershipListener>();
        membershipListeners.add(new RegistrantMembershipListener(this, configurationContext));
        agent.setMembershipListeners(membershipListeners);
        return agent;
    }
View Full Code Here

Examples of org.apache.axis2.clustering.tribes.TribesClusteringAgent

    private static ClusteringAgent clusteringAgent;

    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
        configCtx = ConfigurationContextFactory.createEmptyConfigurationContext();
        clusteringAgent = new TribesClusteringAgent();
        clusteringAgent.addGroupManagementAgent(new SubDomainAwareGroupManagementAgent(
                "worker"),
                "wso2.as1.domain", "worker", -1);
        clusteringAgent.addGroupManagementAgent(new SubDomainAwareGroupManagementAgent(
                "mgt"),
View Full Code Here

Examples of org.apache.axis2.clustering.tribes.TribesClusteringAgent

    protected ClusteringAgent getClusterManager(ConfigurationContext configCtx,
                                               StateManager stateManager,
                                               NodeManager configManager)
            throws AxisFault {
        ClusteringAgent clusteringAgent = new TribesClusteringAgent();
        configCtx.getAxisConfiguration().setClusteringAgent(clusteringAgent);
        clusteringAgent.setNodeManager(configManager);
        clusteringAgent.setStateManager(stateManager);
        clusteringAgent.setConfigurationContext(configCtx);

        return clusteringAgent;
    }
View Full Code Here

Examples of org.apache.axis2.clustering.tribes.TribesClusteringAgent

    protected ClusteringAgent getClusterManager(ConfigurationContext configCtx,
                                               StateManager stateManager,
                                               NodeManager configManager)
            throws AxisFault {
        ClusteringAgent clusteringAgent = new TribesClusteringAgent();
        configCtx.getAxisConfiguration().setClusteringAgent(clusteringAgent);
        clusteringAgent.setNodeManager(configManager);
        clusteringAgent.setStateManager(stateManager);
        clusteringAgent.setConfigurationContext(configCtx);

        return clusteringAgent;
    }
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.