System.loadLibrary() used, improved logging
This commit is contained in:
parent
d844699afc
commit
d2b861eb7f
|
@ -5,7 +5,7 @@
|
|||
|
||||
#define DEBUG 1
|
||||
|
||||
#ifdef DEBUG
|
||||
#if DEBUG == 1
|
||||
#define DEB(A) std::cout << A << std::endl
|
||||
#else
|
||||
#define DEB(A) ;
|
||||
|
|
|
@ -19,9 +19,7 @@ fi
|
|||
make installplugins
|
||||
|
||||
#prepare server
|
||||
mkdir -p testserver/plugins/CppPlugins
|
||||
cp target/Cppplugin-0.1-SNAPSHOT-final.jar testserver/plugins/
|
||||
cp target/libplugin.so testserver/plugins/CppPlugins
|
||||
|
||||
#start server
|
||||
cd testserver
|
||||
|
|
|
@ -76,7 +76,7 @@ void load(JNIEnv* env, long data) {
|
|||
|
||||
if(((!CPPPLUGINCLASS) + (!EVENTCLASS) + (!MAPCLASS) + (!LISTENERCLASS) //wenn eins == nullptr ist -> wird zu 1 -> endergebniss != 0 -> fehler
|
||||
+ (!EVENTDATAF) + (!EVENTNAMEF) + (!PLUGINIDF)
|
||||
+ (!MAPGET) + (!MAPPUT) + (!MAPCLEAR) + (!LISTENERCONTR) + (!LISTENERSMALLCONTR)) == 0) {
|
||||
+ (!MAPGET) + (!MAPPUT) + (!MAPCLEAR) + (!LISTENERCONTR) + (!LISTENERSMALLCONTR)) != 0) {
|
||||
|
||||
DEB("Error loading a information: ");
|
||||
DEB("find classes: " << (!!CPPPLUGINCLASS) << (!!EVENTCLASS) << (!!MAPCLASS) << (!!LISTENERCLASS));
|
||||
|
|
|
@ -44,7 +44,7 @@ public class CppLoader implements PluginLoader {
|
|||
|
||||
@Override
|
||||
public Plugin loadPlugin(File file) throws InvalidPluginException, UnknownDependencyException {
|
||||
log.info("try to load: " + file.getName());
|
||||
log.info("Loading " + file.getName());
|
||||
return new CppPlugin(file, this);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,12 +54,8 @@ public class CppPlugin implements Plugin {
|
|||
}
|
||||
|
||||
protected boolean init() {
|
||||
File folder = CppPlugins.getInstance().getDataFolder();
|
||||
folder.mkdirs();
|
||||
String path = folder.getAbsolutePath() + "/libplugin.so";
|
||||
getLogger().info("load library from: " + path);
|
||||
try {
|
||||
System.load(path);
|
||||
System.loadLibrary("plugin"); //loads libplugin.so from System.getProperty("java.library.path")
|
||||
return init_();
|
||||
} catch(UnsatisfiedLinkError e) {
|
||||
e.printStackTrace();
|
||||
|
|
Loading…
Reference in New Issue