Wow .. great .. thanks for your help ( everybody )

Now, i've doneit ... amazing how powerfull annotations are :-)

But ...

Is there any way i can send dynamic parameters to an annotation ?

private String userName;

Like @Audit (user="+userName+") or something like that ... or a way i can retrieve that information from inside the worker ..
Annotations are just "special" java interfaces. They are providing some Meta 
data.
Maybe you will want to have a look on : 
http://java.sun.com/docs/books/tutorial/java/javaOO/annotations.html
http://www.oracle.com/technology/pub/articles/hunter_meta_2.html

You should find some annotations declaration in tapestry-annotation jar sources.


For what you are going to do you will probably have to create a Worker. That 
may appear to be a bit tricky at first glance.
Have a look to ComponentClassTransformWorker and some of its implementation 
(PropertyWorker, InjectWorker and so on...)

Also have a look to TapestryModule class and 
contributeComponentClassTransformWorker() method.

-----Message d'origine-----
De : jose luis sanchez [mailto:joseluis.sanc...@m-centric.com]
Envoyé : jeudi 30 juillet 2009 19:01
À : Tapestry users
Objet : [T5] Create audit annotation

Hi all.

I'm trying to create an annotation for auditing methods in my
application, in order to log to a file who is doing what.

The use of the annotation should be like this ...


@Audit(user=user, what=method)
private void storingAccount(.....)

where user and method should be parameters ...

But i can't find any info on how to make an annotation .. any idea ?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org




Ce message et les pièces jointes sont confidentiels et réservés à l'usage 
exclusif de ses destinataires. Il peut également être protégé par le secret 
professionnel. Si vous recevez ce message par erreur, merci d'en avertir 
immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant 
être assurée sur Internet, la responsabilité du groupe Atos Origin ne pourra 
être recherchée quant au contenu de ce message. Bien que les meilleurs efforts 
soient faits pour maintenir cette transmission exempte de tout virus, 
l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne 
saurait être recherchée pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for 
the addressee; it may also be privileged. If you receive this e-mail in error, 
please notify the sender immediately and destroy it. As its integrity cannot be 
secured on the Internet, the Atos Origin group liability cannot be triggered 
for the message content. Although the sender endeavours to maintain a computer 
virus-free network, the sender does not warrant that this transmission is 
virus-free and will not be liable for any damages resulting from any virus 
transmitted.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to