-
Notifications
You must be signed in to change notification settings - Fork 699
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@184 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
- Loading branch information
chiba
committed
Jun 21, 2005
1 parent
5de7634
commit aa0900d
Showing
8 changed files
with
361 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
public class HelloWorld { | ||
public void print() { | ||
System.out.println("hello world"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import java.io.*; | ||
import javassist.tool.HotSwapper; | ||
|
||
public class Test { | ||
public static void main(String[] args) throws Exception { | ||
HotSwapper hs = new HotSwapper(8000); | ||
new HelloWorld().print(); | ||
|
||
File newfile = new File("logging/HelloWorld.class"); | ||
byte[] bytes = new byte[(int)newfile.length()]; | ||
new FileInputStream(newfile).read(bytes); | ||
System.out.println("** reload a logging version"); | ||
|
||
hs.reload("HelloWorld", bytes); | ||
new HelloWorld().print(); | ||
|
||
newfile = new File("HelloWorld.class"); | ||
bytes = new byte[(int)newfile.length()]; | ||
new FileInputStream(newfile).read(bytes); | ||
System.out.println("** reload the original version"); | ||
|
||
hs.reload("HelloWorld", bytes); | ||
new HelloWorld().print(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
public class HelloWorld { | ||
public void print() { | ||
System.out.println("** HelloWorld.print()"); | ||
System.out.println("hello world"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.