KickJava   Java API By Example, From Geeks To Geeks.

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


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, 2006, Oracle. All rights reserved.
22
package oracle.toplink.essentials.sessions;
23
24 import java.util.*;
25 import java.io.*;
26 import oracle.toplink.essentials.descriptors.ClassDescriptor;
27 import oracle.toplink.essentials.expressions.*;
28 import oracle.toplink.essentials.queryframework.*;
29 import oracle.toplink.essentials.exceptions.*;
30 import oracle.toplink.essentials.logging.SessionLog;
31 import oracle.toplink.essentials.logging.SessionLogEntry;
32 import oracle.toplink.essentials.internal.databaseaccess.DatabasePlatform;
33 import oracle.toplink.essentials.internal.databaseaccess.Platform;
34
35 /**
36  * <p>
37  * <b>Purpose</b>: Define the TopLink session public interface.
38  * <p>
39  * <b>Description</b>: This interface is meant to clarify the public protocol into TopLink.
40  * It also allows for non-subclasses of Session to conform to the TopLink API.
41  * It should be used as the applications main interface into the TopLink API to
42  * ensure compatibility between all TopLink sessions.
43  * <p>
44  * <b>Responsibilities</b>:
45  * <ul>
46  * <li> Define the API for all reading, units of work.
47  * </ul>
48  * @see UnitOfWork
49  * @see DatabaseSession
50  * @see oracle.toplink.essentials.publicinterface.Session
51  * @see oracle.toplink.essentials.publicinterface.DatabaseSession
52  * @see oracle.toplink.essentials.threetier.ServerSession
53  * @see oracle.toplink.essentials.threetier.ClientSession
54  */

