5 Replies Latest reply on Jul 20, 2009 5:31 AM by Galder Zamarreño

    How to get cache size programmatically

    Somdatta Kale Newbie

      Hi, I am using jboss cache core 3.1.0 and want to display cache size (the number of nodes in it). But looking at APIs, Cache doesn't support method to get this information, however this is available in CacheSPI. But I can not use this interface directly in my code as per documentation

      A reference to this interface should only be obtained when it is passed in to your code, for example when you write an CommandInterceptor or CacheLoader. You should NEVER attempt to directly cast a Cache instance to this interface. In future, the implementation may not allow it.


      As I am not using CacheLoader and I dont want to write CommandInterceptor how this can be done?