hi everton,

if you really can't add the RevisionListener programmatically, define a 
public
static field in your listener using the service type, eg. UserInformation.

then define a eagerload service that has the UserInformation injected and 
set the
public static field in your RevisionListener:


public class RevisionListener {
    public static  UserInformation userInformation;
}

public class RevisionListenerInitializer {
        public RevisionListenerInitializer (UserInformation 
userInformation)
                RevisionListener.userInformation = userInformation;
}

consider this solution as the last resort if everything else fails. be 
careful
with this solution as it is considered bad coding style. i had to do this 
for 
hibernate-search too.

g,
kris



Von:    Everton Agner <everton_ag...@yahoo.com.br>
An:     Tapestry Users <users@tapestry.apache.org>
Datum:  07.04.2010 18:25
Betreff:        [T5.1-Hib] Tapestry and Envers - Retrieve user information 
for auditing



Hi,

Has anyone succeeded in integrating Envers (http://www.jboss.org/envers) 
in a T5.1 app, to audit information HttpRequest based?

I succeeded on putting Envers to work, but I'm stuck at this point and I 
would like to know which approaches some people used to achieve that.

The problem is... I just want to use my implementation os RevisionListener 
Interface, and implement the newRevision(revision) method that needs to 
retrieve the user information and store in the 'revision' object. But, 
since that kind of information would only be available by T5 IoC's 
container, I can't use it there - Becase the RevisionListener 
implementation is instantiated by Envers (i guess so) and it's a Singleton 
per EntityManagerFactory.

This is really a big problem for me, and I would appretiate any help.

Thanks!

- Everton



 
____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

Reply via email to