[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xmlblaster] PluginClassLoader



Hi,

How can i load a plugin during runtime? I'm trying to do something like :

private void loadNativeClient()
{
// This works but clients are hard coded!
//GlobalUtil globalUtil = new GlobalUtil(serverThread.getMain().getGlobal());
//new NativeClient(globalUtil.getClone( glob ));
// Let's use XmlBlaster's Class loading
java.net.URL [] urls=new java.net.URL [1];
try {
urls[0]=new java.net.URL("file://target/classes/");
}catch(MalformedURLException e){
System.err.println("URL mal formado!");
};
try{
PluginClassLoader.newInstance(urls).loadClass("pt.inevo.NativeClient");
}
catch(ClassNotFoundException e)
{
System.err.println("Classe não encontrada!");
}
}


Unfortunately this does nothing :(

Any help?

regards,

Nelson Silva