Examples of AlgorithmContext


Examples of org.apache.stratos.load.balancer.algorithm.AlgorithmContext

        members.add(member);

        RoundRobin algorithm = new RoundRobin();
        algorithm.setMembers(members);

        AlgorithmContext algorithmContext = new AlgorithmContext("service1", "cluster1");
        Member nextMember = algorithm.getNextMember(algorithmContext);
        Assert.assertEquals("Expected member not found", true, "m1".equals(nextMember.getMemberId()));

        nextMember = algorithm.getNextMember(algorithmContext);
        Assert.assertEquals("Expected member not found", true, "m2".equals(nextMember.getMemberId()));
View Full Code Here

Examples of org.apache.stratos.load.balancer.algorithm.AlgorithmContext

        if (clusterContext == null) {
            clusterContext = new ClusterContext(cluster.getServiceName(), cluster.getClusterId());
            LoadBalancerContext.getInstance().getClusterIdClusterContextMap().addClusterContext(clusterContext);
        }

        AlgorithmContext algorithmContext = clusterContext.getAlgorithmContext();
        if (algorithmContext == null) {
            algorithmContext = new AlgorithmContext(cluster.getServiceName(), cluster.getClusterId());
            clusterContext.setAlgorithmContext(algorithmContext);
        }
        algorithm.setMembers(new ArrayList<Member>(cluster.getMembers()));
        Member member = algorithm.getNextMember(algorithmContext);
        if (member == null) {
View Full Code Here

Examples of org.apache.synapse.endpoints.algorithms.AlgorithmContext

        ConfigurationContext cc =
                ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
        if (!initialized) {
            super.init(synapseEnvironment);
            if (algorithmContext == null) {
                algorithmContext = new AlgorithmContext(isClusteringEnabled, cc, getName());
            }

            // Initialize the SAL Sessions if already has not been initialized.
            SALSessions salSessions = SALSessions.getInstance();
            if (!salSessions.isInitialized()) {
View Full Code Here

Examples of org.apache.synapse.endpoints.algorithms.AlgorithmContext

        ConfigurationContext cc =
                ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
        if (!initialized) {
            super.init(synapseEnvironment);
            if (algorithmContext == null) {
                algorithmContext = new AlgorithmContext(isClusteringEnabled, cc, getName());
            }

            // if the loadbalancing algorithm implements the ManagedLifecycle interface
            // initlize the algorithm
            if (algorithm != null && algorithm instanceof ManagedLifecycle) {
View Full Code Here

Examples of org.apache.synapse.endpoints.algorithms.AlgorithmContext

        ConfigurationContext cc =
                ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
        if (!initialized) {
            super.init(synapseEnvironment);
            if (algorithmContext == null) {
                algorithmContext = new AlgorithmContext(isClusteringEnabled, cc, getName());
            }

            // Initialize the SAL Sessions if already has not been initialized.
            SALSessions salSessions = SALSessions.getInstance();
            if (!salSessions.isInitialized()) {
View Full Code Here

Examples of org.apache.synapse.endpoints.algorithms.AlgorithmContext

        ConfigurationContext cc =
                ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
        if (!initialized) {
            super.init(synapseEnvironment);
            if (algorithmContext == null) {
                algorithmContext = new AlgorithmContext(isClusteringEnabled, cc, getName());
            }

            // if the loadbalancing algorithm implements the ManagedLifecycle interface
            // initlize the algorithm
            if (algorithm != null && algorithm instanceof ManagedLifecycle) {
View Full Code Here

Examples of org.apache.synapse.endpoints.algorithms.AlgorithmContext

                                               LoadbalanceAlgorithm algorithm,
                                               ConfigurationContext configCtx,
                                               boolean isClusteringEnabled,
                                               String endpointName) {
        for (Map.Entry<String, String> entry : hostDomainMap.entrySet()) {
            AlgorithmContext algorithmContext =
                new AlgorithmContext(isClusteringEnabled, configCtx, endpointName + "." + entry.getKey());
            this.hostDomainAlgorithmContextMap.put(entry.getKey(),
                                   new DomainAlgorithmContext(entry.getValue(), algorithm.clone(), algorithmContext));
        }
    }
View Full Code Here

Examples of org.apache.synapse.endpoints.algorithms.AlgorithmContext

                    "file for the domain " + lbDomain + " for host " + host;
            log.error(msg);
            throw new SynapseException(msg);
        }
        algorithm.setApplicationMembers(groupMgtAgent.getMembers());
        AlgorithmContext context = domainAlgorithmContext.getAlgorithmContext();
        return algorithm.getNextApplicationMember(context);
    }
View Full Code Here

Examples of org.apache.synapse.endpoints.algorithms.AlgorithmContext

        ConfigurationContext cc =
                ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
        if (!initialized) {
            super.init(synapseEnvironment);
            if (algorithmContext == null) {
                algorithmContext = new AlgorithmContext(isClusteringEnabled, cc, getName());
            }

            // Initialize the SAL Sessions if already has not been initialized.
            SALSessions salSessions = SALSessions.getInstance();
            if (!salSessions.isInitialized()) {
View Full Code Here

Examples of org.apache.synapse.endpoints.algorithms.AlgorithmContext

        ConfigurationContext cc =
                ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
        if (!initialized) {
            super.init(synapseEnvironment);
            if (algorithmContext == null) {
                algorithmContext = new AlgorithmContext(isClusteringEnabled, cc, getName());
            }

            // Initialize the SAL Sessions if already has not been initialized.
            SALSessions salSessions = SALSessions.getInstance();
            if (!salSessions.isInitialized()) {
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.