Examples of ClusterManager


Examples of org.apache.axis2.clustering.ClusterManager

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

        // The following code does the bridging between Axis2 and Synapse load balancing
        ClusterManager clusterManager = configCtx.getAxisConfiguration().getClusterManager();
        if(clusterManager == 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);
        }
        lbEventHandler = clusterManager.getLoadBalanceEventHandler(lbDomain);
        if(lbEventHandler == 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

Examples of org.apache.axis2.clustering.ClusterManager

            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"
            ClusterManager clusterManager =
                    configctx.getAxisConfiguration().getClusterManager();
            if (clusterManager != null) {
                clusterManager.setConfigurationContext(configctx);
                clusterManager.init();
            }           

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

Examples of org.apache.catalina.cluster.ClusterManager

                crossContextSessions.set(new ArrayList());
            }
            getNext().invoke(request, response);
            Manager manager = request.getContext().getManager();
            if (manager != null && manager instanceof ClusterManager) {
                ClusterManager clusterManager = (ClusterManager) manager;
                CatalinaCluster containerCluster = (CatalinaCluster) getContainer().getCluster();
                if (containerCluster == null) {
                    if (log.isWarnEnabled())
                        log.warn(sm.getString("ReplicationValve.nocluster"));
                    return;
                }
                // valve cluster can access manager - other cluster handle replication
                // at host level - hopefully!
                if(containerCluster.getManager(clusterManager.getName()) == null)
                    return ;
                if(containerCluster.hasMembers()) {
                    sendReplicationMessage(request, totalstart, isCrossContext, clusterManager, containerCluster);
                } else {
                    resetReplicationRequest(request,isCrossContext);
View Full Code Here

Examples of org.apache.catalina.cluster.ClusterManager

            Map managers = cluster.getManagers() ;
            if (ctxname == null) {
                java.util.Iterator i = managers.keySet().iterator();
                while (i.hasNext()) {
                    String key = (String) i.next();
                    ClusterManager mgr = (ClusterManager) managers.get(key);
                    if (mgr != null)
                        mgr.messageDataReceived(msg);
                    else {
                        //this happens a lot before the system has started
                        // up
                        if (log.isDebugEnabled())
                            log.debug("Context manager doesn't exist:"
                                    + key);
                    }
                }
            } else {
                ClusterManager mgr = (ClusterManager) managers.get(ctxname);
                if (mgr != null)
                    mgr.messageDataReceived(msg);
                else if (log.isWarnEnabled())
                    log.warn("Context manager doesn't exist:" + ctxname);
            }
        }
    }
View Full Code Here

Examples of org.apache.catalina.cluster.ClusterManager


    public synchronized Manager createManager(String name) {
        log.debug("Creating ClusterManager for context "+name + " using class "+getManagerClassName());
        System.out.println("\n\n\n\nCreating ClusterManager for context "+name + " using class "+getManagerClassName()+"\n\n\n\n");
        ClusterManager manager = null;
        try {
            manager = (ClusterManager)getClass().getClassLoader().loadClass(getManagerClassName()).newInstance();
        } catch ( Exception x ) {
            log.error("Unable to load class for replication manager",x);
            manager = new org.apache.catalina.cluster.session.SimpleTcpReplicationManager();
        }
        manager.setName(name);
        manager.setCluster(this);
        manager.setDistributable(true);
        manager.setExpireSessionsOnShutdown(expireSessionsOnShutdown);
        manager.setUseDirtyFlag(useDirtyFlag);
        managers.put(name,manager);
       
        return manager;
    }
View Full Code Here

