Klasse BaseConnectionBuilder<R extends BaseConnectionBuilder<R,C>,C extends AbstractConnection>
- Typparameter:
R- concrete type of connection builder
- Bekannte direkte Unterklassen:
DBusConnectionBuilder,DirectConnectionBuilder
- Seit:
- 4.2.0 - 2022-07-13
- Autor:
- hypfvieh
-
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungprotectedBaseConnectionBuilder(Class<R> _returnType, BusAddress _address) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungabstract Cbuild()protected ReceivingServiceConfigCreates the configuration to use forReceivingService.protected TransportConfigCreates the configuration to use forTransportBuilder.protected ConnectionConfigReturns the currently configured connection configuration.static byteGet the default system endianness.Returns the builder to configure the receiving thread pools.Returns the builder to configure the used transport.withDisconnectCallback(IDisconnectCallback _disconnectCallback) Set the given disconnect callback to the created connection.withExportWeakReferences(boolean _weakRef) Enable/Disable usage of weak references for exported objects.withImportWeakReferences(boolean _weakRef) Enable/Disable usage of weak references for imported objects.withWeakReferences(boolean _weakRef) Veraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.
-
Konstruktordetails
-
BaseConnectionBuilder
-
-
Methodendetails
-
buildThreadConfig
Creates the configuration to use forReceivingService.- Gibt zurück:
- config
-
buildTransportConfig
Creates the configuration to use forTransportBuilder.- Gibt zurück:
- config
-
getConnectionConfig
Returns the currently configured connection configuration.- Gibt zurück:
- config
-
receivingThreadConfig
Returns the builder to configure the receiving thread pools.- Gibt zurück:
- builder
-
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.usewithExportWeakReferences(boolean)insteadEnable/Disable weak references on connection. Default is false.- Parameter:
_weakRef- true to enable- Gibt zurück:
- this
-
withExportWeakReferences
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.
Default is false.
Use with caution!- Parameter:
_weakRef- true to enable- Gibt zurück:
- this
-
withImportWeakReferences
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
Set the given disconnect callback to the created connection.- Parameter:
_disconnectCallback- callback- Gibt zurück:
- this
-
build
- Löst aus:
DBusException
-
getSystemEndianness
public static byte getSystemEndianness()Get the default system endianness.- Gibt zurück:
- LITTLE or BIG
-
withExportWeakReferences(boolean)instead