Class KeyValueStores
java.lang.Object
com.codename1.backend.kv.KeyValueStores
Opens the KeyValueStore a configuration names, and finds the one of the
calling thread's server.
| Setting | Default | |
|---|---|---|
cn1.kv.url |
memory: |
memory:, redis://... or rediss://... |
cn1.kv.timeout |
5000 | milliseconds a connection or a reply may take |
cn1.kv.pool.max |
16 | idle connections kept |
Without cn1.kv.url, Spring Boot's spring.data.redis.url is used, and
without that spring.data.redis.host (with .port, .username,
.password, .database and .ssl.enabled) -- so a Spring configuration
carries over unchanged. Nothing set at all is the in-process store.
-
Method Summary
Modifier and TypeMethodDescriptionstatic KeyValueStorecurrent()The store of the calling thread's server: opened from its configuration the first time it is asked for, and closed when the server stops.static booleanisConfigured(Config config) Whetherconfignames a shared store, not the in-process one.static KeyValueStoreOpens the storeconfignames; the caller closes it.static KeyValueStoreOpens the store aturl; the caller closes it.
-
Method Details
-
current
The store of the calling thread's server: opened from its configuration the first time it is asked for, and closed when the server stops.- Throws:
IOException
-
isConfigured
Whetherconfignames a shared store, not the in-process one.- Throws:
IOException
-
open
Opens the storeconfignames; the caller closes it.- Throws:
IOException
-
open
Opens the store aturl; the caller closes it.- Throws:
IOException
-