Top Description Fields Constructors Methods
org.freedesktop.dbus.connections.transports

public Class TransportConnection

extends Object
implements Closeable
Class Inheritance
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable
Imports
org.freedesktop.dbus.messages.MessageFactory, org.freedesktop.dbus.spi.message.*, java.io.Closeable, .IOException, java.nio.channels.SocketChannel, java.util.concurrent.atomic.AtomicLong

Represents one transport connection of any type.

A transport connection is bound to a SocketChannel which might be a connection to a DBusServer when used as client or a connection from a client when running as server.

Author
hypfvieh
Since
v4.2.2 - 2023-02-02

Field Summary

Modifier and TypeField and Description
private final SocketChannel
private final long
private final MessageFactory
private final IMessageReader
private final ISocketProvider
private static final AtomicLong
private final IMessageWriter

Constructor Summary

AccessConstructor and Description
public
TransportConnection(MessageFactory _factory, SocketChannel _channel, ISocketProvider _socketProviderImpl, IMessageWriter _writer, IMessageReader _reader)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

public SocketChannel
public long
public MessageFactory
public IMessageReader
public ISocketProvider
public IMessageWriter
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

channelback to summary
private final SocketChannel channel
idback to summary
private final long id
messageFactoryback to summary
private final MessageFactory messageFactory
readerback to summary
private final IMessageReader reader
socketProviderImplback to summary
private final ISocketProvider socketProviderImpl
TRANSPORT_ID_GENERATORback to summary
private static final AtomicLong TRANSPORT_ID_GENERATOR
writerback to summary
private final IMessageWriter writer

Constructor Detail

TransportConnectionback to summary
public TransportConnection(MessageFactory _factory, SocketChannel _channel, ISocketProvider _socketProviderImpl, IMessageWriter _writer, IMessageReader _reader)

Method Detail

closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
getChannelback to summary
public SocketChannel getChannel()
getIdback to summary
public long getId()
getMessageFactoryback to summary
public MessageFactory getMessageFactory()
getReaderback to summary
public IMessageReader getReader()
getSocketProviderImplback to summary
public ISocketProvider getSocketProviderImpl()
getWriterback to summary
public IMessageWriter getWriter()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override