Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-19

different cache manager impl : LocalCacheManager and ClusteredCacheManager

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Obsolete
    • Minor
    • None
    • None
    • Core
    • None

    Description

      consider having two CacheManagers impl: LocalCacheaManager and ClusteredCacheManager.
      This is in order to offer a more clear API to the user, who might want to use a specific cache manager.
      Currently, this is achieved through usage of GlobalConfiguration.getClusterDefault()/getNonClusterDefault(), but this is not very clear to the user.
      Also, after trying to create an replicated cache on a cache manager build on an "getNonClusterDefault" config, there will be an unclear error message:
      ""Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.horizon.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:129)
      ... 35 more
      Caused by: java.lang.NullPointerException
      at org.horizon.statetransfer.StateTransferManagerImpl.start(StateTransferManagerImpl.java:116)
      ... 40 more
      Error should be more specific, something like: "You're not allowed to deploy an clustered cache on an local cache manager".
      public void testCreateReplicatedCacheOnLocalCM()

      { GlobalConfiguration globalConfiguration = GlobalConfiguration.getNonClusteredDefault(); globalConfiguration.setAllowDuplicateDomains(true); CacheManager dcm1 = new DefaultCacheManager(globalConfiguration); CacheManager dcm2 = new DefaultCacheManager(globalConfiguration); Configuration conf = new Configuration(); conf.setCacheMode(Configuration.CacheMode.REPL_SYNC); dcm1.defineCache("replicated", conf); dcm2.defineCache("replicated", conf); dcm1.getCache("replicated"); dcm2.getCache("replicated"); }

      Attachments

        Activity

          People

            Unassigned Unassigned
            mircea.markus Mircea Markus (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: