Examples of ClusteringAgent


Examples of org.apache.axis2.clustering.ClusteringAgent

        }
    }
 
  public static void createGroupMgtAgent(String domain, String subDomain) {
   
    ClusteringAgent clusteringAgent = ConfigHolder.getInstance().getAxisConfiguration().getClusteringAgent();
        if (clusteringAgent == null) {
            throw new SynapseException("Axis2 ClusteringAgent not defined in axis2.xml");
        }
   
        if (clusteringAgent.getGroupManagementAgent(domain, subDomain) == null) {
            clusteringAgent.addGroupManagementAgent(new SubDomainAwareGroupManagementAgent(
                subDomain),
                domain, subDomain, -1);
            log.info("Group management agent added to cluster domain: " +
                domain + " and sub domain: " + subDomain);
        }
View Full Code Here

Examples of org.apache.axis2.clustering.ClusteringAgent

        }
  }
 
  public static void resetGroupMgtAgent(String domain, String subDomain) {

        ClusteringAgent clusteringAgent =
            ConfigHolder.getInstance().getAxisConfiguration().getClusteringAgent();
       
        if (clusteringAgent == null) {
            throw new SynapseException("Axis2 Clustering Agent not defined in axis2.xml");
        }

        // checks the existence.
        if (clusteringAgent.getGroupManagementAgent(domain, subDomain) != null) {
          
      // FIX THIS IN PROPER WAY
      // This has changed some API of axis2 and we need to send upstream before using it   
            //clusteringAgent.resetGroupManagementAgent(domain, subDomain);
           
View Full Code Here

Examples of org.apache.axis2.clustering.ClusteringAgent

    SynchronizeGitRepositoryRequest request =
                                              new SynchronizeGitRepositoryRequest(tenantId,
                                                                                  tenantDomain,
                                                                                  uuid);

    ClusteringAgent clusteringAgent =
                                      DataHolder.getServerConfigContext()
                                                .getAxisConfiguration().getClusteringAgent();
    GroupManagementAgent groupMgtAgent =
                                         clusteringAgent.getGroupManagementAgent(clusterDomain,
                                                                                 clusterSubdomain);

    try {
      log.info("Sending Request to.. " + clusterDomain + " : " + clusterSubdomain);
      groupMgtAgent.send(request);
View Full Code Here

Examples of org.apache.axis2.clustering.ClusteringAgent

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

    public static List<TenantDataBean> getActiveTenantsInCluster() throws AxisFault {
        List<TenantDataBean> tenants = new ArrayList<TenantDataBean>();
        try {
            ClusteringAgent agent = getClusteringAgent();
            List<ClusteringCommand> list = agent.sendMessage(new GetActiveTenantsInMemberRequest(), true);
            if (log.isDebugEnabled()) {
                log.debug("sent cluster command to to get Active tenants on cluster");
            }
            for (ClusteringCommand command : list) {
                if (command instanceof GetActiveTenantsInMemberResponse) {
View Full Code Here

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

Examples of org.apache.axis2.clustering.ClusteringAgent

    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

Examples of org.apache.axis2.clustering.ClusteringAgent

     * @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

Examples of org.apache.axis2.clustering.ClusteringAgent

     * @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

Examples of org.apache.axis2.clustering.ClusteringAgent

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

Examples of org.apache.axis2.clustering.ClusteringAgent

        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
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.