KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > ejb > callback > EJB3PostInsertEventListener


1 /*
2  * JBoss, the OpenSource EJB server
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.hibernate.ejb.callback;
8
9 import org.hibernate.event.PostInsertEvent;
10 import org.hibernate.event.PostInsertEventListener;
11
12 /**
13  * @author <a HREF="mailto:kabir.khan@jboss.org">Kabir Khan</a>
14  * @version $Revision: 1.3 $
15  */

16 public class EJB3PostInsertEventListener implements PostInsertEventListener {
17     EntityCallbackHandler callbackHandler;
18
19     public EJB3PostInsertEventListener(EntityCallbackHandler callbackHandler) {
20         this.callbackHandler = callbackHandler;
21     }
22
23     public void onPostInsert(PostInsertEvent event) {
24         Object JavaDoc entity = event.getEntity();
25         callbackHandler.postCreate( entity );
26     }
27 }
28
Popular Tags