I want to use an aspect to track methods invoke, e.g., on ClassA's foo() method, if any class invokes this method, I will print "Class XXXX invoked foo.", however, I don't know how to get the class XXXX 's infomation, how to do it?
No. If you are not weaving call sites, then there is no way to determine the calling type. It's possible that you could use load time weaving for this, however. But, I would recommend against trying load time weaving on JDK classes (it may be possible in some situations, but is really, really tricky).