/*
* Start the server
*/
public void run() {
ClassLoaderFactory factory = glob.getClassLoaderFactory();
URLClassLoader cl = null;
try {
cl = factory.getXmlBlasterClassLoader();
if( log.isLoggable(Level.FINE)) log.fine("Get first instance of org.xmlBlaster.Main via own class loader.");
this.xmlBlasterMain = (I_Main)cl.loadClass("org.xmlBlaster.Main").newInstance();
// java.util.Properties props = glob.getProperty().getProperties();
// this.xmlBlasterMain.init(props);
this.xmlBlasterMain.init(glob);
/*
Class[] paramClasses = { glob.getArgs().getClass() };
Object[] params = { glob.getArgs() };
java.lang.reflect.Constructor constructor = mainClass.getDeclaredConstructor( paramClasses );
mainObject = constructor.newInstance( params );
if ( mainObject instanceof org.xmlBlaster.Main ) {
}
else {
log.error( ME, "Error in constructing org.xmlBlaster.Main!");
System.exit(-1);
}
*/
log.info("Successfully loaded org.xmlBlaster.Main instance with specific classloader");
} catch(Throwable e) {
if (cl != null)
log.severe("Problems loading org.xmlBlaster.Main with ClassLoader "+cl.getClass().getName()+": " + e.toString() + " -> using default classloader");
else
log.severe("Problems loading org.xmlBlaster.Main (classloader = 'null' ???): " + e.toString() + " -> using default classloader");
this.xmlBlasterMain = new org.xmlBlaster.Main(glob);
log.info("Successfully loaded org.xmlBlaster.Main instance with default classloader");
}