Java 类org.apache.catalina.ha.ClusterSession 实例源码

项目:lazycat    文件:ReplicationValve.java   
/**
 * Mark Request that processed at primary node with attribute
 * primaryIndicatorName
 * 
 * @param request
 * @throws IOException
 */
protected void createPrimaryIndicator(Request request) throws IOException {
    String id = request.getRequestedSessionId();
    if ((id != null) && (id.length() > 0)) {
        Manager manager = request.getContext().getManager();
        Session session = manager.findSession(id);
        if (session instanceof ClusterSession) {
            ClusterSession cses = (ClusterSession) session;
            if (log.isDebugEnabled())
                log.debug(sm.getString("ReplicationValve.session.indicator", request.getContext().getName(), id,
                        primaryIndicatorName, Boolean.valueOf(cses.isPrimarySession())));
            request.setAttribute(primaryIndicatorName, cses.isPrimarySession() ? Boolean.TRUE : Boolean.FALSE);
        } else {
            if (log.isDebugEnabled()) {
                if (session != null) {
                    log.debug(sm.getString("ReplicationValve.session.found", request.getContext().getName(), id));
                } else {
                    log.debug(sm.getString("ReplicationValve.session.invalid", request.getContext().getName(), id));
                }
            }
        }
    }
}
项目:tomcat7    文件:ReplicationValve.java   
/**
 * Mark Request that processed at primary node with attribute
 * primaryIndicatorName
 * 
 * @param request
 * @throws IOException
 */
protected void createPrimaryIndicator(Request request) throws IOException {
    String id = request.getRequestedSessionId();
    if ((id != null) && (id.length() > 0)) {
        Manager manager = request.getContext().getManager();
        Session session = manager.findSession(id);
        if (session instanceof ClusterSession) {
            ClusterSession cses = (ClusterSession) session;
            if (log.isDebugEnabled())
                log.debug(sm.getString(
                        "ReplicationValve.session.indicator", request.getContext().getName(),id,
                        primaryIndicatorName,
                        Boolean.valueOf(cses.isPrimarySession())));
            request.setAttribute(primaryIndicatorName, cses.isPrimarySession()?Boolean.TRUE:Boolean.FALSE);
        } else {
            if (log.isDebugEnabled()) {
                if (session != null) {
                    log.debug(sm.getString(
                            "ReplicationValve.session.found", request.getContext().getName(),id));
                } else {
                    log.debug(sm.getString(
                            "ReplicationValve.session.invalid", request.getContext().getName(),id));
                }
            }
        }
    }
}
项目:apache-tomcat-7.0.73-with-comment    文件:ReplicationValve.java   
/**
 * Mark Request that processed at primary node with attribute
 * primaryIndicatorName
 * 
 * @param request
 * @throws IOException
 */
protected void createPrimaryIndicator(Request request) throws IOException {
    String id = request.getRequestedSessionId();
    if ((id != null) && (id.length() > 0)) {
        Manager manager = request.getContext().getManager();
        Session session = manager.findSession(id);
        if (session instanceof ClusterSession) {
            ClusterSession cses = (ClusterSession) session;
            if (log.isDebugEnabled())
                log.debug(sm.getString(
                        "ReplicationValve.session.indicator", request.getContext().getName(),id,
                        primaryIndicatorName,
                        Boolean.valueOf(cses.isPrimarySession())));
            request.setAttribute(primaryIndicatorName, cses.isPrimarySession()?Boolean.TRUE:Boolean.FALSE);
        } else {
            if (log.isDebugEnabled()) {
                if (session != null) {
                    log.debug(sm.getString(
                            "ReplicationValve.session.found", request.getContext().getName(),id));
                } else {
                    log.debug(sm.getString(
                            "ReplicationValve.session.invalid", request.getContext().getName(),id));
                }
            }
        }
    }
}
项目:class-guard    文件:ReplicationValve.java   
/**
 * Mark Request that processed at primary node with attribute
 * primaryIndicatorName
 * 
 * @param request
 * @throws IOException
 */
