• R/O
  • SSH
  • HTTPS

exewrap: Commit


Commit MetaInfo

Revision27 (tree)
Time2015-07-28 22:46:14
Authorhirukawa_ryo

Log Message

v1.1.1 *スレッドのコンテキストクラスローダーにexewrapカスタムクラスローダーを登録するようにしました。

Change Summary

Incremental Difference

--- exewrap/trunk/exewrap/src/java/exewrap/core/ExewrapClassLoader.java (revision 26)
+++ exewrap/trunk/exewrap/src/java/exewrap/core/ExewrapClassLoader.java (revision 27)
@@ -46,7 +46,9 @@
4646 this.context = new URL("jar:file:/" + path.replace('\\', '/') + '/' + name + "!/");
4747 }
4848
49- public void registerSystemClassLoader() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
49+ public void register() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
50+ Thread.currentThread().setContextClassLoader(this);
51+
5052 Field scl = ClassLoader.class.getDeclaredField("scl");
5153 scl.setAccessible(true);
5254 scl.set(null, this);
--- exewrap/trunk/exewrap/src/loader.c (revision 26)
+++ exewrap/trunk/exewrap/src/loader.c (revision 27)
@@ -51,7 +51,7 @@
5151 jclass URLConnection;
5252 jclass URLStreamHandler;
5353 jmethodID ExewrapClassLoader_init;
54- jmethodID exewrapClassLoader_registerSystemClassLoader;
54+ jmethodID exewrapClassLoader_register;
5555 jmethodID exewrapClassLoader_loadUtilities;
5656 jmethodID exewrapClassLoader_getMainClass;
5757
@@ -364,11 +364,11 @@
364364 sprintf(result->msg, _(MSG_ID_ERR_NEW_OBJECT), "exewrap.core.ExewrapClassLoader(java.lang.ClassLoader, java.util.jar.JarInputStream[])");
365365 goto EXIT;
366366 }
367- exewrapClassLoader_registerSystemClassLoader = (*env)->GetMethodID(env, ExewrapClassLoader, "registerSystemClassLoader", "()V");
368- if (exewrapClassLoader_registerSystemClassLoader == NULL)
367+ exewrapClassLoader_register = (*env)->GetMethodID(env, ExewrapClassLoader, "register", "()V");
368+ if (exewrapClassLoader_register == NULL)
369369 {
370370 result->msg_id = MSG_ID_ERR_GET_METHOD;
371- sprintf(result->msg, _(MSG_ID_ERR_GET_METHOD), "exewrap.core.ExewrapClassLoader.registerSystemClassLoader()");
371+ sprintf(result->msg, _(MSG_ID_ERR_GET_METHOD), "exewrap.core.ExewrapClassLoader.register()");
372372 goto EXIT;
373373 }
374374 exewrapClassLoader_loadUtilities = (*env)->GetMethodID(env, ExewrapClassLoader, "loadUtilities", "(Ljava/lang/String;)V");
@@ -379,8 +379,8 @@
379379 goto EXIT;
380380 }
381381
382- // exewrapClassLoader.registerSystemClassLoader();
383- (*env)->CallObjectMethod(env, exewrapClassLoader, exewrapClassLoader_registerSystemClassLoader);
382+ // exewrapClassLoader.register();
383+ (*env)->CallObjectMethod(env, exewrapClassLoader, exewrapClassLoader_register);
384384
385385 // exewrapClassLoader.loadUtilities();
386386 {
--- exewrap/trunk/exewrap/src/exewrap.c (revision 26)
+++ exewrap/trunk/exewrap/src/exewrap.c (revision 27)
@@ -81,7 +81,7 @@
8181 exe_file = argv[0];
8282 }
8383
84- printf("exewrap 1.1.0 for %s (%d-bit)\r\n"
84+ printf("exewrap 1.1.1 for %s (%d-bit)\r\n"
8585 "Native executable java application wrapper.\r\n"
8686 "Copyright (C) 2005-2015 HIRUKAWA Ryo. All rights reserved.\r\n"
8787 "\r\n"
Show on old repository browser