org.apache.catalina.manager.util.BaseSessionComparator的实例源码

项目:tomcat7    文件HTMLManagerServlet.java   
protected Comparator<Session> getComparator(String sortBy) {
    Comparator<Session> comparator = null;
    if ("CreationTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(session.getCreationTime());
            }
        };
    } else if ("id".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<String>() {
            @Override
            public Comparable<String> getComparableObject(Session session) {
                return session.getId();
            }
        };
    } else if ("LastAccessedTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(session.getLastAccessedTime());
            }
        };
    } else if ("MaxInactiveInterval".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(session.getMaxInactiveInterval());
            }
        };
    } else if ("new".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Boolean>() {
            @Override
            public Comparable<Boolean> getComparableObject(Session session) {
                return Boolean.valueOf(session.getSession().isNew());
            }
        };
    } else if ("locale".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<String>() {
            @Override
            public Comparable<String> getComparableObject(Session session) {
                return JspHelper.guessdisplayLocaleFromSession(session);
            }
        };
    } else if ("user".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<String>() {
            @Override
            public Comparable<String> getComparableObject(Session session) {
                return JspHelper.guessdisplayUserFromSession(session);
            }
        };
    } else if ("UsedTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(SessionUtils.getUsedTimeForSession(session));
            }
        };
    } else if ("InactiveTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(SessionUtils.getInactiveTimeForSession(session));
            }
        };
    } else if ("TTL".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(SessionUtils.getTTLForSession(session));
            }
        };
    }
    //Todo: complete this to TTL,etc.
    return comparator;
}
项目:apache-tomcat-7.0.73-with-comment    文件HTMLManagerServlet.java   
protected Comparator<Session> getComparator(String sortBy) {
    Comparator<Session> comparator = null;
    if ("CreationTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(session.getCreationTime());
            }
        };
    } else if ("id".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<String>() {
            @Override
            public Comparable<String> getComparableObject(Session session) {
                return session.getId();
            }
        };
    } else if ("LastAccessedTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(session.getLastAccessedTime());
            }
        };
    } else if ("MaxInactiveInterval".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(session.getMaxInactiveInterval());
            }
        };
    } else if ("new".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Boolean>() {
            @Override
            public Comparable<Boolean> getComparableObject(Session session) {
                return Boolean.valueOf(session.getSession().isNew());
            }
        };
    } else if ("locale".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<String>() {
            @Override
            public Comparable<String> getComparableObject(Session session) {
                return JspHelper.guessdisplayLocaleFromSession(session);
            }
        };
    } else if ("user".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<String>() {
            @Override
            public Comparable<String> getComparableObject(Session session) {
                return JspHelper.guessdisplayUserFromSession(session);
            }
        };
    } else if ("UsedTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(SessionUtils.getUsedTimeForSession(session));
            }
        };
    } else if ("InactiveTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(SessionUtils.getInactiveTimeForSession(session));
            }
        };
    } else if ("TTL".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(SessionUtils.getTTLForSession(session));
            }
        };
    }
    //Todo: complete this to TTL,etc.
    return comparator;
}
项目:lazycat    文件HTMLManagerServlet.java   
protected Comparator<Session> getComparator(String sortBy) {
    Comparator<Session> comparator = null;
    if ("CreationTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(session.getCreationTime());
            }
        };
    } else if ("id".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<String>() {
            @Override
            public Comparable<String> getComparableObject(Session session) {
                return session.getId();
            }
        };
    } else if ("LastAccessedTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(session.getLastAccessedTime());
            }
        };
    } else if ("MaxInactiveInterval".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(session.getMaxInactiveInterval());
            }
        };
    } else if ("new".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Boolean>() {
            @Override
            public Comparable<Boolean> getComparableObject(Session session) {
                return Boolean.valueOf(session.getSession().isNew());
            }
        };
    } else if ("locale".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<String>() {
            @Override
            public Comparable<String> getComparableObject(Session session) {
                return JspHelper.guessdisplayLocaleFromSession(session);
            }
        };
    } else if ("user".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<String>() {
            @Override
            public Comparable<String> getComparableObject(Session session) {
                return JspHelper.guessdisplayUserFromSession(session);
            }
        };
    } else if ("UsedTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(SessionUtils.getUsedTimeForSession(session));
            }
        };
    } else if ("InactiveTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(SessionUtils.getInactiveTimeForSession(session));
            }
        };
    } else if ("TTL".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(SessionUtils.getTTLForSession(session));
            }
        };
    }
    // Todo: complete this to TTL,etc.
    return comparator;
}
项目:class-guard    文件HTMLManagerServlet.java   
protected Comparator<Session> getComparator(String sortBy) {
    Comparator<Session> comparator = null;
    if ("CreationTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(session.getCreationTime());
            }
        };
    } else if ("id".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<String>() {
            @Override
            public Comparable<String> getComparableObject(Session session) {
                return session.getId();
            }
        };
    } else if ("LastAccessedTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(session.getLastAccessedTime());
            }
        };
    } else if ("MaxInactiveInterval".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(session.getMaxInactiveInterval());
            }
        };
    } else if ("new".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Boolean>() {
            @Override
            public Comparable<Boolean> getComparableObject(Session session) {
                return Boolean.valueOf(session.getSession().isNew());
            }
        };
    } else if ("locale".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<String>() {
            @Override
            public Comparable<String> getComparableObject(Session session) {
                return JspHelper.guessdisplayLocaleFromSession(session);
            }
        };
    } else if ("user".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<String>() {
            @Override
            public Comparable<String> getComparableObject(Session session) {
                return JspHelper.guessdisplayUserFromSession(session);
            }
        };
    } else if ("UsedTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(SessionUtils.getUsedTimeForSession(session));
            }
        };
    } else if ("InactiveTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(SessionUtils.getInactiveTimeForSession(session));
            }
        };
    } else if ("TTL".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(SessionUtils.getTTLForSession(session));
            }
        };
    }
    //Todo: complete this to TTL,etc.
    return comparator;
}
项目:apache-tomcat-7.0.57    文件HTMLManagerServlet.java   
protected Comparator<Session> getComparator(String sortBy) {
    Comparator<Session> comparator = null;
    if ("CreationTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(session.getCreationTime());
            }
        };
    } else if ("id".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<String>() {
            @Override
            public Comparable<String> getComparableObject(Session session) {
                return session.getId();
            }
        };
    } else if ("LastAccessedTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(session.getLastAccessedTime());
            }
        };
    } else if ("MaxInactiveInterval".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(session.getMaxInactiveInterval());
            }
        };
    } else if ("new".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Boolean>() {
            @Override
            public Comparable<Boolean> getComparableObject(Session session) {
                return Boolean.valueOf(session.getSession().isNew());
            }
        };
    } else if ("locale".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<String>() {
            @Override
            public Comparable<String> getComparableObject(Session session) {
                return JspHelper.guessdisplayLocaleFromSession(session);
            }
        };
    } else if ("user".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<String>() {
            @Override
            public Comparable<String> getComparableObject(Session session) {
                return JspHelper.guessdisplayUserFromSession(session);
            }
        };
    } else if ("UsedTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(SessionUtils.getUsedTimeForSession(session));
            }
        };
    } else if ("InactiveTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(SessionUtils.getInactiveTimeForSession(session));
            }
        };
    } else if ("TTL".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(SessionUtils.getTTLForSession(session));
            }
        };
    }
    //Todo: complete this to TTL,etc.
    return comparator;
}
项目:WBSAirback    文件HTMLManagerServlet.java   
protected Comparator<Session> getComparator(String sortBy) {
    Comparator<Session> comparator = null;
    if ("CreationTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(session.getCreationTime());
            }
        };
    } else if ("id".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<String>() {
            @Override
            public Comparable<String> getComparableObject(Session session) {
                return session.getId();
            }
        };
    } else if ("LastAccessedTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(session.getLastAccessedTime());
            }
        };
    } else if ("MaxInactiveInterval".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(session.getMaxInactiveInterval());
            }
        };
    } else if ("new".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Boolean>() {
            @Override
            public Comparable<Boolean> getComparableObject(Session session) {
                return Boolean.valueOf(session.getSession().isNew());
            }
        };
    } else if ("locale".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<String>() {
            @Override
            public Comparable<String> getComparableObject(Session session) {
                return JspHelper.guessdisplayLocaleFromSession(session);
            }
        };
    } else if ("user".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<String>() {
            @Override
            public Comparable<String> getComparableObject(Session session) {
                return JspHelper.guessdisplayUserFromSession(session);
            }
        };
    } else if ("UsedTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(SessionUtils.getUsedTimeForSession(session));
            }
        };
    } else if ("InactiveTime".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(SessionUtils.getInactiveTimeForSession(session));
            }
        };
    } else if ("TTL".equalsIgnoreCase(sortBy)) {
        comparator = new BaseSessionComparator<Date>() {
            @Override
            public Comparable<Date> getComparableObject(Session session) {
                return new Date(SessionUtils.getTTLForSession(session));
            }
        };
    }
    //Todo: complete this to TTL,etc.
    return comparator;
}

相关文章

买水果
比较全面的redis工具类
gson 反序列化到多态子类
java 版本的 mb_strwidth
JAVA 反转字符串的最快方法,大概比StringBuffer.reverse()性...
com.google.gson.internal.bind.ArrayTypeAdapter的实例源码...