关于创建/销毁缓存的说明

Clarification around creating / destroying caches

我正在尝试了解如何为客户端-服务器模型管理缓存和区域的生命周期。我看到 RegionFactory 有一个 createRegion(String name) 方法。这是否处理服务器上的区域生命周期或只是创建与服务器上的区域关联的区域 class 的实例?如果我想让多个客户端访问同一个区域,他们可以用相同的区域名称调用 RegionFactory.createRegion() 吗?如果我想从客户端以编程方式创建和销毁区域怎么办?谢谢!

Does this handle region lifecycles on the servers or just create an instance of the Region class associated with a region on the servers?

它只是在客户端创建一个区域实例,您将使用 cache.xml 或 gfsh 在服务器上创建区域。

If I want multiple clients to access the same region, can they just call RegionFactory.createRegion() with the same region name?

是的。

What if I want to create and destroy regions programmatically from the client?

您可以使用 Function execution 从客户端以编程方式创建区域。