source: trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/Runner.java @ 231

Last change on this file since 231 was 207, checked in by sherbold, 13 years ago

+ added log file based on the log4j API

File size: 1.6 KB
RevLine 
[1]1package de.ugoe.cs.eventbench;
2
[207]3import de.ugoe.cs.eventbench.log4j.Log4JLogger;
[188]4import de.ugoe.cs.eventbench.swt.MainWindow;
[1]5import de.ugoe.cs.util.console.CommandExecuter;
[171]6import de.ugoe.cs.util.console.Console;
[1]7import de.ugoe.cs.util.console.TextConsole;
8
[171]9/**
10 * <p>
11 * Start-up class of the application.
12 * </p>
13 * <p>
14 * It sets up and starts the {@link Console}.
15 * </p>
16 *
17 * @author Steffen Herbold
18 * @version 1.0
19 */
[1]20public class Runner {
21
22        /**
[171]23         * <p>
24         * Main method of the application.
25         * </p>
26         *
[1]27         * @param args
[171]28         *            if parameters are defined, they are interpreted as commands
29         *            for the {@link Console} and executed before the user can use
30         *            the console; can be used to perform batch operations
[1]31         */
32        public static void main(String[] args) {
[171]33                CommandExecuter.getInstance().addCommandPackage(
34                                "de.ugoe.cs.eventbench.commands");
35                CommandExecuter.getInstance().addCommandPackage(
36                                "de.ugoe.cs.eventbench.windows.commands");
37                CommandExecuter.getInstance().addCommandPackage(
38                                "de.ugoe.cs.eventbench.web.commands");
[196]39                CommandExecuter.getInstance().addCommandPackage(
40                                "de.ugoe.cs.eventbench.efg.commands");
[1]41                TextConsole textConsole = new TextConsole();
[207]42                new Log4JLogger();
[188]43                boolean swtGuiRunning = false;
[171]44                if (args.length >= 1) {
[188]45                        if( args[0].equals("-swt") ) {
46                                MainWindow mainWindow = new MainWindow();
47                                mainWindow.open();
48                                swtGuiRunning = true;
49                        } else {
50                                for (String command : args) {
51                                        CommandExecuter.getInstance().exec(command);
52                                }
[112]53                        }
54                }
[188]55                if( !swtGuiRunning ) {
56                        textConsole.run(true);
57                }
[1]58        }
59
60}
Note: See TracBrowser for help on using the repository browser.