Package org.apache.axis2.clustering

Examples of org.apache.axis2.clustering.ClusteringAgent


    public void setConfigurationContext(ConfigurationContext configCtx) {
        this.configCtx = configCtx;

        // The following code does the bridging between Axis2 and Synapse load balancing
        ClusteringAgent clusteringAgent = configCtx.getAxisConfiguration().getClusteringAgent();
        if(clusteringAgent == null){
            String msg = "In order to enable load balancing across an Axis2 cluster, " +
                         "the cluster entry should be enabled in the axis2.xml file";
            log.error(msg);
            throw new SynapseException(msg);
        }
        groupMgtAgent = clusteringAgent.getGroupManagementAgent(lbDomain);
        if(groupMgtAgent == null){
            String msg =
                    "A LoadBalanceEventHandler has not been specified in the axis2.xml " +
                    "file for the domain " + lbDomain;
            log.error(msg);
View Full Code Here


            cc = axisMC.getConfigurationContext();

            //To ensure check for clustering environment only happens one time
            if ((throttle == null && !isResponse) || (isResponse
                    && concurrentAccessController == null)) {
                ClusteringAgent clusteringAgent = cc.getAxisConfiguration().getClusteringAgent();
                if (clusteringAgent != null &&
                        clusteringAgent.getStateManager() != null) {
                    isClusteringEnable = true;
                }
            }

            // Throttle only will be created ,if the massage flow is IN
View Full Code Here

            configurePort(configctx);

            // Need to initialize the cluster manager at last since we are changing the servers
            // HTTP/S ports above. In the axis2.xml file, we need to set the "AvoidInitiation" param
            // to "true"
            ClusteringAgent clusteringAgent =
                    configctx.getAxisConfiguration().getClusteringAgent();
            if(clusteringAgent != null) {
                clusteringAgent.setConfigurationContext(configctx);
                clusteringAgent.init();
            }

            // Finally start the transport listeners
            listenerManager = new ListenerManager();
            listenerManager.init(configctx);
View Full Code Here

            cc = axisMC.getConfigurationContext();

            //To ensure check for clustering environment only happens one time
            if ((throttle == null && !isResponse) || (isResponse
                    && concurrentAccessController == null)) {
                ClusteringAgent clusteringAgent = cc.getAxisConfiguration().getClusteringAgent();
                if (clusteringAgent != null &&
                        clusteringAgent.getStateManager() != null) {
                    isClusteringEnable = true;
                }
            }

            // Throttle only will be created ,if the massage flow is IN
View Full Code Here

    public void init(SynapseEnvironment synapseEnvironment) {
        ConfigurationContext cc =
                ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
        if (!initialized) {
            // The check for clustering environment
            ClusteringAgent clusteringAgent = cc.getAxisConfiguration().getClusteringAgent();
            if (clusteringAgent != null && clusteringAgent.getStateManager() != null) {
                isClusteringEnabled = Boolean.TRUE;
            } else {
                isClusteringEnabled = Boolean.FALSE;
            }
View Full Code Here

        String throttleId = throttle.getId();
        ConfigurationContext cc = messageContext.getConfigurationContext();

        //check the env - whether clustered  or not
        boolean isClusteringEnable = false;
        ClusteringAgent clusteringAgent = cc.getAxisConfiguration().getClusteringAgent();
        if (clusteringAgent != null &&
                clusteringAgent.getStateManager() != null) {
            isClusteringEnable = true;
        }

        // Get the concurrent access controller
        ConcurrentAccessController cac;
View Full Code Here

                String msg = "Cannot set server to restarting mode";
                log.error(msg, e);
            }
            MBeanRegistrar.unregisterAllMBeans();
            CarbonContextHolderBase.unloadTenant(MultitenantConstants.SUPER_TENANT_ID);
            ClusteringAgent clusteringAgent =
                    serverConfigContext.getAxisConfiguration().getClusteringAgent();
            if (clusteringAgent != null) {
                clusteringAgent.finalize();
            }
            if (!CarbonUtils.isRunningInStandaloneMode()) {
                int waitFor = 5;
                log.info("Waiting for " + waitFor + " sec before initiating restart");
                Thread.sleep(waitFor * 1000); // The H2 DB connections do not get closed if this is not done
View Full Code Here

public class ClusteringUtil {
    private static boolean isClusteringAgentInitialized;

    public static void enableClustering(ConfigurationContext configContext) throws AxisFault {
        AxisConfiguration axisConfig = configContext.getAxisConfiguration();
        ClusteringAgent clusteringAgent = axisConfig.getClusteringAgent();
        if (clusteringAgent != null) {
            clusteringAgent.setConfigurationContext(configContext);

            if (!isClusteringAgentInitialized) {
                clusteringAgent.init();
                isClusteringAgentInitialized = true;
            }

            // Configuration Manager
            /*if (clusteringAgent.getConfigurationManager() != null) {
View Full Code Here

     * @param domain clustering domain.
     * @param subDomain clustering sub domain.
     */
    public static void createGroupMgtAgent(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) {
           
            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

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

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.