MCPcopy Create free account
hub / github.com/annmuor/jnode / main

Method main

jnode-core/src/jnode/main/Main.java:65–171  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

63 private static final String LOGZIPPATH = "log.zippath";
64
65 public static void main(String[] args) {
66 System.setProperty(LocalLog.LOCAL_LOG_LEVEL_PROPERTY, "INFO");
67 if (args.length == 0) {
68 System.out.println("Usage: $0 <config-file>");
69 System.exit(-1);
70 }
71
72 try {
73 new MainHandler(args[0]);
74 tryRedirectLog();
75
76 } catch (IOException e) {
77 GUIConfigurator.main(args);
78 logger.l1("Bad configuration", e);
79 return;
80 }
81 try {
82 ORMManager.INSTANSE.start();
83 } catch (Exception e) {
84 logger.l1("Database init failed, exiting", e);
85 System.exit(-1);
86 }
87 Logger.Loglevel = MainHandler.getCurrentInstance().getIntegerProperty(
88 LOG_LEVEL, Logger.LOG_L4);
89 {
90 File inbound = new File(FtnTools.getInbound());
91 if (!(inbound.isDirectory() && inbound.canWrite())) {
92 logger.l1("Bad inbound " + inbound.getAbsolutePath());
93 System.exit(-1);
94 }
95 }
96 logger.l1(MainHandler.getVersion() + " starting");
97 // installer
98
99 new InstallUtil();
100
101 int nThreads = 2 + MainHandler.getCurrentInstance().getIntegerProperty(
102 BINKD_THREADS, 10);
103 new ThreadPool(nThreads);
104
105 // eof
106 ThreadPool.execute(new BinkpAsyncServer());
107
108 ThreadPool.execute(new BinkpAsyncClientPool());
109
110 Timer mainTimer = new Timer();
111 mainTimer
112 .schedule(new TimerPoll(), MainHandler.getCurrentInstance()
113 .getIntegerProperty(POLL_DELAY, 0) * 1000, MainHandler
114 .getCurrentInstance()
115 .getIntegerProperty(POLL_PERIOD, 0) * 1000);
116 logger.l4("Started TosserTask");
117 mainTimer.schedule(new TosserTask(), 10000, 10000);
118 logger.l4("Started PollQueueTask");
119 mainTimer.schedule(new PollQueueTask(), 10000, 10000);
120 logger.l4("Started StatPoster");
121 mainTimer.schedule(new NetmailFallback(), 9000, 3600000);
122 logger.l4("Started HealthReporter");

Callers

nothing calls this directly

Calls 15

tryRedirectLogMethod · 0.95
mainMethod · 0.95
getCurrentInstanceMethod · 0.95
getInboundMethod · 0.95
getVersionMethod · 0.95
executeMethod · 0.95
setPropertyMethod · 0.80
l1Method · 0.80
getIntegerPropertyMethod · 0.80
scheduleMethod · 0.80
l4Method · 0.80
havePropertyMethod · 0.80

Tested by

no test coverage detected