
Friday July 25, 2008
Playing with JSqueak
Squeak is a open source implementation of Smalltalk. What is JSqueak? JSqueak is a Squeak interpreter written in Java. You can download JSqueak source code and play with it. I did the following:
- Expanded the downloaded JSqueak.zip under a directory, say c:\JSqueak.
- cd c:\JSqueak
- javac -d . *.java
- copy mini.image.gz JSqueak
- java JSqueak.Main
Even if you are not going to learn Smalltalk (why?), you can have the fun of reading Smalltalk VM implemented in Java. If you are lazy and don't want to compile, you can run directly by JNLP link from
http://research.sun.com/projects/JSqueak/. Inside the Squeak environment, I wrote the legendary "Hello World"

This is how it looks...
( Jul 25 2008, 11:37:21 AM IST )
Permalink

|

|

|

|

|

Friday July 18, 2008
BTrace and JMX
You can dyanamically attach BTrace to a Java process to inject trace code into it. BTrace client classescollect the trace output via a socket -- these client classes are used by BTrace command line client as well as VisualVM plugin for BTrace. How about attaching a JMX client to collect BTrace's trace data? Yes, it is possible to access a BTrace class's static fields as attributes of a MBean with this RFE.
There are two MBean samples in the BTrace repository. I attached both BTrace samples to a "Java2D demo" process. And then I attached VisualVM to view the Mbean registered by these BTrace samples:
- ThreadCounterBean.java - this sample instruments java.lang.Thread.start() method to update a counter field. This counter field is accessible by JMX clients.
- HistogramBean.java - this sample
collects histogram of java.awt.Component objects created by an application and exposes the histogram (map) as MBean attribute.
( Jul 18 2008, 07:56:56 PM IST )
Permalink

|

|

|

|

|