Visitor :
Do My Best
Jun 9, 2009
May 4, 2009
Welcom The close() method of ClassLoader in JDK7
The close() method of ClassLoader in JDK7 is revolutionary stuff in JDK history, because ClassLoader have no function of close, module programming is very difficult to manage java object.
Therefore, there is no need to kill application to close classloader (Known for App kill).
I am very expecting JDK7 release.
URL url = new URL("file:foo.jar");
URLClassLoader loader = new URLClassLoader (new URL[] {url});
Class cl = Class.forName ("Foo", true, loader);
Runnable foo = (Runnable) cl.newInstance();
foo.run();
loader.close ();
// foo.jar gets updated somehow
loader = new URLClassLoader (new URL[] {url});
cl = Class.forName ("Foo", true, loader);
foo = (Runnable) cl.newInstance();
// run the new implementation of Foo
foo.run();
Therefore, there is no need to kill application to close classloader (Known for App kill).
I am very expecting JDK7 release.
URL url = new URL("file:foo.jar");
URLClassLoader loader = new URLClassLoader (new URL[] {url});
Class cl = Class.forName ("Foo", true, loader);
Runnable foo = (Runnable) cl.newInstance();
foo.run();
loader.close ();
// foo.jar gets updated somehow
loader = new URLClassLoader (new URL[] {url});
cl = Class.forName ("Foo", true, loader);
foo = (Runnable) cl.newInstance();
// run the new implementation of Foo
foo.run();
java sources for ojdbc (odjbc14-10.0.2.zip, ojdbc14-9.2.zip) decompied by jad
Those sources are decompiled by jad decompiler. I can't source for ojdbc14.jar anywhere, so that I put sources to my blog.
Prior to see the source, you have to see the readme of ojdbc14.jar in oracle web site to understand jdbc specification and bug fixes.
Prior to see the source, you have to see the readme of ojdbc14.jar in oracle web site to understand jdbc specification and bug fixes.
odjbc14-10.0.2.zip
http://knight76.tistory.com/attachment/cfile4.uf@14432C1D49E8206A909F92.zip
ojdbc14-9.2.zip
http://knight76.tistory.com/attachment/cfile22.uf@1144E51D49E82072C532AE.zip
Notepad with class java file (Jad Usage Tip)
0. Donwload jad
Download and install jad app, and put intalled jad in the path on your computer to execute on any commnad window.
1. Create jad.bat file
Crate jad.bat file and put your jad.bat into path on your computer.
2. Link class extension file to jad.bat that you made.
3. Unzip jar
Unzip a certain jar to your computer. and run "cmd" on execute window menu.
And, go to the unzipped jar directory and execute below command to decompile your class files.
4. Click class file
After clicking your class file linked jad.bat, you may see this window.
Strength of this bat file
- You may not decompile every class file.
- You may not know every option of jad.
- Autiomatically remove the jad file when you close the decompiled java source note-pad-window.
Download and install jad app, and put intalled jad in the path on your computer to execute on any commnad window.
1. Create jad.bat file
Crate jad.bat file and put your jad.bat into path on your computer.
@echo off
jad -o -d. %*
notepad %~n1.jad
del %~n1.jad
jad -o -d. %*
notepad %~n1.jad
del %~n1.jad
2. Link class extension file to jad.bat that you made.
3. Unzip jar
Unzip a certain jar to your computer. and run "cmd" on execute window menu.
And, go to the unzipped jar directory and execute below command to decompile your class files.
4. Click class file
After clicking your class file linked jad.bat, you may see this window.
Strength of this bat file
- You may not decompile every class file.
- You may not know every option of jad.
- Autiomatically remove the jad file when you close the decompiled java source note-pad-window.
addShutdownHook() of Runtime class
The addShutdownHook method of Runtime class is vervy useful to invoke something before a application exit. In addition coding in JUnit, very useful.
If you create and use some Threads, you can not invoke directly, this method usage is very helpful.
public class Monitor {
private static Log log = LogFactory.getLog(HTMLPageFetcher.class);
private static NotificationCollector notiCollector;
static {
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
close();
}
});
}
public static void close() {
log.info("close application.!!");
notiCollector.stop();
}
...
...
JavaFx Programming Reference
To programe java fx, refer below sites.
http://jfx.wikia.com/wiki/Code_Examples
http://java.sun.com/javafx/1/tutorials/ui/events/index.html
http://java.sun.com/javafx/1/tutorials/core/modifiers/index.html
http://javaora.tistory.com/tag/Learning%20the%20JavaFX%20Script%20Programming%20Language%20-%20Lesson%2011:%20Access%20Modifiers
http://java.sun.com/javafx/script/reference/scenegraph_demo/
http://www.javafx.com/samples/SimpleVideoPlayer/index.html
http://www.vogella.de/articles/JavaFX/article.html
Subscribe to:
Posts (Atom)