Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] selecting join points using annotations

I guess I didn't look enough:
 
 
Thanks again Ramnivas.
 
 
----- Original Message -----
Sent: Saturday, September 19, 2009 6:26 AM
Subject: Re: [aspectj-users] selecting join points using annotations

Perfect!
 
I didn't see any selection examples using annotations so I was unsure on how to use them in the join point.
 
Thank you Ramnivas
 
/robert
----- Original Message -----
Sent: Friday, September 18, 2009 11:51 PM
Subject: Re: [aspectj-users] selecting join points using annotations

This is easily possible:

pointcut encryptionOp(String data) : execution(@Encrypt void *(String)) && args(data);

void around(String data) : encryption(data) {
     proceed(encrypt(data));
}

pointcut decryptionOp() : execution(@Decrypt String *(..));

String around() : decryptionOp() {
     String encryptedData = proceed();
      return decrypt(encryptedData);
}

-Ramnivas


On Fri, Sep 18, 2009 at 6:47 PM, Robert Taylor <rtaylor@xxxxxxxxxxxxxx> wrote:
Greetings,
 
I have a need to leverage AOP to encrypt certain POJO setter String args prior to persisting them to the database
and to decrypt certain POJO getter methods return String values after they have retrieved String data from the database.
I wanted to do this using annotations. For example:
 
@Encrypt
public void setCreditCardNumber(String ccn) ...
 
@Decrypt
public String getCreditCardNumber()...
 
I've looked into the Security Annotations Framework (http://safr.sourceforge.net/)
and it looked promising, however, it can only be used if you are using Maven to build
your project. Unfortunately, I have no immediate plans to use Maven.
 
I haven't found any similar projects which simply use Ant tags; so I'm attempting to "roll my own" solution.
 
I've read through the AspectJ language docs and haven't found any information on selecting join points using annotations.
I browsed the docs on AspectJ 5 Developers Notebook regarding annotations, but it doesn't look like what I need.
I only want the methods selected by AspectJ if they have been properly identified using an annotation.
 
Is this possible with the current AspectJ version?
 
/robert
 

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Back to the top