Examples of org.apache.catalina.cluster.ClusterManager

                //if so, wait until we are fully started up
                if ( ctxname == null ) {
                    java.util.Iterator i = managers.keySet().iterator();
                    while ( i.hasNext() ) {
                        String key = (String)i.next();
                        ClusterManager mgr = (ClusterManager) managers.get(key);
                        if (mgr != null)
                            mgr.messageDataReceived(msg);
                        else {
                            //this happens a lot before the system has started up
                            log.debug("Context manager doesn't exist:" + key);
                        }
                    }//while
                } else {
                    ClusterManager mgr = (ClusterManager) managers.get(ctxname);
                    if (mgr != null)
                        mgr.messageDataReceived(msg);
                    else
                        log.warn("Context manager doesn't exist:" + ctxname);
                }//end if
            else {
                //invoke all the listeners
View Full Code Here

Examples of org.apache.catalina.cluster.ClusterManager

    // --------------------------------------------------------- Public Methods


    public synchronized Manager createManager(String name) {
        log.debug("Creating ClusterManager for context "+name + " using class "+getManagerClassName());
        ClusterManager manager = null;
        try {
            manager = (ClusterManager)getClass().getClassLoader().loadClass(getManagerClassName()).newInstance();
        } catch ( Exception x ) {
            log.error("Unable to load class for replication manager",x);
            manager = new org.apache.catalina.cluster.session.SimpleTcpReplicationManager();
        }
        manager.setName(name);
        manager.setCluster(this);
        manager.setDistributable(true);
        manager.setExpireSessionsOnShutdown(expireSessionsOnShutdown);
        manager.setUseDirtyFlag(useDirtyFlag);
        managers.put(name,manager);
        return manager;
    }
View Full Code Here

Examples of org.apache.catalina.cluster.ClusterManager

                //if so, wait until we are fully started up
                if ( ctxname == null ) {
                    java.util.Iterator i = managers.keySet().iterator();
                    while ( i.hasNext() ) {
                        String key = (String)i.next();
                        ClusterManager mgr = (ClusterManager) managers.get(key);
                        if (mgr != null)
                            mgr.messageDataReceived(msg);
                        else {
                            //this happens a lot before the system has started up
                            log.debug("Context manager doesn't exist:" + key);
                        }
                    }//while
                } else {
                    ClusterManager mgr = (ClusterManager) managers.get(ctxname);
                    if (mgr != null)
                        mgr.messageDataReceived(msg);
                    else
                        log.warn("Context manager doesn't exist:" + ctxname);
                }//end if
            else
                log.warn("Received invalid message myobj="+myobj);
View Full Code Here

Examples of org.apache.catalina.cluster.ClusterManager

            long start = System.currentTimeMillis();
            HttpSession session = request.getSession(false);
           
            if (!( request.getContext().getManager() instanceof ClusterManager) ) return;
           
            ClusterManager manager = (ClusterManager)request.getContext().getManager();
            CatalinaCluster cluster = (CatalinaCluster)getContainer().getCluster();
            if ( cluster == null ) {
                 if(log.isWarnEnabled())
                     log.warn("No cluster configured for this request.");
                return;
            }
            //first check for session invalidations
            String[] invalidIds=manager.getInvalidatedSessions();
            if ( invalidIds.length > 0 ) {
                for ( int i=0;i<invalidIds.length; i++ ) {
                    try {
                        ClusterMessage imsg = manager.requestCompleted(invalidIds[i]);
                        if (imsg != null)
                            cluster.send(imsg);
                    }catch ( Exception x ) {
                        log.error("Unable to send session invalid message over cluster.",x);
                    }
                }
            }

            String id = null;
            if ( session != null )
                id = session.getId();
            else
                return;

            if ( id == null )
                return;

            if ( (request.getContext().getManager()==null) ||
                 (!(request.getContext().getManager() instanceof ClusterManager)))
                return;



            String uri = request.getDecodedRequestURI();
            boolean filterfound = false;

            for ( int i=0; (i<reqFilters.length) && (!filterfound); i++ )
            {
                java.util.regex.Matcher matcher = reqFilters[i].matcher(uri);
                filterfound = matcher.matches();
            }//for
            if ( filterfound )
                return;

            if(log.isDebugEnabled())
                log.debug("Invoking replication request on "+uri);

           
            ClusterMessage msg = manager.requestCompleted(id);

            if ( msg == null ) return;

            cluster.send(msg);
            long stop = System.currentTimeMillis();
View Full Code Here

Examples of org.apache.catalina.cluster.ClusterManager

            HttpServletRequest hreq = (HttpServletRequest) hrequest.getRequest();
            HttpSession session = hreq.getSession(false);
           
            if (!( request.getContext().getManager() instanceof ClusterManager) ) return;
           
            ClusterManager manager = (ClusterManager)request.getContext().getManager();
            CatalinaCluster cluster = (CatalinaCluster)getContainer().getCluster();
            if ( cluster == null ) {
                log.warn("No cluster configured for this request.");
                return;
            }
            //first check for session invalidations
            String[] invalidIds=manager.getInvalidatedSessions();
            if ( invalidIds.length > 0 ) {
                for ( int i=0;i<invalidIds.length; i++ ) {
                    try {
                        SessionMessage imsg = manager.requestCompleted(
                            invalidIds[i]);
                        if (imsg != null)
                            cluster.send(imsg);
                    }catch ( Exception x ) {
                        log.error("Unable to send session invalid message over cluster.",x);
                    }
                }
            }

            String id = null;
            if ( session != null )
                id = session.getId();
            else
                return;

            if ( id == null )
                return;

            if ( (request.getContext().getManager()==null) ||
                 (!(request.getContext().getManager() instanceof ClusterManager)))
                return;



            String uri = hrequest.getDecodedRequestURI();
            boolean filterfound = false;

            for ( int i=0; (i<reqFilters.length) && (!filterfound); i++ )
            {
                java.util.regex.Matcher matcher = reqFilters[i].matcher(uri);
                filterfound = matcher.matches();
            }//for
            if ( filterfound )
                return;

            log.debug("Invoking replication request on "+uri);

           
            SessionMessage msg = manager.requestCompleted(id);

            if ( msg == null ) return;

            cluster.send(msg);
            long stop = System.currentTimeMillis();
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.