Questions tagged [pointcut]

221 questions
0
votes
1 answer

AspectJ Pointcut for methods taking any number arguments of types Serializable or primitive type

How would I write a Pointcut for methods taking any number of arguments that either implements Serializable or are of primitive type? E.g. Pointcut should match: methodA(String str, int i) methodB(String str, String str2, List list) but…
0
votes
1 answer

Spring formal unbound in pointcut error, unresolved type of arg

i would like to ask for help because i have no idea what is the reason of error mentioned in topic. After debugging method argument got unresolved type instead of IdAware. Could someone help me? Method: @Before("execution(public * *(..)) &&…
Maciekkk
  • 27
  • 5
0
votes
2 answers

Pointcut to match call to any method except those frm jdk

I want my point cut to mark call to any method except those in java sdk Pointcut trace(): call(* *(..)) && !within(methodprofilt) && !call(* java*(..) This doesnt work
user1568701
  • 43
  • 3
  • 11
0
votes
1 answer

AspectJ is there a way to retrieve the return value from Before and use it inside the pointcut?

I have an @Before method which is returning some token that I wish to use inside the pointcut. @Pointcut("execution(getData())") private void selectAll(){} @Before("selectAll()") public void beforeAdvice(ProceedingJoinPoint joinPoint) throws…
as3rdaccount
  • 3,711
  • 12
  • 42
  • 62
0
votes
1 answer

Intercepting aspect for custom annotion

I am writing a library/sdk which can intercept any methods which are annotated with a custom annotation @Monitor. The code works somewhat like this @Monitor public void methodA(String test) And the aspect which intercepts this has this pointcut…
Abhiroop Sarkar
  • 2,251
  • 1
  • 26
  • 45
0
votes
1 answer

Aspectj pointcut expression

I am having trouble with building aspectJ expression. I would like to run my advice when any of "QueryUtil" method is invoked from class "Report". For example: if we invoke QueryUtil.*() inside of Report.*() -> Advice is executed. If we invoke…
Gazeciarz
  • 516
  • 1
  • 8
  • 22
0
votes
1 answer

pointcut execution for specific class constructor

I'm trying to create specific class constructor pointcut execution but I get the following marker: Aspect code: public aspect CarLogger { private Logger logger; pointcut instantiate() : execution (Car.new(..)); after() : instantiate(){ …
Gil Peretz
  • 2,399
  • 6
  • 28
  • 44
0
votes
1 answer

Writing a precise pointcut expression

I am using Spring AOP for logging wherein I want to log input/output of all methods present in package. I have written following pointcut for target package. @Pointcut("within(com.mypackage.model.*)") public void allmethods(){}; My logging method…
Yogesh Pitale
  • 115
  • 1
  • 1
  • 11
0
votes
0 answers

AspectJ: Accessing field defined in aspect (how to access inter-type member?)

I'm currently working with AspectJ the first time to get "my feet wet". I would like to add a new Button on my Main frame (class Main extends JFrame). This is what I have so far: public aspect MainWipe { public static final String Main.wipeText =…
Markus Weninger
  • 11,931
  • 7
  • 64
  • 137
0
votes
1 answer

AspectJ join point with simple types

Are there defined join points in arithmetics that I can catch? Something like: int a = 4; int b = 2; int c = a + b; Can I make a pointcut that catches any one of those lines? And what context will I be able to get? I would like to add a before() to…
Jon List
  • 1,504
  • 1
  • 14
  • 20
0
votes
1 answer

I am searching for a specific pointcut in AspectJ

The line: test.address.postal_code = "12345"; will result in a flow like: before-get test.address return test.address after-get test.address before-set test.address.postal_code set postal_code after-set test.address.postal_code in…
th3falc0n
  • 1,389
  • 1
  • 12
  • 33
0
votes
1 answer

Get the value of the accessed field within a get pointcut

I have a pointcut which listens to access to an field in DBRow and all subclasses before(DBRow targ) throws DBException: get(@InDB * DBRow+.*) && target(targ) { targ.load(); } I now need to determine the value of the accesed field, that is…
th3falc0n
  • 1,389
  • 1
  • 12
  • 33
0
votes
0 answers

Pure Ruby AOP (for collecting analytics about user interactions)

Hi my application is already way too complicated to add some analytics code in it. I really want to design special classes that will allow me to insert some AOP pointcuts (that will trigger some mixpanel). I do not want to use a gem, only pure…
rolele
  • 781
  • 9
  • 24
0
votes
1 answer

Spring AspectJ point cuts

I am in need of writing a Single pointcut to intercept the constructor of all the classes. The actual need is to intercept all the beans where in no other methods apart from the init() and the constructor are invoked. For the init it is straight…
Karthik S
  • 91
  • 1
  • 10
0
votes
1 answer

Before pointcut on HttpServletResponse sendRedirect compiling but not firing

I'm currently trying to add a pointcut around calls to HttpServletResponse.sendRedirect (api doc http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletResponse.html) using aspectj and spring aop. The code for the class and pointcut are…
kmrt
  • 37
  • 6