On Wed, May 29, 2013 at 12:59 PM, Tom Poage <[email protected]> wrote:

> On May 29, 2013, at 10:48 AM, Marvin Addison <[email protected]>
> wrote:
> > I believe there may some JMX components for Ehcache you could leverage
> for EhcacheTicketRegistry.
>
> On the verge of deploying w/ Ehcache, so will look into this (currently
> using Terracotta). As instrumented so far w/ JMX, I have access to summary
> statistics but not the actual data (I'm not all that knowledgeable on JMX &
> Spring, and new to both Ehcache and CAS).
>
> Agreed, would be a good feature implemented as perhaps both web UI and API
> (e.g. we'd invalidate TGTs and perform a number of other steps such as
> locking LDAP, Kerberos, ... accounts as part of a "panic button" utility).


If it helps, I just went through a similar exercise with Ehcache.  My first
instinct was to write a simple command line tool for scripting, but I could
not get a handle on the cache itself through JMX as you noted.

Ehcache Monitor looks nice, but is not free for production use.

I deployed a basic JSP to test whether could get a handle on the cache when
running in the same JVM.  It's possible:

         <%
//            CacheManager cacheManager =
CacheManager.getCacheManager("ticketRegistryCacheManager");
            CacheManager cacheManager =
CacheManager.getCacheManager("ehCacheTicketRegistryCache");
            Cache tgtCache =
cacheManager.getCache("org.jasig.cas.ticket.TicketGrantingTicket");
        %>

        <ol>
            <%
                for (Object key : tgtCache.getKeys()) {
                    Ticket ticket =
(Ticket)tgtCache.get(key).getObjectValue();

                    out.println("<li>" + key.toString());
                    out.println("<ul>");
                    out.println("<li>ID: " + ticket.getId() + "</li>");
                    out.println("<li>Count of uses: " +
ticket.getCountOfUses()+ "</li>");
                    out.println("<li>Creation Time: " +
ticket.getCreationTime() + "</li>");
                    out.println("<li>Is Expired? " + ticket.isExpired() +
"</li>");
                    out.println("</ul>");
                    out.println("</li>");
                }

            %>
        </ol>

It's good to hear there is a least the start of a RESTful API, and I need
to look into that further.  No doubt, it would be far preferable to work
through a CAS API to both retrieve/destroy when support needs arise.

best,
scott

-- 
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

Reply via email to