public class DisLogger
extends java.lang.Object
implements java.lang.Runnable
Since we cannot hold all the PDUs in memory at once, we set up a rotating system in which packets are read into a list, then, when the list is full, the list is handed off to a separate thread for marshalling to XML. This gives us at least a chance of not dropping packets while writing to file.
The classes here and in LogReplay are intended to be used from the command line, but it should be easy to wrap a GUI around them.
the classes are configured via a properties file. this defines the multicast group to listen on, the directory to which files should be written, etc.
Modifier and Type | Field and Description |
---|---|
static int |
MAX_PDU_LOGFILE_SIZE |
static int |
MAX_PDU_SIZE
Maximum PDU size.
|
static int |
READ_TIMEOUT
How long to wait for a packet to arrive, in ms, before throwing an exception
|
Constructor and Description |
---|
DisLogger(java.util.Properties loggerProperties)
Create a new DIS logger with the given properties object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
finishedWriting()
We may have broken out of the netowrk read loop, but the writer task is
still involved in flushing out the already captured PDUs to disk.
|
static void |
main(java.lang.String[] args)
Entry point.
|
void |
run()
Run the logger.
|
void |
setDone()
Breaks us out of network read log loop (perhaps after READ_TIMEOUT has passed
|
public static final int MAX_PDU_SIZE
public static final int MAX_PDU_LOGFILE_SIZE
public static final int READ_TIMEOUT
public DisLogger(java.util.Properties loggerProperties)
public void setDone()
public void run()
run
in interface java.lang.Runnable
public boolean finishedWriting()
public static void main(java.lang.String[] args)
args
-