Package org.freedesktop.dbus.connections
Class ReceivingService
java.lang.Object
org.freedesktop.dbus.connections.ReceivingService
Service providing threads for every type of message expected to be received by DBus.
- Version:
- 4.1.0 - 2022-02-02
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum representing different executor services.static interfaceInterface which specifies a handler which will be called when the thread pool throws any exception. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final Map<ReceivingService.ExecutorNames, ExecutorService> private final org.slf4j.Logger(package private) static final intprivate final ReceivingService.IThreadPoolRetryHandler -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) intExecute a runnable which handles an error.(package private) intExecute a runnable which handles a method call.(package private) intExecute a runnable which handles the return of a method.(package private) intexecOrFail(ReceivingService.ExecutorNames _executor, Runnable _r) Executes a runnable in a given executor.(package private) intExecute a runnable which handles a signal.(package private) ExecutorServicegetExecutor(ReceivingService.ExecutorNames _executor) Returns the executor or null.voidShutdown all executor services waiting up to the given timeout/unit.voidForcefully stop the executors.
-
Field Details
-
MAX_RETRIES
static final int MAX_RETRIES- See Also:
-
logger
private final org.slf4j.Logger logger -
closed
private boolean closed -
executors
-
retryHandler
-
-
Constructor Details
-
ReceivingService
ReceivingService(ReceivingServiceConfig _rsCfg) Creates a new instance.- Parameters:
_rsCfg- configuration
-
-
Method Details
-
execSignalHandler
Execute a runnable which handles a signal.- Parameters:
_r- runnable- Returns:
- retries, if any input was null -1 is returned
-
execErrorHandler
Execute a runnable which handles an error.- Parameters:
_r- runnable- Returns:
- retries, if any input was null -1 is returned
-
execMethodCallHandler
Execute a runnable which handles a method call.- Parameters:
_r- runnable- Returns:
- retries, if any input was null -1 is returned
-
execMethodReturnHandler
Execute a runnable which handles the return of a method.- Parameters:
_r- runnable- Returns:
- retries, if any input was null -1 is returned
-
execOrFail
Executes a runnable in a given executor. May retry execution ifExecutorServicehas thrown an exception and retry handler allows re-processing. When re-processing fails for 50 or more retries, an error will be logged and the runnable will not be executed.- Parameters:
_executor- executor to use_r- runnable- Returns:
- retries, if any input was null -1 is returned
-
getExecutor
Returns the executor or null.- Parameters:
_executor- executor to use- Returns:
- executor or null
-
shutdown
Shutdown all executor services waiting up to the given timeout/unit.- Parameters:
_timeout- timeout_unit- time unit
-
shutdownNow
public void shutdownNow()Forcefully stop the executors.
-