選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

EachJVMOnSelf.java 419B

1234567891011121314151617181920
  1. import org.aspectj.testing.Tester;
  2. public class EachJVMOnSelf {
  3. public static void main(String[] args) {
  4. new C();
  5. Tester.checkEqual(A.aspectOf().advisedNewClass, "C");
  6. }
  7. }
  8. aspect A issingleton() {
  9. String advisedNewClass = null;
  10. after () returning (): this(*) && execution(new(..)) && !this(A) {
  11. advisedNewClass = thisJoinPoint.getSourceLocation().getWithinType().getName();
  12. }
  13. }
  14. class C {
  15. }