Class AbstractOutputStreamMessageWriter

java.lang.Object
org.freedesktop.dbus.spi.message.AbstractOutputStreamMessageWriter
All Implemented Interfaces:
Closeable, AutoCloseable, IMessageWriter
Direct Known Subclasses:
OutputStreamMessageWriter

public abstract class AbstractOutputStreamMessageWriter extends Object implements IMessageWriter
Base class which can be used to implement a custom message writer.
Since:
4.3.1 - 2023-08-07
  • Constructor Details

  • Method Details

    • writeMessage

      public final void writeMessage(Message _msg) throws IOException
      Description copied from interface: IMessageWriter
      Write a message out to the bus.
      Specified by:
      writeMessage in interface IMessageWriter
      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

      protected ISocketProvider getSocketProviderImpl()
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • isClosed

      public boolean isClosed()
      Specified by:
      isClosed in interface IMessageWriter
    • toString

      public String toString()
      Overrides:
      toString in class Object