1 Reply Latest reply on Mar 17, 2009 7:13 AM by Manik Surtani

    CacheJmxWrapperMBean is deprecated, but the documentation st

    memoryerror Newbie

      We have this code based on what's in the documentation, in order to get our cache (deployed using the jmx microcontainer) and return it to our application code:

      final MBeanServer server = MBeanServerLocator.locateJBoss();
      final ObjectName objectName = new ObjectName(sCacheName);
      @SuppressWarnings("unchecked")
      final CacheJmxWrapperMBean<String, Object> cacheWrapper =
      (CacheJmxWrapperMBean<String, Object>)
      MBeanServerInvocationHandler.newProxyInstance(
      server, objectName, CacheJmxWrapperMBean.class, true);
      sCache = cacheWrapper.getCache();
      return sCache;

      But CacheJmxWrapperMBean is deprecated.

      What's the correct way to get the cache now?