tags:

views:

180

answers:

5

I'd like to learn how, or if its possible at all to programmaticly interact with a black-box java application(by reading its data). Has there been any previous research/work on doing this sort of thing?

I'd imagine that running on a JVM significantly complicates things.

@anon: Doing this with any JVM is relevant. Do you have to know or control the specifics of how the JVM allocates memory to extract data from a java application?

A: 

The Sable group at McGill University has contributed a lot of research to the Java world.

Much of the work is getting rather dated, but you might find some help in their EVolve project which has the goal of visualizing object-oriented programs. Some of their projects appear to be actively maintained (such as Soot, their Java optimization framework), so you might find luck contacting them directly

Chadwick
A: 

Hi.

I believe what you're looking for is what the Eclipse MAT does. You might want to take a look at the source code...

Fififox
A: 

The HotSpot JVM allows you to hook up an agentlib from a profiler (see http://stackoverflow.com/questions/948549/open-source-java-profilers or commercials like Your Kit), in the profiler you can then inspect the memory/cpu/threads etc. If you want very specific stuff you might want to make your own agentlib that sends you information about the jvm that you need.

Redlab
+1  A: 

It is easily possible with, for example, StackTrace. It can attach to a java process and let you inspect and change almost everything with BeanShell.

unbeli
+2  A: 

You could look into java.lang.instrument. As long as you understand the class structure of the application, it will let you modify the methods in an already-running JVM and you may be able to concoct a way that allows you to extract or insert data enough to communicate (depends on the methods available, of course).

Greg Harman
Thanks, I had never heard of this and it looks promising. I imagine using it in conjunction with the profiling tools other answers have mentioned could be helpful as well.
argonide