Class BaseConnectionBuilder<R extends BaseConnectionBuilder<R,​C>,​C extends AbstractConnection>

  • 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 java.lang.Object
    Base class for connection builders containing commonly used options.
    Since:
    4.2.0 - 2022-07-13
    • Constructor Detail

      • BaseConnectionBuilder

        protected BaseConnectionBuilder​(java.lang.Class<R> _returnType,
                                        BusAddress _address)
    • Method Detail

      • self

        R self()
        Return ourselves.
        Returns:
        concrete version of this
      • isWeakReference

        protected boolean isWeakReference()
      • getEndianess

        protected byte getEndianess()
      • receivingThreadConfig

        public ReceivingServiceConfigBuilder<R> receivingThreadConfig()
        Returns the builder to configure the receiving thread pools.
        Returns:
        builder
      • transportConfig

        public TransportConfigBuilder<?,​R> transportConfig()
        Returns the builder to configure the used transport.
        Returns:
        builder
      • withSignalThreadCount

        @Deprecated(since="4.2.0",
                    forRemoval=true)
        public R withSignalThreadCount​(int _threads)
        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-order

        Default: 1

        Parameters:
        _threads - int >= 1
        Returns:
        this
      • withErrorHandlerThreadCount

        @Deprecated(since="4.2.0",
                    forRemoval=true)
        public R withErrorHandlerThreadCount​(int _threads)
        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(since="4.2.0",
                    forRemoval=true)
        public R withMethodCallThreadCount​(int _threads)
        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(since="4.2.0",
                    forRemoval=true)
        public R withMethodReturnThreadCount​(int _threads)
        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

        public R withEndianess​(byte _endianess)
        Set the endianess for the connection Default is based on system endianess.
        Parameters:
        _endianess - Message.Endian.BIG or 108
        Returns:
        this
      • withWeakReferences

        public R withWeakReferences​(boolean _weakRef)
        Enable/Disable weak references on connection. Default is false.
        Parameters:
        _weakRef - true to enable
        Returns:
        this
      • withDisconnectCallback

        public R withDisconnectCallback​(IDisconnectCallback _disconnectCallback)
        Set the given disconnect callback to the created connection.
        Parameters:
        _disconnectCallback - callback
        Returns:
        this
      • getSystemEndianness

        public static byte getSystemEndianness()
        Get the default system endianness.
        Returns:
        LITTLE or BIG