KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > broker > PBLifeCycleListener


1 package org.apache.ojb.broker;
2
3 /* Copyright 2003-2005 The Apache Software Foundation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 /**
19  * The listener interface for receiving persistent object
20  * life cycle information. This interface is intended for
21  * non persistent objects which want to track persistent
22  * object life cycle.
23  * <br/>
24  * NOTE:
25  * <br/>
26  * Persistent objects should implement the {@link PersistenceBrokerAware}
27  * interface to be notified on persistent method calls via callback.
28  *
29  * @author Armin Waibel
30  * @version $Id: PBLifeCycleListener.java,v 1.6.2.1 2005/12/21 22:22:07 tomdz Exp $
31  */

32 public interface PBLifeCycleListener extends PBListener
33 {
34     /**
35      * Called before an object will be stored by a persistence broker.
36      *
37      * @param event The event object
38      */

39     public void beforeInsert(PBLifeCycleEvent event) throws PersistenceBrokerException;
40
41     /**
42      * Called after an object instance has been stored by a persistence broker.
43      *
44      * @param event The event object
45      */

46     public void afterInsert(PBLifeCycleEvent event) throws PersistenceBrokerException;
47
48     /**
49      * Called before an object will be updated by a persistence broker.
50      *
51      * @param event The event object
52      */

53     public void beforeUpdate(PBLifeCycleEvent event) throws PersistenceBrokerException;
54
55     /**
56      * Called after an object has been stored by a persistence broker.
57      *
58      * @param event The event object
59      */

60     public void afterUpdate(PBLifeCycleEvent event) throws PersistenceBrokerException;
61
62     /**
63      * Called before an object will be deleted by a persistence broker.
64      *
65      * @param event The event object
66      */

67     public void beforeDelete(PBLifeCycleEvent event) throws PersistenceBrokerException;
68
69     /**
70      * Called after an object has been deleted by a persistence broker.
71      *
72      * @param event The event object
73      */

74     public void afterDelete(PBLifeCycleEvent event) throws PersistenceBrokerException;
75
76     /**
77      * Called after an object has been looked up by a persistence broker.
78      *
79      * @param event The event object
80      */

81     public void afterLookup(PBLifeCycleEvent event) throws PersistenceBrokerException;
82 }
83
Popular Tags