blob: c233229ce9c58ca9ccced6cd41fa2ce34f0a2835 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
package org.openslx.taskmanager;
import java.io.File;
import java.io.IOException;
import java.net.SocketException;
import junit.runner.ClassPathTestCollector;
import org.apache.log4j.BasicConfigurator;
import org.openslx.taskmanager.main.Taskmanager;
import org.openslx.taskmanager.network.NetworkHandler;
import org.openslx.taskmanager.util.ClassLoaderHack;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args ) throws SocketException
{
// Load all task plugins
File folder = new File( "./plugins" );
if ( !folder.exists() ) {
System.out.println( "No plugin folder found - nothing to do." );
System.exit( 1 );
}
for ( File file : folder.listFiles() ) {
if ( !file.isFile() || !file.toString().endsWith( ".jar" ) )
continue;
try {
ClassLoaderHack.addFile( file );
} catch ( IOException e ) {
e.printStackTrace();
System.out.println( "Could not add plugin: " + file.toString() );
System.exit( 1 );
}
}
BasicConfigurator.configure();
Environment.load( "config/environment" );
NetworkHandler.init();
Taskmanager.run();
// Wait for everything
NetworkHandler.join();
}
}
|