Java 类org.apache.catalina.ha.session.DeltaManager 实例源码

项目:tomcat7    文件:ReplicationValve.java   
/**
 * @param request
 * @param totalstart
 * @param isCrossContext
 * @param clusterManager
 * @param containerCluster
 */
protected void sendReplicationMessage(Request request, long totalstart, boolean isCrossContext, ClusterManager clusterManager, CatalinaCluster containerCluster) {
    //this happens after the request
    long start = 0;
    if(doStatistics()) {
        start = System.currentTimeMillis();
    }
    try {
        // send invalid sessions
        // DeltaManager returns String[0]
        if (!(clusterManager instanceof DeltaManager))
            sendInvalidSessions(clusterManager, containerCluster);
        // send replication
        sendSessionReplicationMessage(request, clusterManager, containerCluster);
        if(isCrossContext)
            sendCrossContextSession(containerCluster);
    } catch (Exception x) {
        // FIXME we have a lot of sends, but the trouble with one node stops the correct replication to other nodes!
        log.error(sm.getString("ReplicationValve.send.failure"), x);
    } finally {
        // FIXME this stats update are not cheap!!
        if(doStatistics()) {
            updateStats(totalstart,start);
        }
    }
}
项目:tomcat7    文件:SimpleTcpCluster.java   
/**
 * Create new Manager without add to cluster (comes with start the manager)
 * 
 * @param name
 *            Context Name of this manager
 * @see org.apache.catalina.Cluster#createManager(java.lang.String)
 * @see DeltaManager#start()
 */
@Override
public synchronized Manager createManager(String name) {
    if (log.isDebugEnabled()) {
        log.debug("Creating ClusterManager for context " + name +
                " using class " + getManagerTemplate().getClass().getName());
    }
    ClusterManager manager = null;
    try {
        manager = managerTemplate.cloneFromTemplate();
        manager.setName(name);
    } catch (Exception x) {
        log.error("Unable to clone cluster manager, defaulting to org.apache.catalina.ha.session.DeltaManager", x);
        manager = new org.apache.catalina.ha.session.DeltaManager();
    } finally {
        if ( manager != null) manager.setCluster(this);
    }
    return manager;
}
项目:apache-tomcat-7.0.73-with-comment    文件:ReplicationValve.java   
/**
 * @param request
 * @param totalstart
 * @param isCrossContext
 * @param clusterManager
 * @param containerCluster
 */
protected void sendReplicationMessage(Request request, long totalstart, boolean isCrossContext, ClusterManager clusterManager, CatalinaCluster containerCluster) {
    //this happens after the request
    long start = 0;
    if(doStatistics()) {
        start = System.currentTimeMillis();
    }
    try {
        // send invalid sessions
        // DeltaManager returns String[0]
        if (!(clusterManager instanceof DeltaManager))
            sendInvalidSessions(clusterManager, containerCluster);
        // send replication
        sendSessionReplicationMessage(request, clusterManager, containerCluster);
        if(isCrossContext)
            sendCrossContextSession(containerCluster);
    } catch (Exception x) {
        // FIXME we have a lot of sends, but the trouble with one node stops the correct replication to other nodes!
        log.error(sm.getString("ReplicationValve.send.failure"), x);
    } finally {
        // FIXME this stats update are not cheap!!
        if(doStatistics()) {
            updateStats(totalstart,start);
        }
    }
}
项目:apache-tomcat-7.0.73-with-comment    文件:SimpleTcpCluster.java   
/**
 * Create new Manager without add to cluster (comes with start the manager)
 * 
 * @param name
 *            Context Name of this manager
 * @see org.apache.catalina.Cluster#createManager(java.lang.String)
 * @see DeltaManager#start()
 */
@Override
public synchronized Manager createManager(String name) {
    if (log.isDebugEnabled()) {
        log.debug("Creating ClusterManager for context " + name +
                " using class " + getManagerTemplate().getClass().getName());
    }
    ClusterManager manager = null;
    try {
        manager = managerTemplate.cloneFromTemplate();
        manager.setName(name);
    } catch (Exception x) {
        log.error("Unable to clone cluster manager, defaulting to org.apache.catalina.ha.session.DeltaManager", x);
        manager = new org.apache.catalina.ha.session.DeltaManager();
    } finally {
        if ( manager != null) manager.setCluster(this);
    }
    return manager;
}
项目:lazycat    文件:SimpleTcpCluster.java   
/**
 * Create new Manager without add to cluster (comes with start the manager)
 * 
 * @param name
 *            Context Name of this manager
 * @see org.apache.catalina.Cluster#createManager(java.lang.String)
 * @see DeltaManager#start()
 */
@Override
public synchronized Manager createManager(String name) {
    if (log.isDebugEnabled()) {
        log.debug("Creating ClusterManager for context " + name + " using class "
                + getManagerTemplate().getClass().getName());
    }
    ClusterManager manager = null;
    try {
        manager = managerTemplate.cloneFromTemplate();
        manager.setName(name);
    } catch (Exception x) {
        log.error("Unable to clone cluster manager, defaulting to org.apache.catalina.ha.session.DeltaManager", x);
        manager = new org.apache.catalina.ha.session.DeltaManager();
    } finally {
        if (manager != null)
            manager.setCluster(this);
    }
    return manager;
}
项目:class-guard    文件:ReplicationValve.java   
/**
 * @param request
 * @param totalstart
 * @param isCrossContext
 * @param clusterManager
 * @param containerCluster
 */
