AOP 片段:这是 Aspectj 吗?

发布于 2024-12-13 12:10:08 字数 675 浏览 3 评论 0原文

我遇到了以下关于 AOP 的片段。有人能告诉我那是什么编程语言吗?

  public aspect MyAspect
    {
      // Define a pointcut matched by all methods in the application whose name begins with
      // Get and accepting no arguments. (There are many other ways to define criteria.)
      public pointcut allGetMethods ():
             call (* Get*() );

      // Define an advice to run before any join points that matches the specified pointcut.
      before(): allGetMethods()
      {
        // Do your cross-cutting concern stuff here
        // for example, log about the method being executed
        .
        .
        .
      }
    }

是AspectJ吗? 或者没有这样的语言?

I encountered the following snippet about AOP. Can someone tell me what programming language is that?

  public aspect MyAspect
    {
      // Define a pointcut matched by all methods in the application whose name begins with
      // Get and accepting no arguments. (There are many other ways to define criteria.)
      public pointcut allGetMethods ():
             call (* Get*() );

      // Define an advice to run before any join points that matches the specified pointcut.
      before(): allGetMethods()
      {
        // Do your cross-cutting concern stuff here
        // for example, log about the method being executed
        .
        .
        .
      }
    }

is it AspectJ?
or there is no such laguage?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笔落惊风雨 2024-12-20 12:10:08

是的,这是AspectJ

Yes, this is AspectJ.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文