Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-393

FunctionContext should provide a Cache

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0
    • functions

    Description

      FunctionContext has methods to get the arguments to the function and the result sender, but there is no way to get the Cache or DistributedSystem.

      This means pretty much any function will need to statically look up the cache using CacheFactory.getAnyInstance(). While that works, it makes it impossible to write unit tests for functions by passing in a mock cache.

      Note that onRegion functions are provided a RegionFunctionContext, which does provide these functions with a means to look up the cache, but not all functions are applied to a region.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              upthewaterspout Dan Smith
              Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: