Package net.morimekta.providence.logging
Interface MessageWriter
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
- All Known Implementing Classes:
FileMessageWriter,IOMessageWriter,QueuedMessageWriter,RollingFileMessageWriter
public interface MessageWriter extends java.io.CloseableAn interface for writing messages and service calls.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intseparator()Write an entry separator to the writer.<Message extends net.morimekta.providence.PMessage<Message>>
intwrite(net.morimekta.providence.PMessageOrBuilder<Message> message)Write a providence message to the writer.<Message extends net.morimekta.providence.PMessage<Message>>
intwrite(net.morimekta.providence.PServiceCall<Message> call)Write a providence service call to the writer.
-
-
-
Method Detail
-
write
<Message extends net.morimekta.providence.PMessage<Message>> int write(net.morimekta.providence.PMessageOrBuilder<Message> message) throws java.io.IOExceptionWrite a providence message to the writer.- Type Parameters:
Message- The message type.- Parameters:
message- The message to write.- Returns:
- The number of bytes written.
- Throws:
java.io.IOException- If write failed.
-
write
<Message extends net.morimekta.providence.PMessage<Message>> int write(net.morimekta.providence.PServiceCall<Message> call) throws java.io.IOExceptionWrite a providence service call to the writer.- Type Parameters:
Message- The message type embedded in the call.- Parameters:
call- The service call to write.- Returns:
- The number of bytes written.
- Throws:
java.io.IOException- If write failed.
-
separator
int separator() throws java.io.IOExceptionWrite an entry separator to the writer.- Returns:
- The number of bytes written.
- Throws:
java.io.IOException- If write failed.
-
-