Register to ANY java object change ?

B

bernard

Young Java programmer:

Is it possible to write a program registering to be notified upon
changes on any java object (of the process of this program) with a
sort of callback routine ?

The Observer / Notifier mechanism is not ok, because we need to
register to changes (attributes, etc..) of any instance of any java
class within the JVM.
And we want the java class to be potentially any java class (entirely
free one).

(Whereas the Observer/ notifier principle requires observed object to
inherit from a given class).

Some JVM Debbugger API ?

Any idea ?

Thanks in advance .

Regards
 
R

Roedy Green

You can get a feedback loop problem.

The listener will be flooded with false alarms. Further every time it
acts on an alarm, it may trigger another flood of alarms.

It is roughly the sort of problem that spreadsheets have with circular
dependencies. Whenever X changes, Y which depends on it, must be
recomputed.

Perhaps spreadsheet logic, compiled to Java, is the way to deal with
this sort of thing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top