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 <code>PersistenceBroker</code>
20: * state changes.
21: *
22: * @author Armin Waibel
23: * @version $Id: PBStateListener.java,v 1.3.2.2 2005/12/21 22:22:07 tomdz Exp $
24: */
25: public interface PBStateListener extends PBListener {
26: /**
27: * Called after the {@link org.apache.ojb.broker.PersistenceBroker} instance was
28: * obtained from the pool.
29: *
30: * @param event The event object
31: */
32: public void afterOpen(PBStateEvent event);
33:
34: /**
35: * Called before a transaction was started.
36: *
37: * @param event The event object
38: */
39: public void beforeBegin(PBStateEvent event);
40:
41: /**
42: * Called after a transaction was started.
43: *
44: * @param event The event object
45: */
46: public void afterBegin(PBStateEvent event);
47:
48: /**
49: * Called before a transaction will be comitted.
50: *
51: * @param event The event object
52: */
53: public void beforeCommit(PBStateEvent event);
54:
55: /**
56: * Called after a transaction was comitted.
57: *
58: * @param event The event object
59: */
60: public void afterCommit(PBStateEvent event);
61:
62: /**
63: * Called before a transaction will be rolled back.
64: *
65: * @param event The event object
66: */
67: public void beforeRollback(PBStateEvent event);
68:
69: /**
70: * Called after a transaction was rolled back.
71: *
72: * @param event The event object
73: */
74: public void afterRollback(PBStateEvent event);
75:
76: /**
77: * Called before the {@link org.apache.ojb.broker.PersistenceBroker}
78: * instance will be returned to the pool.
79: *
80: * @param event The event object
81: */
82: public void beforeClose(PBStateEvent event);
83: }
|