Class LockServiceFactory

    • Constructor Detail

      • LockServiceFactory

        public LockServiceFactory()
    • Method Detail

      • setRegions

        public void setRegions​(List<LockRegionConfig> regions)
        Sets the list of lock region configurations that should be registered to the LockService.
        Parameters:
        regions - Lock regions configuration.
      • setConfigProviders

        public void setConfigProviders​(List<LockConfigProvider> configProviders)
        Sets the list of lock region configuration providers.
        Parameters:
        configProviders - Lock region configuration providers.
        See Also:
        LockConfigProvider
      • getRetryInterval

        public long getRetryInterval()
        Returns the time interval in milliseconds between retry attempts in case of network communication failures (see setRetryInterval(long)).
        Returns:
        Time interval in milliseconds.
      • setRetryInterval

        public void setRetryInterval​(long retryInterval)
        Sets the time interval in milliseconds between retry attempts in case of network communication failures.

        Value of this parameter must be above zero. Default value is 50.

        Parameters:
        retryInterval - Time interval in milliseconds.
      • withRetryInterval

        public LockServiceFactory withRetryInterval​(long retryInterval)
        Fluent-style version of setRetryInterval(long).
        Parameters:
        retryInterval - Time interval in milliseconds.
        Returns:
        This instance.
      • getWorkerThreads

        public int getWorkerThreads()
        Returns the size of a thread pool that will perform locks management operations (see setWorkerThreads(int)).
        Returns:
        Worker thread pool size.
      • setWorkerThreads

        public void setWorkerThreads​(int workerThreads)
        Sets the side of a thread pool that will perform lock management operations.

        Thread pool of this size is used by the LockService to perform in-memory lock operations.

        Value of this parameter must be equals or greater than 1. Default value is 1.

        Parameters:
        workerThreads - Worker thread pool size.
      • withWorkerThreads

        public LockServiceFactory withWorkerThreads​(int workerThreads)
        Fluent-style version of setWorkerThreads(int).
        Parameters:
        workerThreads - Worker thread pool size.
        Returns:
        This instance.
      • getNioThreads

        public int getNioThreads()
        Returns the size of a thread pool for handling NIO-based network communications (see setNioThreads(int)).
        Returns:
        NIO thread pool size.
      • setNioThreads

        public void setNioThreads​(int nioThreads)
        Sets the size of a thread pool for handling NIO-based network communications.

        If value of this parameter is above zero then a dedicated thread pool will be used for handling NIO-based network communications. If this parameter is less than or equals to zero (default value) then the core thread pool of a NetworkService will be used (see NetworkServiceFactory.setNioThreads(int)).

        Parameters:
        nioThreads - NIO thread pool size.
      • withNioThreads

        public LockServiceFactory withNioThreads​(int nioThreads)
        Fluent-style version of setNioThreads(int).
        Parameters:
        nioThreads - NIO thread pool size.
        Returns:
        This instance.