KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb3 > test > entitycallback > JourneyCallbackListener


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.ejb3.test.entitycallback;
23
24 import javax.persistence.PrePersist;
25 import javax.persistence.PostPersist;
26 import javax.persistence.PreRemove;
27 import javax.persistence.PostRemove;
28 import javax.persistence.PreUpdate;
29 import javax.persistence.PostUpdate;
30 import javax.persistence.PostLoad;
31
32 /**
33  * @author <a HREF="mailto:kabir.khan@jboss.org">Kabir Khan</a>
34  * @version $Revision: 37459 $
35  */

36 public class JourneyCallbackListener
37 {
38    @PrePersist
39    public void doPreCreate(Object JavaDoc bean)
40    {
41       System.out.println("Journey doPreCreate");
42       CallbackCounterBean.addCallback("Journey", PrePersist.class);
43    }
44
45    @PostPersist
46    public void doPostCreate(Object JavaDoc bean)
47    {
48       System.out.println("Journey doPostCreate");
49       CallbackCounterBean.addCallback("Journey", PostPersist.class);
50    }
51
52    @PreRemove
53    public void doPreRemove(Object JavaDoc bean)
54    {
55       System.out.println("Journey doPreRemove");
56       CallbackCounterBean.addCallback("Journey", PreRemove.class);
57    }
58
59    @PostRemove
60    public void doPostRemove(Object JavaDoc bean)
61    {
62       System.out.println("Journey doPostRemove");
63       CallbackCounterBean.addCallback("Journey", PostRemove.class);
64    }
65
66    @PreUpdate
67    public void doPreUpdate(Object JavaDoc bean)
68    {
69       System.out.println("Journey doPreUpdate");
70       CallbackCounterBean.addCallback("Journey", PreUpdate.class);
71    }
72
73    @PostUpdate
74    public void doPostUpdate(Object JavaDoc bean)
75    {
76       System.out.println("Journey doPostUpdate");
77       CallbackCounterBean.addCallback("Journey", PostUpdate.class);
78    }
79
80    @PostLoad
81    public void doPostLoad(Object JavaDoc bean)
82    {
83       System.out.println("Journey doPostLoad");
84       CallbackCounterBean.addCallback("Journey", PostLoad.class);
85    }
86    
87 }
88
Popular Tags