[jboss-user] [JBoss Seam] - Audit Interceptor with State

kevin.genie do-not-reply at jboss.com
Wed Nov 29 07:09:44 EST 2006


Hi,

  What will be the best way to implement a Audit Log feature with Seam + EJB3 entity beans? I have read thru several docs but was unable to find a way  to pass state to the interceptor. By state what i mean is some data that is specific to the context. (For ex, the currently logged in user. I have to set the current user information to the Audit log). One way I tried and worked was that let all the entity beans extend from a Base Entity and the BaseEntity entity has the callback methods. Also, make all the entity beans Seam components including Base Entity. So in the Base Entity callback method, I can do a Contexts.getSessionConetxt.get("currentUser") and set  the usee_id to the createdBy or lastModifiedBy fields. 
 But the problem is how will i get the current state of the the entity fields in call back  (or in listener) for audit purpose because we will only get the changed values that are going to be flushed ?
 
 Also, is an entity listener is thead safe to be used with multiple entities? Like in the above scenario, if i have annotated the Base Entity with one listener class, then for every entity a new listener object will be created ?

Thanx

Kevin

  

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3989661#3989661

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3989661



More information about the jboss-user mailing list