Uploaded image for project: 'JBoss Cache'
  1. JBoss Cache
  2. JBCACHE-1053

RmiCacheServer and TcpCacheServer try to create an mbean proxy to a CacheImpl

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.0.0.CR1
    • Fix Version/s: 2.0.0.CR2
    • Component/s: None
    • Labels:
      None

      Description

      RmiCacheServer.start() has this:

      MBeanServer server = JmxUtil.getMBeanServer();
      if (cacheName != null && server != null)
      {
      cache = (CacheImpl) MBeanServerInvocationHandler.newProxyInstance(server, cacheName, CacheImpl.class, false);
      }

      There won't be anything registered in JMX that you can proxy with the CacheImpl API.

      This could work:

      MBeanServer server = JmxUtil.getMBeanServer();
      if (cacheName != null && server != null)
      {
      CacheJmxWrapperMBean wrapper = (CacheJmxWrapperMBean ) MBeanServerInvocationHandler.newProxyInstance(server, cacheName, CacheJmxWrapperMBean.class, false);
      cache = (CacheImpl) wrapper.getCache();
      }

      In this case, cache is no longer a JMX proxy though, it's a ref to the underlying cache.

      Probably better is just to get rid of this lookup and require injection of the CacheImpl or the CacheJmxWrapper.

      Also, it would be nice if RemoteTreeCacheImpl could delegate to Cache instead of CacheImpl. Then there's no need to cast the wrapper.getCache() call and it's simpler to do dependency injection.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                brian.stansberry Brian Stansberry
                Reporter:
                brian.stansberry Brian Stansberry
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: