KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > sessions > SessionEventListener


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21 // Copyright (c) 1998, 2005, Oracle. All rights reserved.
22
package oracle.toplink.essentials.sessions;
23
24 import java.util.*;
25
26 /**
27  * <p><b>Purpose</b>: Used to support session events.
28  * To register for events notification an event listener must be registered with the session.
29  *
30  * @see SessionEventManager#addListener(SessionEventListener)
31  * @see Session#getEventManager()
32  * @see SessionEvent
33  */

34 public interface SessionEventListener extends EventListener {
35
36     /**
37      * PUBLIC:
38      * This event is raised on the session if a descriptor is missing for a class being persisted.
39      * This can be used to lazy register the descriptor or set of descriptors.
40      */

41     public void missingDescriptor(SessionEvent event);
42
43     /**
44      * PUBLIC:
45      * This event is raised on the session after read object query detected more than a single row back from the database.
46      * The "result" of the event will be the call. Some applications may want to interpret this as an error or warning condition.
47      */

48     public void moreRowsDetected(SessionEvent event);
49
50     /**
51      * PUBLIC:
52      * This event is raised on the session after update or delete SQL has been sent to the database
53      * but a row count of zero was returned.
54      */

55     public void noRowsModified(SessionEvent event);
56
57     /**
58      * PUBLIC:
59      * This event is raised on the session after a stored procedure call has been executed that had output parameters.
60      * If the proc was used to override an insert/update/delete operation then TopLink will not be expecting any return value.
61      * This event mechanism allows for a listner to be registered before the proc is call to process the output values.
62      * The event "result" will contain a DatabaseRow of the output values, and property "call" will be the StoredProcedureCall.
63      */

64     public void outputParametersDetected(SessionEvent event);
65
66     /**
67      * PUBLIC:
68      * This event is raised on the client session after creation/acquiring.
69      */

70     public void postAcquireClientSession(SessionEvent event);
71
72     /**
73      * PUBLIC:
74      * This event is raised on when using the server/client sessions.
75      * This event is raised after a connection is acquired from a connection pool.
76      */

77     public void postAcquireConnection(SessionEvent event);
78
79     /**
80      * PUBLIC:
81      * This event is raised when a ClientSession, with Isolated data, acquires
82      * an exclusive connection. The event will contain the ClientSession that
83      * is being acquired. Users can set properties within the ConnectionPolicy
84      * of that ClientSession for access within this event.
85      */

86     public void postAcquireExclusiveConnection(SessionEvent event);
87
88     /**
89      * PUBLIC:
90      * This event is raised on the unit of work after creation/acquiring.
91      * This will be raised on nest units of work.
92      */

93     public void postAcquireUnitOfWork(SessionEvent event);
94
95     /**
96      * PUBLIC:
97      * This event is raised after a database transaction is started.
98      * It is not raised for nested transactions.
99      */

100     public void postBeginTransaction(SessionEvent event);
101
102     /**
103      * PUBLIC:
104      * This event is raised after the commit has begun on the UnitOfWork but before
105      * the changes are calculated.
106      */

107     public void preCalculateUnitOfWorkChangeSet(SessionEvent event);
108
109     /**
110      * PUBLIC:
111      * This event is raised after the commit has begun on the UnitOfWork and
112      * after the changes are calculated. The UnitOfWorkChangeSet, at this point,
113      * will contain changeSets without the version fields updated and without
114      * IdentityField type primary keys. These will be updated after the insert, or
115      * update, of the object
116      */

117     public void postCalculateUnitOfWorkChangeSet(SessionEvent event);
118
119     /**
120      * PUBLIC:
121      * This event is raised after a database transaction is commited.
122      * It is not raised for nested transactions.
123      */

124     public void postCommitTransaction(SessionEvent event);
125
126     /**
127      * PUBLIC:
128      * This event is raised on the unit of work after commit.
129      * This will be raised on nest units of work.
130      */

131     public void postCommitUnitOfWork(SessionEvent event);
132
133     /**
134      * PUBLIC:
135      * This event is raised after the session connects to the database.
136      * In a server session this event is raised on every new connection established.
137      */

138     public void postConnect(SessionEvent event);
139
140     /**
141      * PUBLIC:
142      * This event is raised after the execution of every query against the session.
143      * The event contains the query and query result.
144      */

145     public void postExecuteQuery(SessionEvent event);
146
147     /**
148      * PUBLIC:
149      * This event is raised on the client session after releasing.
150      */

151     public void postReleaseClientSession(SessionEvent event);
152
153     /**
154      * PUBLIC:
155      * This event is raised on the unit of work after release.
156      * This will be raised on nest units of work.
157      */

158     public void postReleaseUnitOfWork(SessionEvent event);
159
160     /**
161      * PUBLIC:
162      * This event is raised on the unit of work after resuming.
163      * This occurs after pre/postCommit.
164      */

165     public void postResumeUnitOfWork(SessionEvent event);
166
167     /**
168      * PUBLIC:
169      * This event is raised after a database transaction is rolledback.
170      * It is not raised for nested transactions.
171      */

172     public void postRollbackTransaction(SessionEvent event);
173
174     /**
175      * PUBLIC:
176      * This even will be raised after a UnitOfWorkChangeSet has been merged
177      * When that changeSet has been received from a distributed session
178      */

179     public void postDistributedMergeUnitOfWorkChangeSet(SessionEvent event);
180
181     /**
182      * PUBLIC:
183      * This even will be raised after a UnitOfWorkChangeSet has been merged
184      */

185     public void postMergeUnitOfWorkChangeSet(SessionEvent event);
186
187     /**
188      * PUBLIC:
189      * This event is raised before a database transaction is started.
190      * It is not raised for nested transactions.
191      */

192     public void preBeginTransaction(SessionEvent event);
193
194     /**
195      * PUBLIC:
196      * This event is raised before a database transaction is commited.
197      * It is not raised for nested transactions.
198      */

199     public void preCommitTransaction(SessionEvent event);
200
201     /**
202      * PUBLIC:
203      * This event is raised on the unit of work before commit.
204      * This will be raised on nest units of work.
205      */

206     public void preCommitUnitOfWork(SessionEvent event);
207
208     /**
209      * PUBLIC:
210      * This event is raised before the execution of every query against the session.
211      * The event contains the query to be executed.
212      */

213     public void preExecuteQuery(SessionEvent event);
214
215     /**
216      * PUBLIC:
217      * This event is raised on the unit of work after the SQL has been flushed, but the commit transaction has not been executed.
218      * It is similar to the JTS prepare phase.
219      */

220     public void prepareUnitOfWork(SessionEvent event);
221
222     /**
223      * PUBLIC:
224      * This event is raised on the client session before releasing.
225      */

226     public void preReleaseClientSession(SessionEvent event);
227
228     /**
229      * PUBLIC:
230      * This event is raised on when using the server/client sessions.
231      * This event is raised before a connection is released into a connection pool.
232      */

233     public void preReleaseConnection(SessionEvent event);
234
235     /**
236      * PUBLIC:
237      * This event is fired just before a Client Session, with isolated data,
238      * releases its Exclusive Connection
239      */

240     public void preReleaseExclusiveConnection(SessionEvent event);
241
242     /**
243      * PUBLIC:
244      * This event is raised on the unit of work before release.
245      * This will be raised on nest units of work.
246      */

247     public void preReleaseUnitOfWork(SessionEvent event);
248
249     /**
250      * PUBLIC:
251      * This event is raised before a database transaction is rolledback.
252      * It is not raised for nested transactions.
253      */

254     public void preRollbackTransaction(SessionEvent event);
255
256     /**
257      * PUBLIC:
258      * This even will be raised before a UnitOfWorkChangeSet has been merged
259      * When that changeSet has been received from a distributed session
260      */

261     public void preDistributedMergeUnitOfWorkChangeSet(SessionEvent event);
262
263     /**
264      * PUBLIC:
265      * This even will be raised before a UnitOfWorkChangeSet has been merged
266      */

267     public void preMergeUnitOfWorkChangeSet(SessionEvent event);
268
269     /**
270      * PUBLIC:
271      * This Event is raised before the session logs in.
272      */

273     public void preLogin(SessionEvent event);
274
275     /**
276      * PUBLIC:
277      * This Event is raised after the session logs in.
278      */

279     public void postLogin(SessionEvent event);
280 }
281
Popular Tags