Klasse BaseConnectionBuilder<R extends BaseConnectionBuilder<R,C>,C extends AbstractConnection>

java.lang.Object
org.freedesktop.dbus.connections.impl.BaseConnectionBuilder<R,C>
Typparameter:
R - concrete type of connection builder
Bekannte direkte Unterklassen:
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.
Seit:
4.2.0 - 2022-07-13
Autor:
hypfvieh
  • Konstruktordetails

    • BaseConnectionBuilder

      protected BaseConnectionBuilder(Class<R> _returnType, BusAddress _address)
  • Methodendetails

    • buildThreadConfig

      protected ReceivingServiceConfig buildThreadConfig()
      Creates the configuration to use for ReceivingService.
      Gibt zurück:
      config
    • buildTransportConfig

      protected TransportConfig buildTransportConfig()
      Creates the configuration to use for TransportBuilder.
      Gibt zurück:
      config
    • getConnectionConfig

      protected ConnectionConfig getConnectionConfig()
      Returns the currently configured connection configuration.
      Gibt zurück:
      config
    • receivingThreadConfig

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

      public TransportConfigBuilder<?,R> transportConfig()
      Returns the builder to configure the used transport.
      Gibt zurück:
      builder
    • withWeakReferences

      @Deprecated(forRemoval=true, since="5.1.0 - 2024-07-12") public R withWeakReferences(boolean _weakRef)
      Veraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.
      Enable/Disable weak references on connection. Default is false.
      Parameter:
      _weakRef - true to enable
      Gibt zurück:
      this
    • withExportWeakReferences

      public R withExportWeakReferences(boolean _weakRef)
      Enable/Disable usage of weak references for exported objects.

      Exported objects are objects provided by the application to DBus and are used through DBus by other applications.

      Using weak references may allow the Garbage Collector to remove exported objects when they are no longer reachable. Enabling this feature may cause dbus-java to be forced to re-create exported objects because the GC already cleaned up the old references.
      Use with caution!

      Default is false.
      Parameter:
      _weakRef - true to enable
      Gibt zurück:
      this
    • withImportWeakReferences

      public R withImportWeakReferences(boolean _weakRef)
      Enable/Disable usage of weak references for imported objects.

      Imported objects are all objects which are created when calling interfaces which belong to any object provided by DBus.
      E.g. when you want to use Bluetooth, you will query the bluez interfaces on the bus which will create a proxy object in dbus-java.
      These objects are stored in an internal Map so re-querying the same object will return the cached object instead of creating a new proxy.

      Usually all imported objects are dropped when the connection gets closed (by either side).
      If the application will not close the connection and run for a long time the default behavior may cause high memory usage.
      Enabling weak references may allow the Garbage Collector to remove imported objects when they are no longer reachable.
      This will free up memory when no other references are kept on the remote imported object.

      The current default is false.
      Anyway it is considered to enable weak references for imported objects as default in the future.

      Parameter:
      _weakRef - true to enable
      Gibt zurück:
      this
    • withDisconnectCallback

      public R withDisconnectCallback(IDisconnectCallback _disconnectCallback)
      Set the given disconnect callback to the created connection.
      Parameter:
      _disconnectCallback - callback
      Gibt zurück:
      this
    • build

      public abstract C build() throws DBusException
      Löst aus:
      DBusException
    • getSystemEndianness

      public static byte getSystemEndianness()
      Get the default system endianness.
      Gibt zurück:
      LITTLE or BIG