Package org.apache.axis2.clustering

Examples of org.apache.axis2.clustering.ClusteringAgent


        return cartridge;
    }

    private static List<Member> getMemberInstances(String domain, String subDomain) {

        ClusteringAgent clusteringAgent = DataHolder.getServerConfigContext()
                .getAxisConfiguration().getClusteringAgent();
        GroupManagementAgent groupMgtAgent = clusteringAgent.getGroupManagementAgent(domain, subDomain);

        if (groupMgtAgent == null) {
            log.warn("Group Management Agent not found for domain : " + domain +
                    ", sub domain : " + subDomain);
            return null;
View Full Code Here


    private static StateManager getStateManager(AbstractContext abstractContext) {
        return getClusterManager(abstractContext).getStateManager();
    }

    private static StateManager getStateManager(AxisConfiguration axisConfiguration) {
        ClusteringAgent clusteringAgent = axisConfiguration.getClusteringAgent();
        if (clusteringAgent != null) {
            return clusteringAgent.getStateManager();
        }
        return null;
    }
View Full Code Here

     * @param abstractContext The context to be subjected to this test
     * @return true - State needs to be replicated
     *         false - otherwise
     */
    private static boolean canReplicate(AbstractContext abstractContext) {
        ClusteringAgent clusteringAgent =
                abstractContext.getRootContext().getAxisConfiguration().getClusteringAgent();
        boolean canReplicate = false;
        if (clusteringAgent != null && clusteringAgent.getStateManager() != null) {
            canReplicate =
                    clusteringAgent.getStateManager().isContextClusterable(abstractContext);
        }
        return canReplicate;
    }
View Full Code Here

     * @param messageContext The MessageContext to be subjected to this test
     * @return true - State needs to be replicated
     *         false - otherwise
     */
    private static boolean canReplicate(MessageContext messageContext) {
        ClusteringAgent clusteringAgent =
                messageContext.getRootContext().getAxisConfiguration().getClusteringAgent();
        return clusteringAgent != null && clusteringAgent.getStateManager() != null;
    }
View Full Code Here

public class ClusterAdmin {

    private static final Log log = LogFactory.getLog(ClusterAdmin.class);

    public GroupMember[] getMembers(String groupName) throws Exception {
        ClusteringAgent clusteringAgent = getClusteringAgent();
        GroupManagementAgent groupManagementAgent =
                clusteringAgent.getGroupManagementAgent(groupName);
        if (groupManagementAgent == null) {
            handleException("No GroupManagementAgent defined for domain " + groupName);
            return null;
        }
        List<Member> members = groupManagementAgent.getMembers();
View Full Code Here

        return groupMembers;
    }

    public Group[] getGroups() throws Exception {
        ClusteringAgent clusteringAgent = getClusteringAgent();
        List<Group> groups = new ArrayList<Group>();
        Set<String> groupNames = clusteringAgent.getDomains();
        for (String groupName : groupNames) {
            Group group = new Group();
            group.setName(groupName);
            GroupManagementAgent gmAgent = clusteringAgent.getGroupManagementAgent(groupName);
            List<Member> memberList = gmAgent.getMembers();
            group.setDescription(gmAgent.getDescription());
            group.setNumberOfMembers(memberList.size());
            groups.add(group);
        }
View Full Code Here

    public void endClusterMaintenance() throws Exception {
        sendToCluster(new EndMaintenanceCommand());
    }

    private void sendToCluster(GroupManagementCommand cmd) throws AxisFault {
        ClusteringAgent clusteringAgent = getClusteringAgent();
        Set<String> groupNames = clusteringAgent.getDomains();
        for (String groupName : groupNames) {
            GroupManagementAgent managementAgent =
                    clusteringAgent.getGroupManagementAgent(groupName);
            managementAgent.send(cmd);
        }
    }
View Full Code Here

            managementAgent.send(cmd);
        }
    }

    private GroupManagementAgent getGroupManagementAgent(String groupName) throws AxisFault {
        ClusteringAgent clusteringAgent = getClusteringAgent();
        GroupManagementAgent groupManagementAgent =
                clusteringAgent.getGroupManagementAgent(groupName);
        if (groupManagementAgent == null) {
            handleException("No GroupManagementAgent defined for domain " + groupName);
        }
        return groupManagementAgent;
    }
View Full Code Here

    private ClusteringAgent getClusteringAgent() throws AxisFault {
        AxisConfiguration axisConfig =
                MessageContext.getCurrentMessageContext().
                        getConfigurationContext().getAxisConfiguration();
        ClusteringAgent clusterManager = axisConfig.getClusteringAgent();
        if (clusterManager == null) {
            handleException("ClusteringAgent not enabled in axis2.xml file");
        }
        return clusterManager;
    }
View Full Code Here

        return clusterManager;
    }

    private NodeManager getNodeManager() throws AxisFault {
        NodeManager nodeManager;
        ClusteringAgent clusteringAgent = getClusteringAgent();
        nodeManager = clusteringAgent.getNodeManager();
        if (nodeManager == null) {
            handleException("Cluster NodeManager not enabled in axis2.xml file");
        }
        return nodeManager;
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.clustering.ClusteringAgent

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.