protected void sendReplicationMessage(Request request, long totalstart, boolean isCrossContext, ClusterManager clusterManager, CatalinaCluster containerCluster) {
    //this happens after the request
    long start = 0;
    if(doStatistics()) {
        start = System.currentTimeMillis();
    }
    try {
        // send invalid sessions
        // DeltaManager returns String[0]
        if (!(clusterManager instanceof DeltaManager))
            sendInvalidSessions(clusterManager, containerCluster);
        // send replication
        sendSessionReplicationMessage(request, clusterManager, containerCluster);
        if(isCrossContext)
            sendCrossContextSession(containerCluster);
    } catch (Exception x) {
        // FIXME we have a lot of sends, but the trouble with one node stops the correct replication to other nodes!
        log.error(sm.getString("ReplicationValve.send.failure"), x);
    } finally {
        // FIXME this stats update are not cheap!!
        if(doStatistics()) {
            updateStats(totalstart,start);
        }
    }
}
项目:class-guard    文件:SimpleTcpCluster.java   
/**
 * Create new Manager without add to cluster (comes with start the manager)
 * 
 * @param name
 *            Context Name of this manager
 * @see org.apache.catalina.Cluster#createManager(java.lang.String)
 * @see DeltaManager#start()
 */
@Override
public synchronized Manager createManager(String name) {
    if (log.isDebugEnabled()) {
        log.debug("Creating ClusterManager for context " + name +
                " using class " + getManagerTemplate().getClass().getName());
    }
    ClusterManager manager = null;
    try {
        manager = managerTemplate.cloneFromTemplate();
        manager.setName(name);
    } catch (Exception x) {
        log.error("Unable to clone cluster manager, defaulting to org.apache.catalina.ha.session.DeltaManager", x);
        manager = new org.apache.catalina.ha.session.DeltaManager();
    } finally {
        if ( manager != null) manager.setCluster(this);
    }
    return manager;
}
项目:apache-tomcat-7.0.57    文件:ReplicationValve.java   
/**
 * @param request
 * @param totalstart
 * @param isCrossContext
 * @param clusterManager
 * @param containerCluster
 */
protected void sendReplicationMessage(Request request, long totalstart, boolean isCrossContext, ClusterManager clusterManager, CatalinaCluster containerCluster) {
    //this happens after the request
    long start = 0;
    if(doStatistics()) {
        start = System.currentTimeMillis();
    }
    try {
        // send invalid sessions
        // DeltaManager returns String[0]
        if (!(clusterManager instanceof DeltaManager))
            sendInvalidSessions(clusterManager, containerCluster);
        // send replication
        sendSessionReplicationMessage(request, clusterManager, containerCluster);
        if(isCrossContext)
            sendCrossContextSession(containerCluster);
    } catch (Exception x) {
        // FIXME we have a lot of sends, but the trouble with one node stops the correct replication to other nodes!
        log.error(sm.getString("ReplicationValve.send.failure"), x);
    } finally {
        // FIXME this stats update are not cheap!!
        if(doStatistics()) {
            updateStats(totalstart,start);
        }
    }
}
项目:apache-tomcat-7.0.57    文件:SimpleTcpCluster.java   
/**
 * Create new Manager without add to cluster (comes with start the manager)
 * 
 * @param name
 *            Context Name of this manager
 * @see org.apache.catalina.Cluster#createManager(java.lang.String)
 * @see DeltaManager#start()
 */
@Override
public synchronized Manager createManager(String name) {
    if (log.isDebugEnabled()) {
        log.debug("Creating ClusterManager for context " + name +
                " using class " + getManagerTemplate().getClass().getName());
    }
    ClusterManager manager = null;
    try {
        manager = managerTemplate.cloneFromTemplate();
        manager.setName(name);
    } catch (Exception x) {
        log.error("Unable to clone cluster manager, defaulting to org.apache.catalina.ha.session.DeltaManager", x);
        manager = new org.apache.catalina.ha.session.DeltaManager();
    } finally {
        if ( manager != null) manager.setCluster(this);
    }
    return manager;
}
项目:apache-tomcat-7.0.57    文件:ReplicationValve.java   
/**
 * @param request
 * @param totalstart
 * @param isCrossContext
 * @param clusterManager
 * @param containerCluster
 */
