001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * // Copyright (c) 1998, 2007, Oracle. All rights reserved.
005: *
006: *
007: * The contents of this file are subject to the terms of either the GNU
008: * General Public License Version 2 only ("GPL") or the Common Development
009: * and Distribution License("CDDL") (collectively, the "License"). You
010: * may not use this file except in compliance with the License. You can obtain
011: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
012: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
013: * language governing permissions and limitations under the License.
014: *
015: * When distributing the software, include this License Header Notice in each
016: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
017: * Sun designates this particular file as subject to the "Classpath" exception
018: * as provided by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the License
020: * Header, with the fields enclosed by brackets [] replaced by your own
021: * identifying information: "Portions Copyrighted [year]
022: * [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * If you wish your version of this file to be governed by only the CDDL or
027: * only the GPL Version 2, indicate your decision by adding "[Contributor]
028: * elects to include this software in this distribution under the [CDDL or GPL
029: * Version 2] license." If you don't indicate a single choice of license, a
030: * recipient has the option to distribute your version of this file under
031: * either the CDDL, the GPL Version 2 or to extend the choice of license to
032: * its licensees as provided above. However, if you add GPL Version 2 code
033: * and therefore, elected the GPL Version 2 license, then the option applies
034: * only if the new code is made subject to such option by the copyright
035: * holder.
036: */
037: package oracle.toplink.essentials.sessions;
038:
039: /**
040: * <p><b>Purpose</b>: To provide a trivial implemetation of SessionEventListener.
041: * You may subclass this class rather than implement the entire SessonEventListener
042: * interface in cases where only a small subset of the interface methods are needed.
043: *
044: * @see SessionEventManager#addListener(SessionEventListener)
045: * @see SessionEventListener
046: * @see SessionEvent
047: */
048: public abstract class SessionEventAdapter implements
049: SessionEventListener {
050:
051: /**
052: * PUBLIC:
053: * This event is raised on the session if a descriptor is missing for a class being persisted.
054: * This can be used to lazy register the descriptor or set of descriptors.
055: */
056: public void missingDescriptor(SessionEvent event) {
057: }
058:
059: /**
060: * PUBLIC:
061: * This event is raised on the session after read object query detected more than a single row back from the database.
062: * The "result" of the event will be the call. Some applications may want to interpret this as an error or warning condition.
063: */
064: public void moreRowsDetected(SessionEvent event) {
065: }
066:
067: /**
068: * PUBLIC:
069: * This event is raised on the session after update or delete SQL has been sent to the database
070: * but a row count of zero was returned.
071: */
072: public void noRowsModified(SessionEvent event) {
073: }
074:
075: /**
076: * PUBLIC:
077: * This event is raised on the session after a stored procedure call has been executed that had output parameters.
078: * If the proc was used to override an insert/update/delete operation then TopLink will not be expecting any return value.
079: * This event mechanism allows for a listner to be registered before the proc is call to process the output values.
080: * The event "result" will contain a DatabaseRow of the output values, and property "call" will be the StoredProcedureCall.
081: */
082: public void outputParametersDetected(SessionEvent event) {
083: }
084:
085: /**
086: * PUBLIC:
087: * This event is raised on the client session after creation/acquiring.
088: */
089: public void postAcquireClientSession(SessionEvent event) {
090: }
091:
092: /**
093: * PUBLIC:
094: * This event is raised on when using the server/client sessions.
095: * This event is raised after a connection is acquired from a connection pool.
096: */
097: public void postAcquireConnection(SessionEvent event) {
098: }
099:
100: /**
101: * PUBLIC:
102: * This event is raised when a ClientSession, with Isolated data, acquires
103: * an exclusive connection.
104: */
105: public void postAcquireExclusiveConnection(SessionEvent event) {
106: }
107:
108: /**
109: * PUBLIC:
110: * This event is raised on the unit of work after creation/acquiring.
111: * This will be raised on nest units of work.
112: */
113: public void postAcquireUnitOfWork(SessionEvent event) {
114: }
115:
116: /**
117: * PUBLIC:
118: * This event is raised after a database transaction is started.
119: * It is not raised for nested transactions.
120: */
121: public void postBeginTransaction(SessionEvent event) {
122: }
123:
124: /**
125: * PUBLIC:
126: * This event is raised after the commit has begun on the UnitOfWork but before
127: * the changes are calculated.
128: */
129: public void preCalculateUnitOfWorkChangeSet(SessionEvent event) {
130: }
131:
132: /**
133: * PUBLIC:
134: * This event is raised after the commit has begun on the UnitOfWork and
135: * after the changes are calculated. The UnitOfWorkChangeSet, at this point,
136: * will contain changeSets without the version fields updated and without
137: * IdentityField type primary keys. These will be updated after the insert, or
138: * update, of the object
139: */
140: public void postCalculateUnitOfWorkChangeSet(SessionEvent event) {
141: }
142:
143: /**
144: * PUBLIC:
145: * This event is raised after a database transaction is commited.
146: * It is not raised for nested transactions.
147: */
148: public void postCommitTransaction(SessionEvent event) {
149: }
150:
151: /**
152: * PUBLIC:
153: * This event is raised on the unit of work after commit.
154: * This will be raised on nest units of work.
155: */
156: public void postCommitUnitOfWork(SessionEvent event) {
157: }
158:
159: /**
160: * PUBLIC:
161: * This even will be raised after a UnitOfWorkChangeSet has been merged
162: * When that changeSet has been received from a distributed session
163: */
164: public void postDistributedMergeUnitOfWorkChangeSet(
165: SessionEvent event) {
166: }
167:
168: /**
169: * PUBLIC:
170: * This even will be raised after a UnitOfWorkChangeSet has been merged
171: */
172: public void postMergeUnitOfWorkChangeSet(SessionEvent event) {
173: }
174:
175: /**
176: * PUBLIC:
177: * This event is raised after the session connects to the database.
178: * In a server session this event is raised on every new connection established.
179: */
180: public void postConnect(SessionEvent event) {
181: }
182:
183: /**
184: * PUBLIC:
185: * This event is raised after the execution of every query against the session.
186: * The event contains the query and query result.
187: */
188: public void postExecuteQuery(SessionEvent event) {
189: }
190:
191: /**
192: * PUBLIC:
193: * This event is raised on the client session after releasing.
194: */
195: public void postReleaseClientSession(SessionEvent event) {
196: }
197:
198: /**
199: * PUBLIC:
200: * This event is raised on the unit of work after release.
201: * This will be raised on nest units of work.
202: */
203: public void postReleaseUnitOfWork(SessionEvent event) {
204: }
205:
206: /**
207: * PUBLIC:
208: * This event is raised on the unit of work after resuming.
209: * This occurs after pre/postCommit.
210: */
211: public void postResumeUnitOfWork(SessionEvent event) {
212: }
213:
214: /**
215: * PUBLIC:
216: * This event is raised after a database transaction is rolledback.
217: * It is not raised for nested transactions.
218: */
219: public void postRollbackTransaction(SessionEvent event) {
220: }
221:
222: /**
223: * PUBLIC:
224: * This event is raised before a database transaction is started.
225: * It is not raised for nested transactions.
226: */
227: public void preBeginTransaction(SessionEvent event) {
228: }
229:
230: /**
231: * PUBLIC:
232: * This event is raised before a database transaction is commited.
233: * It is not raised for nested transactions.
234: */
235: public void preCommitTransaction(SessionEvent event) {
236: }
237:
238: /**
239: * PUBLIC:
240: * This event is raised on the unit of work before commit.
241: * This will be raised on nest units of work.
242: */
243: public void preCommitUnitOfWork(SessionEvent event) {
244: }
245:
246: /**
247: * PUBLIC:
248: * This event is raised before the execution of every query against the session.
249: * The event contains the query to be executed.
250: */
251: public void preExecuteQuery(SessionEvent event) {
252: }
253:
254: /**
255: * PUBLIC:
256: * This event is raised on the unit of work after the SQL has been flushed, but the commit transaction has not been executed.
257: * It is similar to the JTS prepare phase.
258: */
259: public void prepareUnitOfWork(SessionEvent event) {
260: }
261:
262: /**
263: * PUBLIC:
264: * This event is raised on the client session before releasing.
265: */
266: public void preReleaseClientSession(SessionEvent event) {
267: }
268:
269: /**
270: * PUBLIC:
271: * This event is raised on when using the server/client sessions.
272: * This event is raised before a connection is released into a connection pool.
273: */
274: public void preReleaseConnection(SessionEvent event) {
275: }
276:
277: /**
278: * PUBLIC:
279: * This event is fired just before a Client Session, with isolated data,
280: * releases its Exclusive Connection
281: */
282: public void preReleaseExclusiveConnection(SessionEvent event) {
283: }
284:
285: /**
286: * PUBLIC:
287: * This event is raised on the unit of work before release.
288: * This will be raised on nest units of work.
289: */
290: public void preReleaseUnitOfWork(SessionEvent event) {
291: }
292:
293: /**
294: * PUBLIC:
295: * This even will be raised before a UnitOfWorkChangeSet has been merged
296: * When that changeSet has been received from a distributed session
297: */
298: public void preDistributedMergeUnitOfWorkChangeSet(
299: SessionEvent event) {
300: }
301:
302: /**
303: * PUBLIC:
304: * This even will be raised before a UnitOfWorkChangeSet has been merged
305: */
306: public void preMergeUnitOfWorkChangeSet(SessionEvent event) {
307: }
308:
309: /**
310: * PUBLIC:
311: * This event is raised before a database transaction is rolledback.
312: * It is not raised for nested transactions.
313: */
314: public void preRollbackTransaction(SessionEvent event) {
315: }
316:
317: /**
318: * PUBLIC:
319: * This Event is raised before the session logs in.
320: */
321: public void preLogin(SessionEvent event) {
322: }
323:
324: /**
325: * PUBLIC:
326: * This Event is raised after the session logs in.
327: */
328: public void postLogin(SessionEvent event) {
329: }
330: }
|