<%@ page import="com.atlassian.jira.ComponentManager"%>
<%@ page import="com.atlassian.jira.issue.customfields.manager.GenericConfigManager"%>
<%@ page import="com.atlassian.jira.issue.fields.config.manager.FieldConfigSchemeManager"%>
<%@ page import="com.atlassian.jira.issue.fields.config.persistence.FieldConfigSchemePersister"%>
<%@ page import="com.atlassian.jira.issue.fields.option.OptionSetManager"%>
<%@ page import="com.atlassian.jira.util.EasyList"%>
<%@ page import="com.atlassian.jira.util.cache.JiraCachedManager"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="java.util.List"%>



<html>
<head>
    <title><webwork:text name="'admin.cacheviewer.views.size.of.caches'"/></title>
</head>
<body>
<table class="grid">
    <tr>
        <th>
            <webwork:text name="'admin.cacheviewer.manager.class'"/>
        </th>
        <td>
            <webwork:text name="'admin.cacheviewer.total.cache.size'"/>
        </td>
    </tr>
    <%
    List cachedManagers = EasyList.build(OptionSetManager.class,
                                         GenericConfigManager.class,
                                         FieldConfigSchemeManager.class,
                                         FieldConfigSchemePersister.class);

        for (Iterator iterator = cachedManagers.iterator(); iterator.hasNext();)
        {
            Class aClass = (Class) iterator.next();
    %>
    <tr>
        <th>
            <%=aClass%>
        </th>
        <td>
            <%=((JiraCachedManager) ComponentManager.getComponentInstanceOfType(aClass)).getCacheSize()%>
        </td>
    </tr>
    <%
        }
    %>
</table>
</body>
</html>