Hi,

I've noticed in my project's infra-structure and there is something 
related on storing request data on a static Map, which identifies the 
elements by the current Thread. Since Envers listener is a Synchronized 
process (and not another thread), I could work by that way. I only need 
to make a ComponentRequestFilter to store UserRequest info at every new Page 
rendering.

If it fails, I will try your sugestion.

But it's too bad I couldn't use the IoC to make it prettier. Could I achieve 
that by using pure Hibernate Listeners/Interceptors?

Thanks!

- Everton




________________________________
De: Kristian Marinkovic <kristian.marinko...@porsche.co.at>
Para: Tapestry users <users@tapestry.apache.org>
Enviadas: Quinta-feira, 8 de Abril de 2010 2:56:56
Assunto: Re: [T5.1-Hib] Tapestry and Envers - Retrieve user information for 
auditing

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