|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.nps.moves.logger.DisLogger
public class DisLogger
Logs DIS packets to XML format. You can easily receive DIS packets off the wire faster than they can be logged to XML, so you need to be careful about that. With a 2 GHz core duo and OSX, on a macbook pro laptop drive, you can log roughly 1,000 packets per second.
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.
Field Summary | |
---|---|
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 Summary | |
---|---|
DisLogger(java.util.Properties loggerProperties)
Create a new DIS logger with the given properties object. |
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_PDU_SIZE
public static final int MAX_PDU_LOGFILE_SIZE
public static final int READ_TIMEOUT
Constructor Detail |
---|
public DisLogger(java.util.Properties loggerProperties)
Method Detail |
---|
public void setDone()
public void run()
run
in interface java.lang.Runnable
public boolean finishedWriting()
public static void main(java.lang.String[] args)
args
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |