Class BaseConnectionBuilder<R extends BaseConnectionBuilder<R,C>,C extends AbstractConnection>
java.lang.Object
org.freedesktop.dbus.connections.impl.BaseConnectionBuilder<R,C>
- Type Parameters:
R- concrete type of connection builder
- Direct Known Subclasses:
DBusConnectionBuilder,DirectConnectionBuilder
public abstract class BaseConnectionBuilder<R extends BaseConnectionBuilder<R,C>,C extends AbstractConnection>
extends Object
Base class for connection builders containing commonly used options.
- Since:
- 4.2.0 - 2022-07-13
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IDisconnectCallbackprivate byteprivate final ReceivingServiceConfigBuilder<R> private final TransportConfigBuilder<?, R> private boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseConnectionBuilder(Class<R> _returnType, BusAddress _address) -
Method Summary
Modifier and TypeMethodDescriptionabstract Cbuild()protected ReceivingServiceConfigCreates the configuration to use forReceivingService.protected TransportConfigCreates the configuration to use forTransportBuilder.protected IDisconnectCallbackprotected bytestatic byteGet the default system endianness.protected booleanReturns the builder to configure the receiving thread pools.(package private) Rself()Return ourselves.Returns the builder to configure the used transport.withDisconnectCallback(IDisconnectCallback _disconnectCallback) Set the given disconnect callback to the created connection.withEndianess(byte _endianess) Set the endianess for the connection Default is based on system endianess.withErrorHandlerThreadCount(int _threads) Deprecated, for removal: This API element is subject to removal in a future version.use receivingThreadConfig().withErrorHandlerThreadCount(_threads)withMethodCallThreadCount(int _threads) Deprecated, for removal: This API element is subject to removal in a future version.use receivingThreadConfig().withMethodCallThreadCount(_threads)withMethodReturnThreadCount(int _threads) Deprecated, for removal: This API element is subject to removal in a future version.use receivingThreadConfig().withMethodReturnThreadCount(_threads)withSignalThreadCount(int _threads) Deprecated, for removal: This API element is subject to removal in a future version.use receivingThreadConfig().withSignalThreadCount(_threads)withWeakReferences(boolean _weakRef) Enable/Disable weak references on connection.
-
Field Details
-
returnType
-
weakReference
private boolean weakReference -
endianess
private byte endianess -
disconnectCallback
-
rsConfigBuilder
-
transportConfigBuilder
-
-
Constructor Details
-
BaseConnectionBuilder
-
-
Method Details
-
self
R self()Return ourselves.- Returns:
- concrete version of this
-
buildThreadConfig
Creates the configuration to use forReceivingService.- Returns:
- config
-
buildTransportConfig
Creates the configuration to use forTransportBuilder.- Returns:
- config
-
isWeakReference
protected boolean isWeakReference() -
getEndianess
protected byte getEndianess() -
getDisconnectCallback
-
receivingThreadConfig
Returns the builder to configure the receiving thread pools.- Returns:
- builder
-
transportConfig
Returns the builder to configure the used transport.- Returns:
- builder
-
withSignalThreadCount
Deprecated, for removal: This API element is subject to removal in a future version.use receivingThreadConfig().withSignalThreadCount(_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-orderDefault: 1
- Parameters:
_threads- int >= 1- Returns:
- this
-
withErrorHandlerThreadCount
Deprecated, for removal: This API element is subject to removal in a future version.use receivingThreadConfig().withErrorHandlerThreadCount(_threads)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
Deprecated, for removal: This API element is subject to removal in a future version.use receivingThreadConfig().withMethodCallThreadCount(_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
- Parameters:
_threads- int >= 1- Returns:
- this
-
withMethodReturnThreadCount
Deprecated, for removal: This API element is subject to removal in a future version.use receivingThreadConfig().withMethodReturnThreadCount(_threads)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
-
withEndianess
Set the endianess for the connection Default is based on system endianess.- Parameters:
_endianess-Message.Endian.BIGor 0x6c- Returns:
- this
-
withWeakReferences
Enable/Disable weak references on connection. Default is false.- Parameters:
_weakRef- true to enable- Returns:
- this
-
withDisconnectCallback
Set the given disconnect callback to the created connection.- Parameters:
_disconnectCallback- callback- Returns:
- this
-
build
- Throws:
DBusException
-
getSystemEndianness
public static byte getSystemEndianness()Get the default system endianness.- Returns:
- LITTLE or BIG
-