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.CloseableEvent serializer.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ThrowabledoForcedShutdownprivate java.util.ArrayDeque<RemoteEvent>eventsprivate java.lang.ThreadforceCloseDaemonprivate java.util.concurrent.atomic.AtomicBooleanforceCloseDaemonQuitprivate JsonWriterjsonWriterprivate java.lang.ObjectlockShould help in ensuring the right order of stream writes.private java.io.Writerwriter
-
Constructor Summary
Constructors Constructor Description Serializer(java.io.OutputStream os)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Serializerflush()private voidflushQueue()Serializerserialize(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:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-