java.lang.Object
org.mule.sdk.api.store.ObjectStoreSettings.Builder
- Enclosing class:
- ObjectStoreSettings
A Builder for creating
ObjectStoreSettings- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns the built settings object.Sets the entry timeout in milliseconds.expirationInterval(Long expirationInterval) Sets how frequently should the expiration thread run.maxEntries(Integer maxEntries) Sets the max number of entries allowed.persistent(boolean persistent) Sets whether the store should be persistent or transient.
-
Method Details
-
persistent
Sets whether the store should be persistent or transient.If not invoked, the described
ObjectStorewill be persistent by default.- Parameters:
persistent-trueif the store should be persistent- Returns:
thisbuilder
-
maxEntries
Sets the max number of entries allowed. Exceeding entries will be removed when expiration thread runs- Parameters:
maxEntries- the number of entries allowed- Returns:
thisbuilder
-
entryTtl
Sets the entry timeout in milliseconds.- Parameters:
entryTtl- timeout in milliseconds- Returns:
thisbuilder
-
expirationInterval
Sets how frequently should the expiration thread run.If not set, it will default to
ObjectStoreSettings.DEFAULT_EXPIRATION_INTERVAL, but will only be used by the runtime ifentryTtl(Long)ormaxEntries(Integer)was also invoked.Setting this to a value lower or equal than zero is also equivalent to disabling expiration.
- Parameters:
expirationInterval- interval in milliseconds. Greater than zero- Returns:
thisbuilder
-
build
Returns the built settings object.thisinstance should be discarded and no longer used after invoking this method- Returns:
- the built
ObjectStoreSettingsobject
-