Class MsgModuleOptionsBuilder<O>
java.lang.Object
com.scaleoutsoftware.modules.hosting.MsgModuleOptionsBuilder<O>
- Type Parameters:
O- the SOSS object type.
The ModuleOptionsBuilder is used to create a
MsgModuleOptions.
Defaults:
LockMode: LockMode.None.
Serializer: a Gson backed CacheSerializer.
Deserializer: a Gson backed CacheDeserializer.
JSON serialization: true.-
Constructor Summary
ConstructorsConstructorDescriptionMsgModuleOptionsBuilder(Type sossObjectType) Instantiate the builder with the SOSS object type. -
Method Summary
Modifier and TypeMethodDescriptionbuild()builds theMsgModuleOptions.setLockMode(LockMode lockMode) Sets theLockModeof theModulePackage.setSerialization(com.scaleout.client.caching.CacheSerializer<O> serializer, com.scaleout.client.caching.CacheDeserializer<O> deserializer, boolean isJsonSerializer) Sets theCacheSerializer,CacheDeserializer, and flag for if the SOSS objects are serialized to JSON.
-
Constructor Details
-
MsgModuleOptionsBuilder
Instantiate the builder with the SOSS object type.- Parameters:
sossObjectType- the SOSS object type.
-
-
Method Details
-
setLockMode
Sets theLockModeof theModulePackage.- Parameters:
lockMode-LockMode.Noneif no locking is required,LockMode.Exclusiveif SOSS object accesses should be exclusive (done under a lock).- Returns:
- this
MsgModuleOptionsBuilder.
-
setSerialization
public MsgModuleOptionsBuilder<O> setSerialization(com.scaleout.client.caching.CacheSerializer<O> serializer, com.scaleout.client.caching.CacheDeserializer<O> deserializer, boolean isJsonSerializer) Sets theCacheSerializer,CacheDeserializer, and flag for if the SOSS objects are serialized to JSON.- Parameters:
serializer- theCacheSerializer.deserializer- theCacheDeserializer.isJsonSerializer- true if theCacheSerializeris returning serialized JSON.- Returns:
- this
MsgModuleOptionsBuilder.
-
build
builds theMsgModuleOptions. If not previously set through the available setters, the following defaults will be used: LockMode:LockMode.None. Serializer: aGsonbackedCacheSerializer. Deserializer: aGsonbackedCacheDeserializer. JSON serialization: true.- Returns:
- an instantiated
MsgModuleOptions.
-