@Override
  public void execute(FunctionContext context) {
    final Cache cache = CacheFactory.getAnyInstance();

    if (!(cache instanceof Extensible)) {
      throw new FunctionException("Not extensible cache.");
    }

    final String value = (String) ((Object[]) context.getArguments())[0];

    @SuppressWarnings("unchecked")
    final Extensible<Cache> extensible = (Extensible<Cache>) cache;
    for (Extension<Cache> extension : extensible.getExtensionPoint().getExtensions()) {
      if (extension instanceof MockCacheExtension) {
        ((MockCacheExtension) extension).setValue(value);
      }
    }

    final XmlEntity xmlEntity =
        XmlEntity.builder().withType(ELEMENT_CACHE).withNamespace(PREFIX, NAMESPACE).build();

    final ResultSender<Object> resultSender = context.getResultSender();
    final String memberNameOrId =
        CliUtils.getMemberNameOrId(cache.getDistributedSystem().getDistributedMember());

    resultSender.lastResult(new CliFunctionResult(memberNameOrId, xmlEntity, CliStrings
        .format("Mock cache extension altered on \"{0}\"", new Object[] {memberNameOrId})));
  }
Function to create {@link MockCacheExtension} on a {@link Region}.


@since GemFire 8.1
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/extension/mock/AlterMockCacheExtensionFunction.java