이 콘텐츠는 선택한 언어로 제공되지 않습니다.
2.2. Creating CacheManagers
2.2.1. Create a New RemoteCacheManager 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Use the following configuration to configure a new
RemoteCacheManager
:
Configuration Explanation
An explanation of each line of the provided configuration is as follows:
- Use the
ConfigurationBuilder()
method to configure a new builder. The.addServer()
property adds a remote server, specified via the.host(<hostname|ip>)
and.port(<port>)
properties.Configuration conf = new ConfigurationBuilder().addServer().host(<hostname|ip>).port(<port>).build();
Configuration conf = new ConfigurationBuilder().addServer().host(<hostname|ip>).port(<port>).build();
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create a new
RemoteCacheManager
using the supplied configuration.RemoteCacheManager manager = new RemoteCacheManager(conf);
RemoteCacheManager manager = new RemoteCacheManager(conf);
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Retrieve the default cache from the remote server.
RemoteCache defaultCache = manager.getCache();
RemoteCache defaultCache = manager.getCache();
Copy to Clipboard Copied! Toggle word wrap Toggle overflow