Changed ClassDiagram
This commit is contained in:
parent
a6d22fc87b
commit
f189be1833
Binary file not shown.
@ -19,11 +19,18 @@ import java.util.logging.Level;
|
|||||||
import java.util.logging.LogManager;
|
import java.util.logging.LogManager;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main application class
|
||||||
|
*/
|
||||||
public class FoodChain
|
public class FoodChain
|
||||||
{
|
{
|
||||||
|
|
||||||
private static FactoryManager factoryManager = new FactoryManager();
|
private static FactoryManager factoryManager = new FactoryManager();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main application method that parses configuration and starts Ticker.
|
||||||
|
* @param args args
|
||||||
|
*/
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
{
|
{
|
||||||
LogManager.getLogManager().reset();
|
LogManager.getLogManager().reset();
|
||||||
@ -67,6 +74,12 @@ public class FoodChain
|
|||||||
return factoryManager;
|
return factoryManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides connection between FoodChain and ConfigurationParser.
|
||||||
|
* @param path file path
|
||||||
|
* @param rootElementTag tag to be parsed
|
||||||
|
* @return parser result
|
||||||
|
*/
|
||||||
public static ParserResult parseDocument(String path, String rootElementTag)
|
public static ParserResult parseDocument(String path, String rootElementTag)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -82,6 +95,10 @@ public class FoodChain
|
|||||||
return ConfigurationParser.getElements(rootElementTag);
|
return ConfigurationParser.getElements(rootElementTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses channels.
|
||||||
|
* @param path file path
|
||||||
|
*/
|
||||||
public static void parseChannels(String path)
|
public static void parseChannels(String path)
|
||||||
{
|
{
|
||||||
ParserResult parserResult = parseDocument(path, "channel");
|
ParserResult parserResult = parseDocument(path, "channel");
|
||||||
@ -93,6 +110,10 @@ public class FoodChain
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses nodes.
|
||||||
|
* @param path file path
|
||||||
|
*/
|
||||||
public static void parseNodes(String path)
|
public static void parseNodes(String path)
|
||||||
{
|
{
|
||||||
ParserResult parserResult = parseDocument(path, "node");
|
ParserResult parserResult = parseDocument(path, "node");
|
||||||
@ -104,6 +125,10 @@ public class FoodChain
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses products.
|
||||||
|
* @param path file path
|
||||||
|
*/
|
||||||
public static void parseProducts(String path)
|
public static void parseProducts(String path)
|
||||||
{
|
{
|
||||||
ParserResult parserResult = parseDocument(path, "product");
|
ParserResult parserResult = parseDocument(path, "product");
|
||||||
@ -115,6 +140,10 @@ public class FoodChain
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses scenarios.
|
||||||
|
* @param path file path
|
||||||
|
*/
|
||||||
public static void parseScenarios(String path)
|
public static void parseScenarios(String path)
|
||||||
{
|
{
|
||||||
ParserResult parserResult = parseDocument(path, "scenario");
|
ParserResult parserResult = parseDocument(path, "scenario");
|
||||||
|
|||||||
@ -4,8 +4,15 @@ import java.util.logging.Handler;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.LogRecord;
|
import java.util.logging.LogRecord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom Logger used for TransactionReport
|
||||||
|
*/
|
||||||
public class ReportLogger extends Handler
|
public class ReportLogger extends Handler
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Logs message and prints it out.
|
||||||
|
* @param record message to be printed
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void publish(LogRecord record) {
|
public void publish(LogRecord record) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Singleton implementation 1 of 3
|
* Singleton helper class
|
||||||
*/
|
*/
|
||||||
public class Singleton {
|
public class Singleton {
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user