Class AbstractOutputStreamMessageWriter
java.lang.Object
org.freedesktop.dbus.spi.message.AbstractOutputStreamMessageWriter
- All Implemented Interfaces:
Closeable, AutoCloseable, IMessageWriter
- Direct Known Subclasses:
OutputStreamMessageWriter
Base class which can be used to implement a custom message writer.
- Since:
- 4.3.1 - 2023-08-07
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractOutputStreamMessageWriter(SocketChannel _out, ISocketProvider _socketProviderImpl) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected org.slf4j.Loggerprotected ISocketProviderbooleanisClosed()toString()protected abstract voidwriteFileDescriptors(SocketChannel _outputChannel, List<FileDescriptor> _filedescriptors) Called to write any file descriptors to the given channel.
Should do nothing if there is no file descriptor to write, or method is not supported.final voidwriteMessage(Message _msg) Write a message out to the bus.
-
Constructor Details
-
AbstractOutputStreamMessageWriter
protected AbstractOutputStreamMessageWriter(SocketChannel _out, ISocketProvider _socketProviderImpl)
-
-
Method Details
-
writeMessage
Description copied from interface:IMessageWriterWrite a message out to the bus.- Specified by:
writeMessagein interfaceIMessageWriter- Parameters:
_msg- The message to write- Throws:
IOException- If an IO error occurs.
-
writeFileDescriptors
protected abstract void writeFileDescriptors(SocketChannel _outputChannel, List<FileDescriptor> _filedescriptors) throws IOException Called to write any file descriptors to the given channel.
Should do nothing if there is no file descriptor to write, or method is not supported.- Parameters:
_outputChannel- channel to write to_filedescriptors- file descriptors attached to message- Throws:
IOException- when writing the descriptors fail
-
getLogger
protected org.slf4j.Logger getLogger() -
getSocketProviderImpl
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceIMessageWriter
-
toString
-