protected void createPrimaryIndicator(Request request) throws IOException {
    String id = request.getRequestedSessionId();
    if ((id != null) && (id.length() > 0)) {
        Manager manager = request.getContext().getManager();
        Session session = manager.findSession(id);
        if (session instanceof ClusterSession) {
            ClusterSession cses = (ClusterSession) session;
            if (log.isDebugEnabled())
                log.debug(sm.getString(
                        "ReplicationValve.session.indicator", request.getContext().getName(),id,
                        primaryIndicatorName,
                        Boolean.valueOf(cses.isPrimarySession())));
            request.setAttribute(primaryIndicatorName, cses.isPrimarySession()?Boolean.TRUE:Boolean.FALSE);
        } else {
            if (log.isDebugEnabled()) {
                if (session != null) {
                    log.debug(sm.getString(
                            "ReplicationValve.session.found", request.getContext().getName(),id));
                } else {
                    log.debug(sm.getString(
                            "ReplicationValve.session.invalid", request.getContext().getName(),id));
                }
            }
        }
    }
}
项目:apache-tomcat-7.0.57    文件:ReplicationValve.java   
/**
 * Mark Request that processed at primary node with attribute
 * primaryIndicatorName
 * 
 * @param request
 * @throws IOException
 */
protected void createPrimaryIndicator(Request request) throws IOException {
    String id = request.getRequestedSessionId();
    if ((id != null) && (id.length() > 0)) {
        Manager manager = request.getContext().getManager();
        Session session = manager.findSession(id);
        if (session instanceof ClusterSession) {
            ClusterSession cses = (ClusterSession) session;
            if (log.isDebugEnabled())
                log.debug(sm.getString(
                        "ReplicationValve.session.indicator", request.getContext().getName(),id,
                        primaryIndicatorName,
                        Boolean.valueOf(cses.isPrimarySession())));
            request.setAttribute(primaryIndicatorName, cses.isPrimarySession()?Boolean.TRUE:Boolean.FALSE);
        } else {
            if (log.isDebugEnabled()) {
                if (session != null) {
                    log.debug(sm.getString(
                            "ReplicationValve.session.found", request.getContext().getName(),id));
                } else {
                    log.debug(sm.getString(
                            "ReplicationValve.session.invalid", request.getContext().getName(),id));
                }
            }
        }
    }
}
项目:apache-tomcat-7.0.57    文件:ReplicationValve.java   
/**
 * Mark Request that processed at primary node with attribute
 * primaryIndicatorName
 * 
 * @param request
 * @throws IOException
 */
protected void createPrimaryIndicator(Request request) throws IOException {
    String id = request.getRequestedSessionId();
    if ((id != null) && (id.length() > 0)) {
        Manager manager = request.getContext().getManager();
        Session session = manager.findSession(id);
        if (session instanceof ClusterSession) {
            ClusterSession cses = (ClusterSession) session;
            if (log.isDebugEnabled())
                log.debug(sm.getString(
                        "ReplicationValve.session.indicator", request.getContext().getName(),id,
                        primaryIndicatorName,
                        Boolean.valueOf(cses.isPrimarySession())));
            request.setAttribute(primaryIndicatorName, cses.isPrimarySession()?Boolean.TRUE:Boolean.FALSE);
        } else {
            if (log.isDebugEnabled()) {
                if (session != null) {
                    log.debug(sm.getString(
                            "ReplicationValve.session.found", request.getContext().getName(),id));
                } else {
                    log.debug(sm.getString(
                            "ReplicationValve.session.invalid", request.getContext().getName(),id));
                }
            }
        }
    }
}
项目:WBSAirback    文件:ReplicationValve.java   
/**
 * Mark Request that processed at primary node with attribute
 * primaryIndicatorName
 * 
 * @param request
 * @throws IOException
 */
protected void createPrimaryIndicator(Request request) throws IOException {
    String id = request.getRequestedSessionId();
    if ((id != null) && (id.length() > 0)) {
        Manager manager = request.getContext().getManager();
        Session session = manager.findSession(id);
        if (session instanceof ClusterSession) {
            ClusterSession cses = (ClusterSession) session;
            if (log.isDebugEnabled())
                log.debug(sm.getString(
                        "ReplicationValve.session.indicator", request.getContext().getName(),id,
                        primaryIndicatorName,
                        Boolean.valueOf(cses.isPrimarySession())));
            request.setAttribute(primaryIndicatorName, cses.isPrimarySession()?Boolean.TRUE:Boolean.FALSE);
        } else {
            if (log.isDebugEnabled()) {
                if (session != null) {
                    log.debug(sm.getString(
                            "ReplicationValve.session.found", request.getContext().getName(),id));
                } else {
                    log.debug(sm.getString(
                            "ReplicationValve.session.invalid", request.getContext().getName(),id));
                }
            }
        }
    }
}