• Post Reply Bookmark Topic Watch Topic
  • New Topic

listening to method invocation  RSS feed

 
Marembo Ochieng'
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to create a sort of manager application that manages an already running application.
the application intents purpose is to listen to every method invocation of the managed application
and if any exception is thrown by the invoked method, the managing application can be able to log this
exception to file or database.

the managed application is a java application running in the same virtual machine as the managing application
moreover, the managed application does not implement any part of the JMX api to allow for agent management

how can i effectively achieve this?

any help will be useful
 
John de Michele
Rancher
Posts: 600
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marembo:

Can you make changes to the original program? It seems adding a logger would be your easiest option.

John.
 
Marembo Ochieng'
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the problem is that i did not develop the application and i do not have the source of the entire application.

the only thing i have got with me is the running application
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out AspectJ.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
+1 for something AOPish. You *could* instrument it yourself, but AspectJ/etc. will do all that work for you.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!