Class MsgModuleOptionsBuilder<O>

java.lang.Object
com.scaleoutsoftware.modules.hosting.MsgModuleOptionsBuilder<O>
Type Parameters:
O - the SOSS object type.

public class MsgModuleOptionsBuilder<O> extends Object
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 Details

    • MsgModuleOptionsBuilder

      public MsgModuleOptionsBuilder(Type sossObjectType)
      Instantiate the builder with the SOSS object type.
      Parameters:
      sossObjectType - the SOSS object type.
  • Method Details

    • setLockMode

      public MsgModuleOptionsBuilder<O> setLockMode(LockMode lockMode)
      Sets the LockMode of the ModulePackage.
      Parameters:
      lockMode - LockMode.None if no locking is required, LockMode.Exclusive if 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 the CacheSerializer, CacheDeserializer, and flag for if the SOSS objects are serialized to JSON.
      Parameters:
      serializer - the CacheSerializer.
      deserializer - the CacheDeserializer.
      isJsonSerializer - true if the CacheSerializer is returning serialized JSON.
      Returns:
      this MsgModuleOptionsBuilder.
    • build

      public MsgModuleOptions<O> build()
      builds the MsgModuleOptions. If not previously set through the available setters, the following defaults will be used: LockMode: LockMode.None. Serializer: a Gson backed CacheSerializer. Deserializer: a Gson backed CacheDeserializer. JSON serialization: true.
      Returns:
      an instantiated MsgModuleOptions.