Package org.apache.stratos.lb.endpoint

Examples of org.apache.stratos.lb.endpoint.TenantAwareLoadBalanceEndpointException


    private void assertNull(String name, Object object) throws TenantAwareLoadBalanceEndpointException {
        if (object == null) {
            String message = name + " reference in the proxy admin config holder is null";
            log.error(message);
            throw new TenantAwareLoadBalanceEndpointException(message);
        }
    }
View Full Code Here


            setFailover(lbConfig.getLoadBalancerConfig().getFailOver());

        } catch (Exception e) {
            String msg = "Failed while reading Load Balancer configuration";
            log.error(msg, e);
            throw new TenantAwareLoadBalanceEndpointException(msg, e);
        }


        LoadbalanceAlgorithm algorithm = null;
        try {
            OMElement payload = AXIOMUtil.stringToOM(generatePayLoad());
            algorithm =
                    LoadbalanceAlgorithmFactory.
                            createLoadbalanceAlgorithm(payload, null);

        } catch (Exception e) {
            String msg = "Error While creating Load balance algorithm";
            log.error(msg, e);
            throw new SynapseException(msg, e);
        }

        if (!initialized) {
            super.init(synapseEnvironment);
            ConfigurationContext cfgCtx =
                                          ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
            ClusteringAgent clusteringAgent = cfgCtx.getAxisConfiguration().getClusteringAgent();
            if (clusteringAgent == null) {
                throw new SynapseException("Axis2 ClusteringAgent not defined in axis2.xml");
            }

            // Add the Axis2 GroupManagement agents
            if (hostContexts != null) {
                // iterate through each host context
                for (HostContext hostCtxt : hostContexts.values()) {
                    // each host can has multiple Tenant Contexts, iterate through them
                    for (TenantDomainContext tenantCtxt : hostCtxt.getTenantDomainContexts()) {

                        String domain = tenantCtxt.getDomain();
                        String subDomain = tenantCtxt.getSubDomain();

                        if (clusteringAgent.getGroupManagementAgent(domain, subDomain) == null) {
                            String gmAgentClass = lbConfig.getLoadBalancerConfig().getGroupManagementAgentClass();
                            GroupManagementAgent groupManagementAgent;
                            if (gmAgentClass != null) {
                                try {
                                    groupManagementAgent = (GroupManagementAgent) Class.forName(gmAgentClass).newInstance();
                                } catch (Exception e) {
                                    String msg = "Cannot instantiate GroupManagementAgent. Class: " + gmAgentClass;
                                    log.error(msg, e);
                                    throw new TenantAwareLoadBalanceEndpointException(msg, e);
                                }
                            } else {
                                groupManagementAgent = new SubDomainAwareGroupManagementAgent(subDomain);
                            }
                            clusteringAgent.addGroupManagementAgent(groupManagementAgent,
View Full Code Here

            }
           
            if(!successfullyRegistered){
                String msg = "Failed to register Tenant Aware Load Balance Endpoint in Send Mediator.";
                log.fatal(msg);
                throw new TenantAwareLoadBalanceEndpointException(msg);
            }

            if (log.isDebugEnabled()) {
                log.debug("Endpoint Admin bundle is activated ");
            }
View Full Code Here

TOP

Related Classes of org.apache.stratos.lb.endpoint.TenantAwareLoadBalanceEndpointException

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.