protected void sendReplicationMessage(Request request, long totalstart, boolean isCrossContext, ClusterManager clusterManager, CatalinaCluster containerCluster) {
    //this happens after the request
    long start = 0;
    if(doStatistics()) {
        start = System.currentTimeMillis();
    }
    try {
        // send invalid sessions
        // DeltaManager returns String[0]
        if (!(clusterManager instanceof DeltaManager))
            sendInvalidSessions(clusterManager, containerCluster);
        // send replication
        sendSessionReplicationMessage(request, clusterManager, containerCluster);
        if(isCrossContext)
            sendCrossContextSession(containerCluster);
    } catch (Exception x) {
        // FIXME we have a lot of sends, but the trouble with one node stops the correct replication to other nodes!
        log.error(sm.getString("ReplicationValve.send.failure"), x);
    } finally {
        // FIXME this stats update are not cheap!!
        if(doStatistics()) {
            updateStats(totalstart,start);
        }
    }
}
项目:apache-tomcat-7.0.57    文件:SimpleTcpCluster.java   
/**
 * Create new Manager without add to cluster (comes with start the manager)
 * 
 * @param name
 *            Context Name of this manager
 * @see org.apache.catalina.Cluster#createManager(java.lang.String)
 * @see DeltaManager#start()
 */
@Override
public synchronized Manager createManager(String name) {
    if (log.isDebugEnabled()) {
        log.debug("Creating ClusterManager for context " + name +
                " using class " + getManagerTemplate().getClass().getName());
    }
    ClusterManager manager = null;
    try {
        manager = managerTemplate.cloneFromTemplate();
        manager.setName(name);
    } catch (Exception x) {
        log.error("Unable to clone cluster manager, defaulting to org.apache.catalina.ha.session.DeltaManager", x);
        manager = new org.apache.catalina.ha.session.DeltaManager();
    } finally {
        if ( manager != null) manager.setCluster(this);
    }
    return manager;
}
项目:WBSAirback    文件:ReplicationValve.java   
/**
 * @param request
 * @param totalstart
 * @param isCrossContext
 * @param clusterManager
 * @param containerCluster
 */
protected void sendReplicationMessage(Request request, long totalstart, boolean isCrossContext, ClusterManager clusterManager, CatalinaCluster containerCluster) {
    //this happens after the request
    long start = 0;
    if(doStatistics()) {
        start = System.currentTimeMillis();
    }
    try {
        // send invalid sessions
        // DeltaManager returns String[0]
        if (!(clusterManager instanceof DeltaManager))
            sendInvalidSessions(clusterManager, containerCluster);
        // send replication
        sendSessionReplicationMessage(request, clusterManager, containerCluster);
        if(isCrossContext)
            sendCrossContextSession(containerCluster);
    } catch (Exception x) {
        // FIXME we have a lot of sends, but the trouble with one node stops the correct replication to other nodes!
        log.error(sm.getString("ReplicationValve.send.failure"), x);
    } finally {
        // FIXME this stats update are not cheap!!
        if(doStatistics()) {
            updateStats(totalstart,start);
        }
    }
}
项目:WBSAirback    文件:SimpleTcpCluster.java   
/**
 * Create new Manager without add to cluster (comes with start the manager)
 * 
 * @param name
 *            Context Name of this manager
 * @see org.apache.catalina.Cluster#createManager(java.lang.String)
 * @see DeltaManager#start()
 */
@Override
public synchronized Manager createManager(String name) {
    if (log.isDebugEnabled()) {
        log.debug("Creating ClusterManager for context " + name +
                " using class " + getManagerTemplate().getClass().getName());
    }
    Manager manager = null;
    try {
        manager = managerTemplate.cloneFromTemplate();
        ((ClusterManager)manager).setName(name);
    } catch (Exception x) {
        log.error("Unable to clone cluster manager, defaulting to org.apache.catalina.ha.session.DeltaManager", x);
        manager = new org.apache.catalina.ha.session.DeltaManager();
    } finally {
        if ( manager != null && (manager instanceof ClusterManager)) ((ClusterManager)manager).setCluster(this);
    }
    return manager;
}
项目:lazycat    文件:ReplicationValve.java   
/**
 * @param request
 * @param totalstart
 * @param isCrossContext
 * @param clusterManager
 * @param containerCluster
 */
protected void sendReplicationMessage(Request request, long totalstart, boolean isCrossContext,
        ClusterManager clusterManager, CatalinaCluster containerCluster) {
    // this happens after the request
    long start = 0;
    if (doStatistics()) {
        start = System.currentTimeMillis();
    }
    try {
        // send invalid sessions
        // DeltaManager returns String[0]
        if (!(clusterManager instanceof DeltaManager))
            sendInvalidSessions(clusterManager, containerCluster);
        // send replication
        sendSessionReplicationMessage(request, clusterManager, containerCluster);
        if (isCrossContext)
            sendCrossContextSession(containerCluster);
    } catch (Exception x) {
        // FIXME we have a lot of sends, but the trouble with one node stops
        // the correct replication to other nodes!
        log.error(sm.getString("ReplicationValve.send.failure"), x);
    } finally {
        // FIXME this stats update are not cheap!!
        if (doStatistics()) {
            updateStats(totalstart, start);
        }
    }
}
项目:WBSAirback    文件:ClusterJmxHelper.java   
protected static void initDefaultCluster() {
    initMetaData(SimpleTcpCluster.class);
    initMetaData(DeltaManager.class);
    initMetaData(FarmWarDeployer.class); //not functional yet
    initMetaData(ClusterSingleSignOn.class); //not functional yet
}