Package org.apache.axis2.clustering

Examples of org.apache.axis2.clustering.ClusteringAgent


     * Initializes the ClusterManager for this ConfigurationContext
     *
     * @throws AxisFault
     */
    public void initCluster() throws AxisFault {
        ClusteringAgent clusteringAgent = axisConfiguration.getClusteringAgent();
        if (clusteringAgent != null) {
            StateManager stateManaget = clusteringAgent.getStateManager();
            if (stateManaget != null) {
                stateManaget.setConfigurationContext(this);
            }
            NodeManager nodeManager = clusteringAgent.getNodeManager();
            if (nodeManager != null) {
                nodeManager.setConfigurationContext(this);
            }
            if (shouldClusterBeInitiated(clusteringAgent)) {
                clusteringAgent.setConfigurationContext(this);
                clusteringAgent.init();
            }
        }
    }
View Full Code Here


        if (cc == null) {
            return false;
        }
        // Add the property differences only if Context replication is enabled,
        // and there are members in the cluster
        ClusteringAgent clusteringAgent = cc.getAxisConfiguration().getClusteringAgent();
        if (clusteringAgent == null ||
            clusteringAgent.getStateManager() == null) {
            return false;
        }
        return true;
    }
View Full Code Here

        if (configContext == null) {
            configContext = getConfigurationContext();
        }
        if (!started) {

            ClusteringAgent clusteringAgent =
                    configContext.getAxisConfiguration().getClusteringAgent();
            String avoidInit = ClusteringConstants.Parameters.AVOID_INITIATION;
            if (clusteringAgent != null &&
                clusteringAgent.getParameter(avoidInit) != null &&
                ((String) clusteringAgent.getParameter(avoidInit).getValue()).equalsIgnoreCase("true")) {
                clusteringAgent.setConfigurationContext(configContext);
                clusteringAgent.init();
            }

            listenerManager.startSystem(configContext);
            started = true;
        }
View Full Code Here

     * Initializes the ClusterManager for this ConfigurationContext
     *
     * @throws AxisFault
     */
    public void initCluster() throws AxisFault {
        ClusteringAgent clusteringAgent = axisConfiguration.getClusteringAgent();
        if (clusteringAgent != null) {
            StateManager stateManaget = clusteringAgent.getStateManager();
            if (stateManaget != null) {
                stateManaget.setConfigurationContext(this);
            }
            NodeManager nodeManager = clusteringAgent.getNodeManager();
            if (nodeManager != null) {
                nodeManager.setConfigurationContext(this);
            }
            if (shouldClusterBeInitiated(clusteringAgent)) {
                clusteringAgent.setConfigurationContext(this);
                clusteringAgent.init();
            }
        }
    }
View Full Code Here

            throw new DeploymentException(Messages.getMessage("classAttributeNotFound",
                                                              TAG_CLUSTER));
        }

        String className = classNameAttr.getAttributeValue();
        ClusteringAgent clusteringAgent;
        try {
            Class clazz;
            try {
                clazz = Class.forName(className);
            } catch (ClassNotFoundException e) {
                throw new DeploymentException(Messages.getMessage("clusterImplNotFound",
                                                                  className));
            }
            clusteringAgent = (ClusteringAgent) clazz.newInstance();

            clusteringAgent.setConfigurationContext(configCtx);

            //loading the parameters.
            processParameters(clusterElement.getChildrenWithName(new QName(TAG_PARAMETER)),
                              clusteringAgent,
                              null);
View Full Code Here

public class GetStateCommand extends ControlCommand {

    private StateClusteringCommand[] commands;

    public void execute(ConfigurationContext configCtx) throws ClusteringFault {
        ClusteringAgent clusteringAgent = configCtx.getAxisConfiguration().getClusteringAgent();
        if(clusteringAgent == null){
            return;
        }
        StateManager stateManager = clusteringAgent.getStateManager();
        if (stateManager != null) {
            Map excludedPropPatterns = stateManager.getReplicationExcludePatterns();
            List<StateClusteringCommand> cmdList = new ArrayList<StateClusteringCommand>();

            // Add the service group contexts, service contexts & their respective properties
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

        return lbMembershipHandler;
    }

    public void send(MessageContext synCtx) {
        SessionInformation sessionInformation = null;
        Member currentMember = null;
        ConfigurationContext configCtx =
                ((Axis2MessageContext) synCtx).getAxis2MessageContext().getConfigurationContext();
        if (lbMembershipHandler.getConfigurationContext() == null) {
            lbMembershipHandler.setConfigurationContext(configCtx);
        }
View Full Code Here

    }

    //----------------------- default method implementations and common code -----------------------

    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

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.