01: package org.apache.ojb.broker;
02:
03: /* Copyright 2003-2005 The Apache Software Foundation
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * 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: * Called before an object will be stored by a persistence broker.
35: *
36: * @param event The event object
37: */
38: public void beforeInsert(PBLifeCycleEvent event)
39: 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)
47: throws PersistenceBrokerException;
48:
49: /**
50: * Called before an object will be updated by a persistence broker.
51: *
52: * @param event The event object
53: */
54: public void beforeUpdate(PBLifeCycleEvent event)
55: throws PersistenceBrokerException;
56:
57: /**
58: * Called after an object has been stored by a persistence broker.
59: *
60: * @param event The event object
61: */
62: public void afterUpdate(PBLifeCycleEvent event)
63: throws PersistenceBrokerException;
64:
65: /**
66: * Called before an object will be deleted by a persistence broker.
67: *
68: * @param event The event object
69: */
70: public void beforeDelete(PBLifeCycleEvent event)
71: throws PersistenceBrokerException;
72:
73: /**
74: * Called after an object has been deleted by a persistence broker.
75: *
76: * @param event The event object
77: */
78: public void afterDelete(PBLifeCycleEvent event)
79: throws PersistenceBrokerException;
80:
81: /**
82: * Called after an object has been looked up by a persistence broker.
83: *
84: * @param event The event object
85: */
86: public void afterLookup(PBLifeCycleEvent event)
87: throws PersistenceBrokerException;
88: }
|