Package org.apache.catalina.ha

Examples of org.apache.catalina.ha.CatalinaCluster



    public synchronized void start() throws LifecycleException {
        if ( this.started ) return;
        try {
            CatalinaCluster catclust = (CatalinaCluster)this.getCluster();
            if (this.context == null) this.context = new ReplApplContext(this.getBasePath(), this);
            if ( catclust != null ) {
                ReplicatedMap map = new ReplicatedMap(this,catclust.getChannel(),DEFAULT_REPL_TIMEOUT,
                                                      getName(),getClassLoaders());
                map.setChannelSendOptions(mapSendOptions);
                ((ReplApplContext)this.context).setAttributeMap(map);
                if (getAltDDName() != null) context.setAttribute(Globals.ALT_DD_ATTR, getAltDDName());
            }
View Full Code Here


        // Force initialization of the random number generator
        generateSessionId();

        try {
            cluster.registerManager(this);
            CatalinaCluster catclust = cluster;
            LazyReplicatedMap map = new LazyReplicatedMap(this,
                                                          catclust.getChannel(),
                                                          DEFAULT_REPL_TIMEOUT,
                                                          getMapName(),
                                                          getClassLoaders());
            map.setChannelSendOptions(mapSendOptions);
            this.sessions = map;
View Full Code Here

        }
        setState(LifecycleState.STARTING);
    }
   
    public String getMapName() {
        CatalinaCluster catclust = cluster;
        String name = catclust.getManagerName(getName(),this)+"-"+"map";
        if ( log.isDebugEnabled() ) log.debug("Backup manager, Setting map name to:"+name);
        return name;
    }
View Full Code Here

     * @param session cross context session
     */
    protected void registerSessionAtReplicationValve(DeltaSession session) {
        if(replicationValve == null) {
            if(container instanceof StandardContext && ((StandardContext)container).getCrossContext()) {
                CatalinaCluster cluster = getCluster() ;
                if(cluster != null) {
                    Valve[] valves = cluster.getValves();
                    if(valves != null && valves.length > 0) {
                        for(int i=0; replicationValve == null && i < valves.length ; i++ ){
                            if(valves[i] instanceof ReplicationValve) replicationValve = (ReplicationValve)valves[i] ;
                        }//for

View Full Code Here

        String expiredId = getIdInternal();

        if(expiredId != null && manager != null &&
           manager instanceof DeltaManager) {
            DeltaManager dmanager = (DeltaManager)manager;
            CatalinaCluster cluster = dmanager.getCluster();
            ClusterMessage msg = dmanager.requestCompleted(expiredId, true);
            if (msg != null) {
                if(dmanager.doDomainReplication()) {
                    cluster.sendClusterDomain(msg);
                } else {
                    cluster.send(msg);
                }
            }
        }

        super.expire(notify);
View Full Code Here

            getNext().invoke(request, response);
            if(context != null) {
                Manager manager = context.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

     */
    @Override
    protected synchronized void startInternal() throws LifecycleException {

        try {
            CatalinaCluster catclust = (CatalinaCluster)this.getCluster();
            if (this.context == null) this.context = new ReplApplContext(this);
            if ( catclust != null ) {
                ReplicatedMap map = new ReplicatedMap(this,catclust.getChannel(),DEFAULT_REPL_TIMEOUT,
                                                      getName(),getClassLoaders());
                map.setChannelSendOptions(mapSendOptions);
                ((ReplApplContext)this.context).setAttributeMap(map);
                if (getAltDDName() != null) context.setAttribute(Globals.ALT_DD_ATTR, getAltDDName());
            }
View Full Code Here

        String expiredId = getIdInternal();

        if(expiredId != null && manager != null &&
           manager instanceof DeltaManager) {
            DeltaManager dmanager = (DeltaManager)manager;
            CatalinaCluster cluster = dmanager.getCluster();
            ClusterMessage msg = dmanager.requestCompleted(expiredId, true);
            if (msg != null) {
                cluster.send(msg);
            }
        }

        super.expire(notify);
View Full Code Here

       
        super.startInternal();

        try {
            cluster.registerManager(this);
            CatalinaCluster catclust = cluster;
            LazyReplicatedMap map = new LazyReplicatedMap(this,
                                                          catclust.getChannel(),
                                                          DEFAULT_REPL_TIMEOUT,
                                                          getMapName(),
                                                          getClassLoaders());
            map.setChannelSendOptions(mapSendOptions);
            this.sessions = map;
View Full Code Here

        }
        setState(LifecycleState.STARTING);
    }
   
    public String getMapName() {
        CatalinaCluster catclust = cluster;
        String name = catclust.getManagerName(getName(),this)+"-"+"map";
        if ( log.isDebugEnabled() ) log.debug("Backup manager, Setting map name to:"+name);
        return name;
    }
View Full Code Here

TOP

Related Classes of org.apache.catalina.ha.CatalinaCluster

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.