• Post Reply Bookmark Topic Watch Topic
  • New Topic

Instrumentation  RSS feed

 
raja singh kumar
Ranch Hand
Posts: 189
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the oracle docs, instrumentation is mentioned sometimes as an interface, sometimes as a class. Is it an interface or class?

https://docs.oracle.com/javase/7/docs/api/java/lang/instrument/Instrumentation.html


Also the doc says, instrumentation is the addition of byte codes. What does that mean? I know that the java codes are converted to byte code and bytecode can be run on any platform. Are we going to add byte codes to the normal byte code generated for a java class for the purpose of monitoring?
 
Tim Moores
Saloon Keeper
Posts: 4032
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it an interface or class?

The page you linked to makes that very clear, does it not?

Are we going to add byte codes to the normal byte code generated for a java class for the purpose of monitoring?

The purpose does not have to be monitoring, but yes, that's the gist of it.
 
raja singh kumar
Ranch Hand
Posts: 189
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Interface Instrumentation

public interface Instrumentation
This class provides services needed to instrument Java programming language code.


This is what is mentioned in the link. It says "interface Instrumentation" and then says "this class provides services".
 
Tim Moores
Saloon Keeper
Posts: 4032
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, I see. You should read that as "Classes implementing this interface...". You could file a bug report to get the javadocs fixed.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!