Klasse ReceivingServiceConfigBuilder<R extends BaseConnectionBuilder<?,?>>

java.lang.Object
org.freedesktop.dbus.connections.config.ReceivingServiceConfigBuilder<R>
Typparameter:
R - BaseConnectionBuilder type

public final class ReceivingServiceConfigBuilder<R extends BaseConnectionBuilder<?,?>> extends Object
Configuration builder to configure ReceivingService. Only intended to be used in combination with BaseConnectionBuilder
Seit:
4.2.0 - 2022-07-14
Autor:
hypfvieh
  • Felddetails

    • DEFAULT_HANDLER_RETRIES

      public static final int DEFAULT_HANDLER_RETRIES
      Siehe auch:
  • Konstruktordetails

    • ReceivingServiceConfigBuilder

      public ReceivingServiceConfigBuilder(Supplier<R> _bldr)
  • Methodendetails

    • withSignalThreadCount

      public ReceivingServiceConfigBuilder<R> withSignalThreadCount(int _threads)
      Set the size of the thread-pool used to handle signals from the bus. Caution: Using thread-pool size > 1 may cause signals to be handled out-of-order

      Default: 1

      Parameter:
      _threads - int >= 1
      Gibt zurück:
      this
    • withErrorHandlerThreadCount

      public ReceivingServiceConfigBuilder<R> withErrorHandlerThreadCount(int _threads)
      Set the size of the thread-pool used to handle error messages received on the bus.

      Default: 1

      Parameter:
      _threads - int >= 1
      Gibt zurück:
      this
    • withMethodCallThreadCount

      public ReceivingServiceConfigBuilder<R> withMethodCallThreadCount(int _threads)
      Set the size of the thread-pool used to handle methods calls previously sent to the bus. The thread pool size has to be > 1 to handle recursive calls.

      Default: 4

      Parameter:
      _threads - int >= 1
      Gibt zurück:
      this
    • withMethodReturnThreadCount

      public ReceivingServiceConfigBuilder<R> withMethodReturnThreadCount(int _threads)
      Set the size of the thread-pool used to handle method return values received on the bus.

      Default: 1

      Parameter:
      _threads - int >= 1
      Gibt zurück:
      this
    • withSignalThreadPriority

      public ReceivingServiceConfigBuilder<R> withSignalThreadPriority(int _priority)
      Sets the thread priority of the created signal thread(s).

      Default: Thread.NORM_PRIORITY (5);

      Parameter:
      _priority - int >=1 and <= 10
      Gibt zurück:
      this
      Löst aus:
      IllegalArgumentException - when value is out ouf range (value < 1 && > 10)
    • withErrorThreadPriority

      public ReceivingServiceConfigBuilder<R> withErrorThreadPriority(int _priority)
      Sets the thread priority of the created signal thread(s).

      Default: Thread.NORM_PRIORITY (5);

      Parameter:
      _priority - int >=1 and <= 10
      Gibt zurück:
      this
      Löst aus:
      IllegalArgumentException - when value is out ouf range (value < 1 && > 10)
    • withMethedCallThreadPriority

      public ReceivingServiceConfigBuilder<R> withMethedCallThreadPriority(int _priority)
      Sets the thread priority of the created signal thread(s).

      Default: Thread.NORM_PRIORITY (5);

      Parameter:
      _priority - int >=1 and <= 10
      Gibt zurück:
      this
      Löst aus:
      IllegalArgumentException - when value is out ouf range (value < 1 && > 10)
    • withMethodReturnThreadPriority

      public ReceivingServiceConfigBuilder<R> withMethodReturnThreadPriority(int _priority)
      Sets the thread priority of the created signal thread(s).

      Default: Thread.NORM_PRIORITY (5);

      Parameter:
      _priority - int >=1 and <= 10
      Gibt zurück:
      this
      Löst aus:
      IllegalArgumentException - when value is out ouf range (value < 1 && > 10)
    • withRetryHandler

      public ReceivingServiceConfigBuilder<R> withRetryHandler(IThreadPoolRetryHandler _handler)
      Sets the retry handler which should be called when executing a runnable in ReceivingService thread pools fail.

      Defaults to an implementation retrying executing the runnable up to ten times. If null is given, retrying will be disabled (but error will be logged).

      Parameter:
      _handler - handler to use
      Gibt zurück:
      this
    • build

      public ReceivingServiceConfig build()
      Returns the configured ReceivingServiceConfig instance.
      Gibt zurück:
      config never null
    • connectionConfig

      public R connectionConfig()
      Returns the used ConnectionBuilder for the connection for further configuration.
      Gibt zurück:
      connection builder
    • getDefaultConfig

      public static ReceivingServiceConfig getDefaultConfig()
      Returns the default configuration used for ReceivingService.
      Gibt zurück:
      default config
    • getDefaultRetryHandler

      public static IThreadPoolRetryHandler getDefaultRetryHandler()
      Returns the default retry handler used for ReceivingService.
      Gibt zurück:
      default handler