parameter « aspectj « Java Enterprise Q&A





1. AspectJ: parameter in a pointcut    stackoverflow.com

I'm using AspectJ to advice all the public methods which do have an argument of a chosen class. I tried the following:

pointcut permissionCheckMethods(Session sess) : 
    (execution(public * ...

2. Placing advice on any parameter of a given type in AspectJ    stackoverflow.com

Is there a way to put advice on any method with a parameter of a given type. I'm planning to use this for a class that needs input filtering. As an example:

@Filtered
class ...

3. Pointcut matching methods with annotated parameters    stackoverflow.com

I need to create an aspect with a pointcut matching a method if:

  1. it is annoted with MyAnnotationForMethod
  2. One of its parameters (can have many) is annotated with @MyAnnotationForParam (but can have other ...

4. aspectj pointcut with annotation parameters    stackoverflow.com

I am using aspectj to intercept methods that are annotated with @Profile(description="smething")

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Profile {
    public String description() default "";
}

@Around("com.merc.aop.ctw.aspect.PointcutDefinitions.logAnnotatedMethods(profile)")
public Object profile(ProceedingJoinPoint pjp, Profile profile) throws Throwable {
 ...

5. Java accessing function call parameters via AspectJ    stackoverflow.com

package a;
    Class X
        public fX(int i, String s);

package b;
    Class Y
       ...

6. Capturing parameters of a method at runtime in Java    stackoverflow.com

Our application uses several back-end services and we maintain wrappers which contain the methods to make the actual service calls. If any exception occurs in any of those methods while invoking ...

7. java aspect with multiple parameter    stackoverflow.com

I'm having some trouble creating a before aspect for a method that has multiple parameters.


public class Sample {
    public boolean myCall(String s, String s1, String s3, 
  ...

8. Get annotated parameters inside a pointcut    stackoverflow.com

I have two annotation @LookAtThisMethod and @LookAtThisParameter, if I have a pointcut around the methods with @LookAtThisMethod how could I extract the parameters of said method which are annotated with @LookAtThisParameter? For ...

9. Catch any call made with a type as a parameter with AspectJ    stackoverflow.com

I'm trying to normalize URIs across an application using AspectJ. I would like to catch every call that is made to a method passing in a java.net.URI parameter. A simple pointcut ...





10. Get method parameter values using AspectJ    stackoverflow.com

I am using AspectJ to capture method calls. Then I need to get the method name and the parameter values passed. Let's have the following example:

Line2D line = new Line2D.Double(lineStart, lineEnd);
and graphics.draw(line);
I ...

11. Get method parameter values using AspectJ?    java-forums.org

I am using AspectJ to capture method calls. Then I need to get the method name and the parameter values passed. Let's have the following example: Line2D line = new Line2D.Double(lineStart, lineEnd); and graphics.draw(line); I need to capture all calls to Graphics2D.draw(Shape). I have a pointcut that does this: pointcut captureCallParameters(Shape name) : call(* *(Shape)) && args(name); The problem is when ...