55 public interface Session {
56
57     /**
58      * PUBLIC:
59      * Return a unit of work for this session.
60      * The unit of work is an object level transaction that allows
61      * a group of changes to be applied as a unit.
62      * The return value should be used as the oracle.toplink.essentials.sessions.UnitOfWork interface,
63      * but must currently be returned as oracle.toplink.essentials.publicinterface.UnitOfWork to maintain backward
64      * compatibility.
65      *
66      * @see UnitOfWork
67      */

68     public UnitOfWork acquireUnitOfWork();
69
70     /**
71      * PUBLIC:
72      * Add the query to the session queries with the given name.
73      * This allows for common queries to be pre-defined, reused and executed by name.
74      */

75     public void addQuery(String JavaDoc name, DatabaseQuery query);
76     
77     /**
78      * ADVANCED:
79      * Add a pre-defined not yet parsed EJBQL String/query to the session to be parsed
80      * after descriptors are initialized.
81      * @see #getAllQueries()
82      */

83     public void addEjbqlPlaceHolderQuery(DatabaseQuery query);
84
85     /**
86      * PUBLIC:
87      * clear the integrityChecker, the integrityChecker holds all the Descriptor Exceptions.
88      */

89     public void clearIntegrityChecker();
90
91     /**
92      * PUBLIC:
93      * Clear the profiler, this will end the current profile opperation.
94      */

95     public void clearProfile();
96
97     /**
98      * PUBLIC:
99      * Return true if the pre-defined query is defined on the session.
100      **/

101     public boolean containsQuery(String JavaDoc queryName);
102
103     /**
104      * PUBLIC:
105      * Return a complete copy of the object.
106      * This can be used to obtain a scatch copy of an object,
107      * or for templatizing an existing object into another new object.
108      * The object and all of its privately owned parts will be copied, the object's primary key will be reset to null.
109      *
110      * @see #copyObject(Object, ObjectCopyingPolicy)
111      */

112     public Object JavaDoc copyObject(Object JavaDoc original);
113
114     /**
115      * PUBLIC:
116      * Return a complete copy of the object.
117      * This can be used to obtain a scatch copy of an object,
118      * or for templatizing an existing object into another new object.
119      * The object copying policy allow for the depth, and reseting of the primary key to null, to be specified.
120      */

121     public Object JavaDoc copyObject(Object JavaDoc original, ObjectCopyingPolicy policy);
122
123     /**
124      * PUBLIC:
125      * Return if the object exists on the database or not.
126      * This always checks existence on the database.
127      */

128     public boolean doesObjectExist(Object JavaDoc object) throws DatabaseException;
129
130     /**
131      * PUBLIC:
132      * Turn off logging
133      */

134     public void dontLogMessages();
135
136     /**
137      * PUBLIC:
138      * Execute the call on the database.
139      * The row count is returned.
140      * The call can be a stored procedure call, SQL call or other type of call.
141      * <p>Example:
142      * <p>session.executeNonSelectingCall(new SQLCall("Delete from Employee");
143      *
144      * @see #executeSelectingCall(Call)
145      */

146     public int executeNonSelectingCall(Call call);
147
148     /**
149      * PUBLIC:
150      * Execute the non-selecting (update/DML) SQL string.
151      */

152     public void executeNonSelectingSQL(String JavaDoc sqlString);
153
154     /**
155      * PUBLIC:
156      * Execute the pre-defined query by name and return the result.
157      * Queries can be pre-defined and named to allow for their reuse.
158      *
159      * @see #addQuery(String, DatabaseQuery)
160      */

161     public Object JavaDoc executeQuery(String JavaDoc queryName);
162
163     /**
164      * PUBLIC:
165      * Execute the pre-defined query by name and return the result.
166      * Queries can be pre-defined and named to allow for their reuse.
167      * The class is the descriptor in which the query was pre-defined.
168      *
169      * @see oracle.toplink.essentials.descriptors.DescriptorQueryManager#addQuery(String, DatabaseQuery)
170      */

171     public Object JavaDoc executeQuery(String JavaDoc queryName, Class JavaDoc domainClass);
172
173     /**
174      * PUBLIC:
175      * Execute the pre-defined query by name and return the result.
176      * Queries can be pre-defined and named to allow for their reuse.
177      * The class is the descriptor in which the query was pre-defined.
178      *
179      * @see oracle.toplink.essentials.descriptors.DescriptorQueryManager#addQuery(String, DatabaseQuery)
180      */

181     public Object JavaDoc executeQuery(String JavaDoc queryName, Class JavaDoc domainClass, Object JavaDoc arg1);
182
183     /**
184      * PUBLIC:
185      * Execute the pre-defined query by name and return the result.
186      * Queries can be pre-defined and named to allow for their reuse.
187      * The class is the descriptor in which the query was pre-defined.
188      *
189      * @see oracle.toplink.essentials.descriptors.DescriptorQueryManager#addQuery(String, DatabaseQuery)
190      */

191     public Object JavaDoc executeQuery(String JavaDoc queryName, Class JavaDoc domainClass, Object JavaDoc arg1, Object JavaDoc arg2);
192
193     /**
194      * PUBLIC:
195      * Execute the pre-defined query by name and return the result.
196      * Queries can be pre-defined and named to allow for their reuse.
197      * The class is the descriptor in which the query was pre-defined.
198      *
199      * @see oracle.toplink.essentials.descriptors.DescriptorQueryManager#addQuery(String, DatabaseQuery)
200      */

201     public Object JavaDoc executeQuery(String JavaDoc queryName, Class JavaDoc domainClass, Object JavaDoc arg1, Object JavaDoc arg2, Object JavaDoc arg3);
202
203     /**
204      * PUBLIC:
205      * Execute the pre-defined query by name and return the result.
206      * Queries can be pre-defined and named to allow for their reuse.
207      * The class is the descriptor in which the query was pre-defined.
208      *
209      * @see oracle.toplink.essentials.descriptors.DescriptorQueryManager#addQuery(String, DatabaseQuery)
210      */

211     public Object JavaDoc executeQuery(String JavaDoc queryName, Class JavaDoc domainClass, Vector argumentValues);
212
213     /**
214      * PUBLIC:
215      * Execute the pre-defined query by name and return the result.
216      * Queries can be pre-defined and named to allow for their reuse.
217      *
218      * @see #addQuery(String, DatabaseQuery)
219      */

220     public Object JavaDoc executeQuery(String JavaDoc queryName, Object JavaDoc arg1);
221
222     /**
223      * PUBLIC:
224      * Execute the pre-defined query by name and return the result.
225      * Queries can be pre-defined and named to allow for their reuse.
226      *
227      * @see #addQuery(String, DatabaseQuery)
228      */

229     public Object JavaDoc executeQuery(String JavaDoc queryName, Object JavaDoc arg1, Object JavaDoc arg2);
230
231     /**
232      * PUBLIC:
233      * Execute the pre-defined query by name and return the result.
234      * Queries can be pre-defined and named to allow for their reuse.
235      *
236      * @see #addQuery(String, DatabaseQuery)
237      */

238     public Object JavaDoc executeQuery(String JavaDoc queryName, Object JavaDoc arg1, Object JavaDoc arg2, Object JavaDoc arg3);
239
240     /**
241      * PUBLIC:
242      * Execute the pre-defined query by name and return the result.
243      * Queries can be pre-defined and named to allow for their reuse.
244      *
245      * @see #addQuery(String, DatabaseQuery)
246      */

247     public Object JavaDoc executeQuery(String JavaDoc queryName, Vector argumentValues);
248
249     /**
250      * PUBLIC:
251      * Execute the database query.
252      * A query is a database operation such as reading or writting.
253      * The query allows for the operation to be customized for such things as,
254      * performance, depth, caching, etc.
255      *
256      * @see DatabaseQuery
257      */

258     public Object JavaDoc executeQuery(DatabaseQuery query) throws TopLinkException;
259
260     /**
261      * PUBLIC:
262      * Return the results from exeucting the database query.
263      * the arguments are passed in as a vector
264      */

265     public Object JavaDoc executeQuery(DatabaseQuery query, Vector argumentValues);
266
267     /**
268      * PUBLIC:
269      * Execute the call on the database and return the result.
270      * The call must return a value, if no value is return executeNonSelectCall must be used.
271      * The call can be a stored procedure call, SQL call or other type of call.
272      * A vector of database rows is returned, database row implements Java 2 Map which should be used to access the data.
273      * <p>Example:
274      * <p>session.executeSelectingCall(new SQLCall("Select * from Employee");
275      *
276      * @see #executeNonSelectingCall(Call)
277      */

278     public Vector executeSelectingCall(Call call);
279
280     /**
281      * PUBLIC:
282      * Execute the selecting SQL string.
283      * A Vector of DatabaseRecords are returned.
284      */

285     public Vector executeSQL(String JavaDoc sqlString);
286
287     /**
288      * PUBLIC:
289      * Return the active session for the current active external (JTS) transaction.
290      * This should only be used with JTS and will return the session if no external transaction exists.
291      */

292     public Session getActiveSession();
293
294     /**
295      * PUBLIC:
296      * Return the active unit of work for the current active external (JTS) transaction.
297      * This should only be used with JTS and will return null if no external transaction exists.
298      */

299     public UnitOfWork getActiveUnitOfWork();
300
301     /**
302      * ADVANCED:
303      * Return the descriptor specified for the class.
304      * If the class does not have a descriptor but implements an interface that is also implemented
305      * by one of the classes stored in the hashtable, that descriptor will be stored under the
306      * new class.
307      */

308     public ClassDescriptor getClassDescriptor(Class JavaDoc theClass);
309
310     /**
311      * ADVANCED:
312      * Return the descriptor specified for the object's class.
313      */

314     public ClassDescriptor getClassDescriptor(Object JavaDoc domainObject);
315
316     /**
317      * PUBLIC:
318      * Return the descriptor for the alias.
319      */

320     public ClassDescriptor getClassDescriptorForAlias(String JavaDoc alias);
321
322     /**
323      * ADVANCED:
324      * Return the descriptor specified for the object's class.
325      */

326     public ClassDescriptor getDescriptor(Class JavaDoc theClass);
327
328     /**
329      * ADVANCED:
330      * Return the descriptor specified for the object's class.
331      */

332     public ClassDescriptor getDescriptor(Object JavaDoc domainObject);
333
334     /**
335      * PUBLIC:
336      * Return the descriptor for the alias.
337      */

338     public ClassDescriptor getDescriptorForAlias(String JavaDoc alias);
339
340     /**
341      * ADVANCED:
342      * Return all registered descriptors.
343      */

344     public Map getDescriptors();
345
346     /**
347      * ADVANCED:
348      * Return all pre-defined not yet parsed EJBQL queries.
349      * @see #getAllQueries()
350      */

351     public List getEjbqlPlaceHolderQueries();
352     
353     /**
354      * PUBLIC:
355      * Return the event manager.
356      * The event manager can be used to register for various session events.
357      */

358     public SessionEventManager getEventManager();
359
360     /**
361      * PUBLIC:
362      * Return the ExceptionHandler.Exception handler can catch errors that occur on queries or during database access.
363      */

364     public ExceptionHandler getExceptionHandler();
365
366     /**
367      * PUBLIC:
368      * Used for JTS integration. If your application requires to have JTS control transactions instead of TopLink an
369      * external transaction controler must be specified. TopLink provides JTS controlers for JTS 1.0 and Weblogic's JTS.
370      * @see oracle.toplink.essentials.transaction.JTATransactionController
371      */

372     public ExternalTransactionController getExternalTransactionController();
373
374     /**
375      * PUBLIC:
376      * The IdentityMapAccessor is the preferred way of accessing IdentityMap funcitons
377      * This will return an object which implements an interface which exposes all public
378      * IdentityMap functions.
379      */

380     public IdentityMapAccessor getIdentityMapAccessor();
381
382     /**
383      * PUBLIC:
384      * Returns the integrityChecker,the integrityChecker holds all the Descriptor Exceptions.
385      */

386     public IntegrityChecker getIntegrityChecker();
387
388     /**
389      * PUBLIC:
390      * Return the writer to which an accessor writes logged messages and SQL.
391      * If not set, this reference defaults to a writer on System.out.
392      */

393     public Writer getLog();
394
395     /**
396      * PUBLIC:
397      * Return the database platform currently connected to.
398      * The platform is used for database specific behavoir.
399      * NOTE: this must only be used for relational specific usage,
400      * it will fail for non-relational datasources.
401      */

402     public DatabasePlatform getPlatform();
403
404     /**
405      * PUBLIC:
406      * Return the database platform currently connected to.
407      * The platform is used for database specific behavoir.
408      */

409     public Platform getDatasourcePlatform();
410         
411     /**
412      * PUBLIC:
413      * Return the login, the login holds any database connection information given.
414      * This has been replaced by getDatasourceLogin to make use of the Login interface
415      * to support non-relational datasources,
416      * if DatabaseLogin API is required it will need to be cast.
417      */

418     public DatabaseLogin getLogin();
419
420     /**
421      * PUBLIC:
422      * Return the login, the login holds any database connection information given.
423      * This return the Login interface and may need to be cast to the datasource specific implementation.
424      */

425     public Login getDatasourceLogin();
426
427     /**
428      * PUBLIC:
429      * Return the name of the session.
430      * This is used with the session broker, or to give the session a more meaningful name.
431      */

432     public String JavaDoc getName();
433
434     /**
435      * ADVANCED:
436      * Return the sequnce number from the database
437      */

438     public Number JavaDoc getNextSequenceNumberValue(Class JavaDoc domainClass);
439
440     /**
441      * PUBLIC:
442      * Return the profiler.
443      * The profiler is a tool that can be used to determine performance bottlenecks.
444      * The profiler can be queries to print summaries and configure for logging purposes.
445      */

446     public SessionProfiler getProfiler();
447
448     /**
449      * PUBLIC:
450      * Return the project.
451      * The project includes the login and descriptor and other configuration information.
452      */

453     public oracle.toplink.essentials.sessions.Project getProject();
454
455     /**
456      * ADVANCED:
457      * Allow for user defined properties.
458      */

459     public Map getProperties();
460
461     /**
462      * ADVANCED:
463      * Returns the user defined property.
464      */

465     public Object JavaDoc getProperty(String JavaDoc name);
466
467     /**
468      * ADVANCED:
469      * Return all pre-defined queries.
470      */

471     public Map getQueries();
472
473     /**
474      * PUBLIC:
475      * Return the query from the session pre-defined queries with the given name.
476      * This allows for common queries to be pre-defined, reused and executed by name.
477      */

478     public DatabaseQuery getQuery(String JavaDoc name);
479
480     /**
481      * PUBLIC:
482      * Return the query from the session pre-defined queries with the given name.
483      * This allows for common queries to be pre-defined, reused and executed by name.
484      */

485     public DatabaseQuery getQuery(String JavaDoc name, Vector arguments);
486
487     /**
488      * PUBLIC:
489      * Return the session log to which an accessor logs messages and SQL.
490      * If not set, this will default to a session log on a writer on System.out.
491      */

492     public SessionLog getSessionLog();
493
494     /**
495      * PUBLIC:
496      * Allow any WARNING level exceptions that occur within TopLink to be logged and handled by the exception handler.
497      */

498     public Object JavaDoc handleException(RuntimeException JavaDoc exception) throws RuntimeException JavaDoc;
499
500     /**
501      * ADVANCED:
502      * Return true if a descriptor exists for the given class.
503      */

504     public boolean hasDescriptor(Class JavaDoc theClass);
505
506     /**
507      * PUBLIC:
508      * Return if an exception handler is present.
509      */

510     public boolean hasExceptionHandler();
511
512     /**
513      * PUBLIC:
514      * Used for JTS integration. If your application requires to have JTS control transactions instead of TopLink an
515      * external transaction controler must be specified. TopLink provides JTS controlers for JTS 1.0 and Weblogic's JTS.
516      * @see oracle.toplink.essentials.transaction.JTATransactionController
517      */

518     public boolean hasExternalTransactionController();
519
520     /**
521      * PUBLIC:
522      * Return if this session is a client session.
523      */

524     public boolean isClientSession();
525
526     /**
527      * PUBLIC:
528      * Return if this session is connected to the database.
529      */

530     public boolean isConnected();
531
532     /**
533      * PUBLIC:
534      * Return if this session is a database session.
535      */

536     public boolean isDatabaseSession();
537
538     /**
539      * PUBLIC:
540      * Return if this session is a distributed session.
541      */

542     public boolean isDistributedSession();
543
544     /**
545      * PUBLIC:
546      * Return if a profiler is being used.
547      */

548     public boolean isInProfile();
549
550     /**
551      * PUBLIC:
552      * Return if this session is a remote session.
553      */

554     public boolean isRemoteSession();
555
556     /**
557      * PUBLIC:
558      * Return if this session is a server session.
559      */

560     public boolean isServerSession();
561
562     /**
563      * PUBLIC:
564      * Return if this session is a session broker.
565      */

566     public boolean isSessionBroker();
567
568     /**
569      * PUBLIC:
570      * Return if this session is a unit of work.
571      */

572     public boolean isUnitOfWork();
573
574     /**
575      * PUBLIC:
576      * Return if this session is a remote unit of work.
577      */

578     public boolean isRemoteUnitOfWork();
579     
580     /**
581      * ADVANCED:
582      * Extract and return the primary key from the object.
583      */

584     public Vector keyFromObject(Object JavaDoc domainObject) throws ValidationException;
585
586     /**
587      * PUBLIC:
588      * Log the log entry.
589      */

590     public void log(SessionLogEntry entry);
591
592     /**
593      * Log a untranslated message to the TopLink log at FINER level.
594      */

595     public void logMessage(String JavaDoc message);
596     
597     /**
598      * PUBLIC:
599      * <p>
600      * Log a message with level and category.
601      * </p><p>
602      *
603      * @param level, the log request level value
604      * </p><p>
605      * @param message, the string message
606      * </p><p>
607      * @param category, the string representation of a TopLink category.
608      * </p>
609      */

610     public void log(int level, String JavaDoc category, String JavaDoc message);
611
612     /**
613      * PUBLIC:
614      * <p>
615      * Log a throwable with level and category.
616      * </p><p>
617      *
618      * @param level, the log request level value
619      * </p><p>
620      * @param category, the string representation of a TopLink category.
621      * </p><p>
622      * @param throwable, a Throwable
623      * </p>
624      */

625     public void logThrowable(int level, String JavaDoc category, Throwable JavaDoc throwable);
626
627     /**
628      * PUBLIC:
629      * Read all of the instances of the class from the database.
630      * This operation can be customized through using a ReadAllQuery,
631      * or through also passing in a selection criteria.
632      *
633      * @see ReadAllQuery
634      * @see #readAllObjects(Class, Expression)
635      */

636     public Vector readAllObjects(Class JavaDoc domainClass) throws DatabaseException;
637
638     /**
639      * PUBLIC:
640      * Read all the instances of the class from the database returned through execution the Call string.
641      * The Call can be an SQLCall or EJBQLCall.
642      *
643      * example: session.readAllObjects(Employee.class, new SQLCall("SELECT * FROM EMPLOYEE"));
644      * @see SQLCall
645      * @see EJBQLCall
646      */

647     public Vector readAllObjects(Class JavaDoc domainClass, Call aCall) throws DatabaseException;
648
649     /**
650      * PUBLIC:
651      * Read all of the instances of the class from the database matching the given expression.
652      * This operation can be customized through using a ReadAllQuery.
653      *
654      * @see ReadAllQuery
655      */

656     public Vector readAllObjects(Class JavaDoc domainClass, Expression selectionCriteria) throws DatabaseException;
657
658     /**
659      * PUBLIC:
660      * Read the first instance of the class from the database.
661      * This operation can be customized through using a ReadObjectQuery,
662      * or through also passing in a selection criteria.
663      * By default, this method executes a query without selection criteria and
664      * consequently it will always result in a database access even if an instance
665      * of the specified Class exists in the cache. Executing a query with
666      * selection criteria allows you to avoid a database access if the selected
667      * instance is in the cache.
668      * Because of this, you may whish to consider a readObject method that takes selection criteria, such as: {@link #readObject(Class, Call)}, {@link #readObject(Class, Expression)}, or {@link #readObject(Object)}.
669      * @see ReadObjectQuery
670      * @see #readAllObjects(Class, Expression)
671      */

672     public Object JavaDoc readObject(Class JavaDoc domainClass) throws DatabaseException;
673
674     /**
675      * PUBLIC:
676      * Read the first instance of the class from the database returned through execution the Call string.
677      * The Call can be an SQLCall or EJBQLCall.
678      *
679      * example: session.readObject(Employee.class, new SQLCall("SELECT * FROM EMPLOYEE"));
680      * @see SQLCall
681      * @see EJBQLCall
682      */

683     public Object JavaDoc readObject(Class JavaDoc domainClass, Call aCall) throws DatabaseException;
684
685     /**
686      * PUBLIC:
687      * Read the first instance of the class from the database matching the given expression.
688      * This operation can be customized through using a ReadObjectQuery.
689      *
690      * @see ReadObjectQuery
691      */

692     public Object JavaDoc readObject(Class JavaDoc domainClass, Expression selectionCriteria) throws DatabaseException;
693
694     /**
695      * PUBLIC:
696      * Use the example object to consruct a read object query by the objects primary key.
697      * This will read the object from the database with the same primary key as the object
698      * or null if no object is found.
699      */

700     public Object JavaDoc readObject(Object JavaDoc object) throws DatabaseException;
701
702     /**
703      * PUBLIC:
704      * Refresh the attributes of the object and of all of its private parts from the database.
705      * This can be used to ensure the object is up to date with the database.
706      * Caution should be used when using this to make sure the application has no un commited
707      * changes to the object.
708      */

709     public Object JavaDoc refreshObject(Object JavaDoc object);
710
711     /**
712      * PUBLIC:
713      * Release the session.
714      * This does nothing by default, but allows for other sessions such as the ClientSession to do something.
715      */

716     public void release();
717
718     /**
719      * PUBLIC:
720      * Remove the user defined property.
721      */

722     public void removeProperty(String JavaDoc property);
723
724     /**
725      * PUBLIC:
726      * Remove the query name from the set of pre-defined queries
727      */

728     public void removeQuery(String JavaDoc queryName);
729
730     /**
731      * PUBLIC:
732      * Set the exceptionHandler.
733      * Exception handler can catch errors that occur on queries or during database access.
734      */

735     public void setExceptionHandler(ExceptionHandler exceptionHandler);
736
737     /**
738      * Set the transaction controller, allow integration with JTA.
739      */

740     public void setExternalTransactionController(ExternalTransactionController externalTransactionController);
741
742     /**
743      * PUBLIC:
744      * Set the integrityChecker, the integrityChecker holds all the Descriptor Exceptions.
745      */

746     public void setIntegrityChecker(IntegrityChecker integrityChecker);
747
748     /**
749      * PUBLIC:
750      * Set the writer to which an accessor writes logged messages and SQL.
751      * If not set, this reference defaults to a writer on System.out.
752      */

753     public void setLog(Writer log);
754
755     /**
756      * PUBLIC:
757      * Set the name of the session.
758      * This is used with the session broker, or to give the session a more meaningful name.
759      */

760     public void setName(String JavaDoc name);
761
762     /**
763      * PUBLIC:
764      * Set the profiler for the session.
765      * This allows for performance operations to be profiled.
766      */

767     public void setProfiler(SessionProfiler profiler);
768
769     /**
770      * PUBLIC:
771      * Allow for user defined properties.
772      */

773     public void setProperty(String JavaDoc propertyName, Object JavaDoc propertyValue);
774
775     /**
776      * PUBLIC:
777      * Set the session log to which an accessor logs messages and SQL.
778      * If not set, this will default to a session log on a writer on System.out.
779      * To enable logging, logMessages must be turned on.
780      */

781     public void setSessionLog(SessionLog sessionLog);
782
783     /**
784      * PUBLIC:
785      * Return if logging is enabled (false if log level is OFF)
786      */

787     public boolean shouldLogMessages();
788
789     /**
790      * PUBLIC:
791      * Return the log level
792      */

793     public int getLogLevel(String JavaDoc category);
794
795     /**
796      * PUBLIC:
797      * Return the log level
798      */

799     public int getLogLevel();
800
801     /**
802      * PUBLIC:
803      * Set the log level
804      */

805     public void setLogLevel(int level);
806
807     /**
808      * PUBLIC:
809      * Check if a message of the given level would actually be logged.
810      */

811     public boolean shouldLog(int Level, String JavaDoc category);
812
813     /**
814      * PUBLIC:
815      * Allow any SEVERE level exceptions that occur within TopLink to be logged and handled by the exception handler.
816      */

817     public Object JavaDoc handleSevere(RuntimeException JavaDoc exception) throws RuntimeException JavaDoc;
818 }
819
Popular Tags