Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8328151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:20:56+00:00 2026-06-09T01:20:56+00:00

I am using aspectj for analysis of my program. Currently my aspect looks like:

  • 0

I am using aspectj for analysis of my program. Currently my aspect looks like:

@Aspect
public class InvokeAspect {
    @Before("anyCall(t, s)")
    public void processInvocation(JoinPoint point, JoinPoint.EnclosingStaticPart enclosingStatic, Object t, Object s){
        System.out.println("***");
        System.out.println("Invoker: " + s.toString());
        System.out.println("Invoker: " + enclosingStatic.getSignature().toLongString());
        System.out.println("Invoked object: " + t.toString());
        System.out.println("Invoked: " + point.getSignature().toLongString());
        System.out.println("");
        System.out.println("***");
    }
    @Pointcut("call(* *(..)) && !within(cz.cvut.kbss.odra..*) && target(t) && this(s)")
    public void anyCall(Object t, Object s){}
}

Everything works as expected, but is there any way to convice aspectj to use the aspect, even if this or source do not exist? (static method call or call from static method). Or do I have to write 3 aspects?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:20:58+00:00Added an answer on June 9, 2026 at 1:20 am

    Yes, I think you will have to write three pointcuts – one along the lines of what you have, second a call from a static method and the third for a call from an object to a static method, probably three different advices also, delegating to the processInvocation method above

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using aspectJ class for Exception Handling aspect in Spring. i need to
Using AspectJ, I can get hold of the singleton instance of an aspect using
Using AspectJ with enums I get the next results: public enum EnumName { B,
I am using the aspectj-maven-plugin when trying to weave my aspect into my application.
I am using Spring 3.0 with AspectJ and like use AspectJ more than AOP
I'm trying to normalize URIs across an application using AspectJ. I would like to
I am currently using Alexander Potochkin's AspectJ EDTChecker code (relevant code at bottom of
I am using a X.jar and adding to my AspectJ project(in eclipse). I have
I have an application using AspectJ with load time weaving to advise various methods.
i'm using aspectJ in my Android project because of monkeytalk ( cross platform testing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.