Modifier and Type | Field and Description |
---|---|
static AvailableInterfaces |
ai
AvailableInterfaces Object that is the thread to monitor the available interfaces.
|
private static DataPrinter |
dp
DataPrinter object that is the thread to print periodically all the collected data.
|
static java.util.List<java.lang.Integer> |
markovList
List that contains all the states of the Markov Chain.
|
static java.util.Properties |
prop
The properties file that contains the initial setup info.
|
static long |
start_time
Starting time of running the program.
|
static java.util.Map<java.lang.String,ThreadData> |
threadsTable
Map that stores all opened threads by the program.
|
Constructor and Description |
---|
Main() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Main method that loads the properties from the property file,
builds the markovList based on the properties loaded,
and starts the threads for the available interfaces thread and the data printer thread
This method also contains an anonymous thread that is added a shutdown hook.
|
private static void |
runWhenShuttingDown()
Method that is called by the thread that has shutdown hook.Sends
to the DataPrinter thread and to the AvailableInterfaces thread a termination signal
and then it waits for them to stop.
|
public static volatile java.util.Map<java.lang.String,ThreadData> threadsTable
public static java.util.Properties prop
public static java.util.List<java.lang.Integer> markovList
public static AvailableInterfaces ai
public static final long start_time
private static DataPrinter dp
public static void main(java.lang.String[] args)
args
- Argument given by the user when running the program that contains the path of the property file.private static void runWhenShuttingDown()