Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8891161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:40:04+00:00 2026-06-14T22:40:04+00:00

Question Background: We are rolling out an upgrade to a 3rd party application that

  • 0

Question Background:

We are rolling out an upgrade to a 3rd party application that uses ehcache for caching. We plan to have four servers clustered in production.

The vendor has provided the default ehcache configuration to cluster over rmi, using multicast to discover the peers.

The problem is that our network does not support multicast in the short term, so we are having to overwrite the default configuration to manually specify the peers. Using terracotta is out of the question due to budget constraints.

As this is an upgrade project, I will not be able to truly test the results of the manual configuration until go-live. The manual configuration is many characters long, manually written, so there is risk that errors may exist.

My question

Is there an open source jsp or similar that can be used to display the cache clustering information to the screen. We can incorporate this into the 3rd party application, and use it to quickly validate that the peers were discovered correctly.

What I’ve looked into

I’ve used google to search for ehache, but my filtering skills have failed to narrow down the results to anything useful.

I’ve looked at using logs to track when caching occurs, and am not 100% happy with this approach.

Failing to find a pre-built solution will require me to write my own.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T22:40:05+00:00Added an answer on June 14, 2026 at 10:40 pm

    I had to write this myself. Here is the code if others need it.

    @Controller
    @RequestMapping(value = "/tools/ehcache")
    public class EhcacheManagerController {
    
    private static final String VIEW_URL = "/WEB-INF/views/tools/ehcache/ehcache.jsp";
    
    private static final String ALL = "all";
    
    List<CacheManager> allCacheManagers = CacheManager.ALL_CACHE_MANAGERS;
    
    private static final Log logger = LogFactory.getLog(EhcacheManagerController.class);
    
    @RequestMapping(method = RequestMethod.GET)
    protected String loadPage(ModelMap modelMap) throws Exception {
    
        // Manager (keyed by name) --> Cache (keyed by name) --> Peer Information (keyed by peer Name)
    
        Map<String,Map<String,Map<String,String>>> managerMap = new HashMap<String,Map<String,Map<String,String>>>();
        for (CacheManager cacheManager : allCacheManagers) {
            Map<String,Map<String,String>> cacheMap = new HashMap<String,Map<String,String>>();
            managerMap.put(cacheManager.getName(), cacheMap);           
    
            String[] cacheNames = cacheManager.getCacheNames();
            for (String name : cacheNames) {
                Map<String,String> peerInfoMap = new HashMap<String,String>();
                cacheMap.put(name,peerInfoMap);
    
                CacheManagerPeerProvider provider = cacheManager.getCacheManagerPeerProvider("RMI");
                if (provider == null) {
                    peerInfoMap.put("nopeer","no status");
                    break;
                }
    
                Cache ehcache = cacheManager.getCache(name);
                List<CachePeer> cachePeers = provider.listRemoteCachePeers(ehcache);
                for (CachePeer cachePeer : cachePeers) {
                    StringBuilder cacheStatus = new StringBuilder();
                    String peerName = cachePeer.getName();
                    cacheStatus.append("url='").append(cachePeer.getUrl()).append("' ");
                    cacheStatus.append("keyssize='").append(cachePeer.getKeys().size()).append("' ");
    
                    peerInfoMap.put(peerName,cacheStatus.toString());
                }
    
    
            }
    
        }
    
        modelMap.put("managerMap", managerMap);
    
        return VIEW_URL;
    }
    }
    

    the jsp

    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"     "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>EHCache</title>
    </head>
    <body>
    <h1>EHCache</h1>
    
    <p><a href="/tools/ehcache/clear?name=all">Clear All</a></p>
    <c:forEach items="${managerMap}" var="manager">
    <h2>Manager: '${manager.key}'</h2>
    
        <c:forEach var="cacheMap" items="${manager.value}">
            <h3>Cache: '${cacheMap.key}'</h3>
            <p><a href="/tools/ehcache/clear?cacheManagerName=${manager.key}&cacheName=${cacheMap.key}">clear</a></p>
    
            <c:forEach var="peerInfoMap" items="${cacheMap.value}">
                <li>peer name = ${peerInfoMap.key} peer status = ${peerInfoMap.value}</li>
            </c:forEach>    
        </c:forEach>
    
    
    </c:forEach>
    
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry if this is a silly question :-) Background I have legacy code that
Background to question: We are building an online web application that requires the user
Background to Question: Software for analysing blood glucose readings for diabetics, typically have something
Edit 4: A new formatting for the question BACKGROUND: I have a class, Window,
See this question for the background. Basically, I have the following definition of a
Background to question: I'm looking to implement a caching system for my website. Currently
Follow-up to this question: Setting background-color of select options in JQuery I have a
Background of question Analysis of Zend_Log reveals following Class Diagram Zend_Log: uses ReflectionClass &
Before I begin my question a little background info. I have the WCF service
The background to this question is that I need to use some user session

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.