Package org.apache.catalina.ha

Examples of org.apache.catalina.ha.ClusterManager


  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) {
        try {
      session = mgr.findSession(sessionId);
        } catch (IOException io) {
      log.error("Session doesn't exist:" + io);
        }
        return session;
    } 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) {
    try {
        session = mgr.findSession(sessionId);
    } catch (IOException io) {
        log.error("Session doesn't exist:" + io);
    }
    return session;
      } else if (log.isErrorEnabled())
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

   
        if (! (manager instanceof ClusterManager)) {
            log.warn("Manager [ " + manager + "] does not implement ClusterManager, addition to cluster has been aborted.");
            return;
        }
        ClusterManager cmanager = (ClusterManager) manager ;
        cmanager.setDistributable(true);
        // Notify our interested LifecycleListeners
        fireLifecycleEvent(BEFORE_MANAGERREGISTER_EVENT, manager);
        String clusterName = getManagerName(cmanager.getName(), manager);
        cmanager.setName(clusterName);
        cmanager.setCluster(this);
   
        managers.put(clusterName, cmanager);
        // Notify our interested LifecycleListeners
        fireLifecycleEvent(AFTER_MANAGERREGISTER_EVENT, manager);   
    }
View Full Code Here

     * @see org.apache.catalina.Cluster#removeManager(Manager)
     */
    @Override
    public void removeManager(Manager manager) {
        if (manager != null && manager instanceof ClusterManager ) {
            ClusterManager cmgr = (ClusterManager) manager;
            // Notify our interested LifecycleListeners
            fireLifecycleEvent(BEFORE_MANAGERUNREGISTER_EVENT,manager);
            managers.remove(getManagerName(cmgr.getName(),manager));
            cmgr.setCluster(null);
            // Notify our interested LifecycleListeners
            fireLifecycleEvent(AFTER_MANAGERUNREGISTER_EVENT, manager);
        }
    }
View Full Code Here

        }

        @Override
        public void setOwner(Object owner) {
            if ( owner instanceof ClusterManager && getManager()==null) {
                ClusterManager cm = (ClusterManager)owner;
                this.setManager(cm);
                this.setValid(true);
                this.setPrimarySession(false);
                this.access();
                this.resetDeltaRequest();
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

   
        if (! (manager instanceof ClusterManager)) {
            log.warn("Manager [ " + manager + "] does not implement ClusterManager, addition to cluster has been aborted.");
            return;
        }
        ClusterManager cmanager = (ClusterManager) manager ;
        cmanager.setDistributable(true);
        // Notify our interested LifecycleListeners
        lifecycle.fireLifecycleEvent(BEFORE_MANAGERREGISTER_EVENT, manager);
        String clusterName = getManagerName(cmanager.getName(), manager);
        cmanager.setName(clusterName);
        cmanager.setCluster(this);
        cmanager.setDefaultMode(false);
   
        managers.put(clusterName, manager);
        // Notify our interested LifecycleListeners
        lifecycle.fireLifecycleEvent(AFTER_MANAGERREGISTER_EVENT, manager);   
    }
View Full Code Here

     *
     * @see org.apache.catalina.ha.CatalinaCluster#removeManager(Manager)
     */
    public void removeManager(Manager manager) {
        if (manager != null && manager instanceof ClusterManager ) {
            ClusterManager cmgr = (ClusterManager) manager;
            // Notify our interested LifecycleListeners
            lifecycle.fireLifecycleEvent(BEFORE_MANAGERUNREGISTER_EVENT,manager);
            managers.remove(getManagerName(cmgr.getName(),manager));
            cmgr.setCluster(null);
            // Notify our interested LifecycleListeners
            lifecycle.fireLifecycleEvent(AFTER_MANAGERUNREGISTER_EVENT, manager);
        }
    }
View Full Code Here

                crossContextSessions.set(new ArrayList<DeltaSession>());
            }
            getNext().invoke(request, response);
            if(context != null && cluster != null
                    && context.getManager() instanceof ClusterManager) {
                ClusterManager clusterManager = (ClusterManager) context.getManager();

                // valve cluster can access manager - other cluster handle replication
                // at host level - hopefully!
                if(cluster.getManager(clusterManager.getName()) == null)
                    return ;
                if(cluster.hasMembers()) {
                    sendReplicationMessage(request, totalstart, isCrossContext, clusterManager, cluster);
                } else {
                    resetReplicationRequest(request,isCrossContext);
View Full Code Here

    }

    @Override
    public void setOwner(Object owner) {
        if ( owner instanceof ClusterManager && getManager()==null) {
            ClusterManager cm = (ClusterManager)owner;
            this.setManager(cm);
            this.setValid(true);
            this.setPrimarySession(false);
            this.access();
            this.resetDeltaRequest();
View Full Code Here

TOP

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

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.