I am new at instrumentation world. I am trying to instrumentate a remote JVM at Runtime. Actually, i have to log all classes or part of them and transform them.. I have read many documents and i found this code HERE
I changed the code and i replaced
// Run sayHello in a loop
Person person = new Person();
for(int i = 0; i < 1000; i++) {
person.sayHello(i);
person.sayHello("" + (i*-1));
Thread.currentThread().join(5000);
}
by this one:
for (int i = 1; i < args.length; i++) {
String className = args[i] ;
System.out.println("className" + className);
// Call transformClass on the transformer MBean
server.invoke(on, "transformClass", new Object[]{className}, new String[]{String.class.getName()});
}
But i found that args.length=0 I don't know what the args[] contain...And if it contains loaded classes (i assume) then why it is empty..
Any help please?