Package org.apache.catalina.ha

Examples of org.apache.catalina.ha.CatalinaCluster


            String expiredId = getIdInternal();

            if(notifyCluster && expiredId != 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


     *  that prevents this component from being used
     */
    public void start() throws LifecycleException {
        if ( this.started ) return;
        try {
            CatalinaCluster catclust = (CatalinaCluster)cluster;
            catclust.addManager(getName(), this);
            LazyReplicatedMap map = new LazyReplicatedMap(this,
                                                          catclust.getChannel(),
                                                          DEFAULT_REPL_TIMEOUT,
                                                          getMapName(),
                                                          getClassLoaders());
            map.setChannelSendOptions(mapSendOptions);
            this.sessions = map;
View Full Code Here

            throw new LifecycleException("Failed to start BackupManager",x);
        }
    }
   
    public String getMapName() {
        CatalinaCluster catclust = (CatalinaCluster)cluster;
        Member local = catclust.getLocalMember();
        return catclust.getManagerName(getName(),this)+"-"+local.getDomain();
    }
View Full Code Here

            }
            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

     * @param host
     *            clustered host
     */
    protected void stopSessionIDListener(StandardHost host) {
        if (sessionMoverListener != null) {
            CatalinaCluster cluster = (CatalinaCluster) host.getCluster();
            cluster.removeClusterListener(sessionMoverListener);
            if (mserver != null) {
                try {
                    ObjectName objectName = getObjectName(host);
                    mserver.unregisterMBean(objectName);
                } catch (Exception e) {
View Full Code Here

                return;
            }
            sessionMoverListener = new JvmRouteSessionIDBinderListener();
            mserver.registerMBean(getManagedBean(sessionMoverListener),
                    objectName);
            CatalinaCluster cluster = (CatalinaCluster) host.getCluster();
            sessionMoverListener.setCluster(cluster);
            ((JvmRouteSessionIDBinderListener) sessionMoverListener).start();
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
        }
View Full Code Here


    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

    protected void registerSessionAtReplicationValve(DeltaSession session) {
        if(replicationValve == null) {
            Context context = getContext();
            if(context instanceof StandardContext &&
                    ((StandardContext)context).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

            }
            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

    public void start() throws LifecycleException {
        if ( this.started ) return;
       
        try {
            cluster.registerManager(this);
            CatalinaCluster catclust = (CatalinaCluster)cluster;
            LazyReplicatedMap map = new LazyReplicatedMap(this,
                                                          catclust.getChannel(),
                                                          DEFAULT_REPL_TIMEOUT,
                                                          getMapName(),
                                                          getClassLoaders());
            map.setChannelSendOptions(mapSendOptions);
            this.sessions = map;
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.