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