Este conteúdo não está disponível no idioma selecionado.
Chapter 7. Remotely Creating Caches
When you remotely create caches with the cache-service, you can configure caches to be ephemeral or permanent and if data is replicated across the cluster.
You can define any custom configuration when you remotely create caches with the datagrid-service.
Remotely create cache definitions with the cache-service and datagrid-service through the Hot Rod protocol as follows:
-
Instantiate the
RemoteCacheManagerclass to connect to the service. Call the
createCache()method to create a cache, as in the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf the named cache already exists, an exception is thrown. Alternatives are to:
-
Call the
getOrCreateCachemethod inRemoteCacheManagerAdminto return the cache name instead of throwing an exception. -
Call the
removeCachemethod inRemoteCacheManagerAdminto destroy the cache and then callcreateCacheagain.
-
Call the
Try one of the Quickstart Tutorials: