Class ReceivingServiceConfigBuilder<R extends BaseConnectionBuilder<?,?>>
java.lang.Object
org.freedesktop.dbus.connections.config.ReceivingServiceConfigBuilder<R>
- Type Parameters:
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- Since:
- 4.2.0 - 2022-07-14
- Author:
- hypfvieh
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns the configuredReceivingServiceConfiginstance.Returns the used ConnectionBuilder for the connection for further configuration.static ReceivingServiceConfigReturns the default configuration used forReceivingService.static IThreadPoolRetryHandlerReturns the default retry handler used forReceivingService.withErrorHandlerThreadCount(int _threads) Set the size of the thread-pool used to handle error messages received on the bus.withErrorThreadPriority(int _priority) Sets the thread priority of the created signal thread(s).withMethedCallThreadPriority(int _priority) Sets the thread priority of the created signal thread(s).withMethodCallThreadCount(int _threads) Set the size of the thread-pool used to handle methods calls previously sent to the bus.withMethodReturnThreadCount(int _threads) Set the size of the thread-pool used to handle method return values received on the bus.withMethodReturnThreadPriority(int _priority) Sets the thread priority of the created signal thread(s).withRetryHandler(IThreadPoolRetryHandler _handler) Sets the retry handler which should be called when executing a runnable inReceivingServicethread pools fail.withSignalThreadCount(int _threads) Set the size of the thread-pool used to handle signals from the bus.withSignalThreadPriority(int _priority) Sets the thread priority of the created signal thread(s).
-
Field Details
-
DEFAULT_HANDLER_RETRIES
public static final int DEFAULT_HANDLER_RETRIES- See Also:
-
-
Constructor Details
-
ReceivingServiceConfigBuilder
-
-
Method Details
-
withSignalThreadCount
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-orderDefault: 1
- Parameters:
_threads- int >= 1- Returns:
- this
-
withErrorHandlerThreadCount
Set the size of the thread-pool used to handle error messages received on the bus.Default: 1
- Parameters:
_threads- int >= 1- Returns:
- this
-
withMethodCallThreadCount
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
- Parameters:
_threads- int >= 1- Returns:
- this
-
withMethodReturnThreadCount
Set the size of the thread-pool used to handle method return values received on the bus.Default: 1
- Parameters:
_threads- int >= 1- Returns:
- this
-
withSignalThreadPriority
Sets the thread priority of the created signal thread(s).Default:
Thread.NORM_PRIORITY(5);- Parameters:
_priority- int >=1 and <= 10- Returns:
- this
- Throws:
IllegalArgumentException- when value is out ouf range (value < 1 && > 10)
-
withErrorThreadPriority
Sets the thread priority of the created signal thread(s).Default:
Thread.NORM_PRIORITY(5);- Parameters:
_priority- int >=1 and <= 10- Returns:
- this
- Throws:
IllegalArgumentException- when value is out ouf range (value < 1 && > 10)
-
withMethedCallThreadPriority
Sets the thread priority of the created signal thread(s).Default:
Thread.NORM_PRIORITY(5);- Parameters:
_priority- int >=1 and <= 10- Returns:
- this
- Throws:
IllegalArgumentException- when value is out ouf range (value < 1 && > 10)
-
withMethodReturnThreadPriority
Sets the thread priority of the created signal thread(s).Default:
Thread.NORM_PRIORITY(5);- Parameters:
_priority- int >=1 and <= 10- Returns:
- this
- Throws:
IllegalArgumentException- when value is out ouf range (value < 1 && > 10)
-
build
Returns the configuredReceivingServiceConfiginstance.- Returns:
- config never null
-
connectionConfig
Returns the used ConnectionBuilder for the connection for further configuration.- Returns:
- connection builder
-
getDefaultConfig
Returns the default configuration used forReceivingService.- Returns:
- default config
-
getDefaultRetryHandler
Returns the default retry handler used forReceivingService.- Returns:
- default handler
-