Class Serializer
- java.lang.Object
-
- com.carrotsearch.ant.tasks.junit4.events.Serializer
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class Serializer extends java.lang.Object implements java.io.Closeable
Event serializer.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Throwable
doForcedShutdown
private java.util.ArrayDeque<RemoteEvent>
events
private java.lang.Thread
forceCloseDaemon
private java.util.concurrent.atomic.AtomicBoolean
forceCloseDaemonQuit
private JsonWriter
jsonWriter
private java.lang.Object
lock
Should help in ensuring the right order of stream writes.private java.io.Writer
writer
-
Constructor Summary
Constructors Constructor Description Serializer(java.io.OutputStream os)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Serializer
flush()
private void
flushQueue()
Serializer
serialize(RemoteEvent event)
-
-
-
Field Detail
-
lock
private final java.lang.Object lock
Should help in ensuring the right order of stream writes.
-
writer
private java.io.Writer writer
-
jsonWriter
private JsonWriter jsonWriter
-
events
private final java.util.ArrayDeque<RemoteEvent> events
-
doForcedShutdown
private volatile java.lang.Throwable doForcedShutdown
-
forceCloseDaemon
private java.lang.Thread forceCloseDaemon
-
forceCloseDaemonQuit
private java.util.concurrent.atomic.AtomicBoolean forceCloseDaemonQuit
-
-
Method Detail
-
serialize
public Serializer serialize(RemoteEvent event) throws java.io.IOException
- Throws:
java.io.IOException
-
flushQueue
private void flushQueue() throws java.io.IOException
- Throws:
java.io.IOException
-
flush
public Serializer flush() throws java.io.IOException
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-