KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > platform > server > CustomServerPlatform


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.platform.server;
23
24 import oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl;
25 import oracle.toplink.essentials.platform.server.ServerPlatformBase;
26
27 /**
28  * INTERNAL:
29  *
30  * This is the concrete subclass responsible for handling backward compatibility for 9.0.4.
31  *
32  * This platform overrides:
33  *
34  * getExternalTransactionControllerClass(): to use a user-specified controller class
35  *
36  * This platform adds:
37  *
38  * setExternalTransactionControllerClass(Class newClass): to allow the user to define
39  * the external transaction controller when the 904 sessions.xml defines an
40  * external-transaction-controller-class.
41  *
42  */

43 public final class CustomServerPlatform extends ServerPlatformBase {
44
45     /**
46      * INTERNAL:
47      * Default Constructor: JTA is disabled until a transaction controller class is set.
48        * Runtime services are disabled.
49      */

50     public CustomServerPlatform(DatabaseSessionImpl newDatabaseSession) {
51         super(newDatabaseSession);
52         this.disableRuntimeServices();
53     }
54
55     /**
56      * INTERNAL: getExternalTransactionControllerClass(): Answer the class of external transaction controller to use
57      * in the DatabaseSession
58      * This is defined by the user via the 904 sessions.xml.
59      *
60      * @return Class externalTransactionControllerClass
61      *
62      * @see oracle.toplink.essentials.transaction.JTATransactionController
63      * @see #isJTAEnabled()
64      * @see #disableJTA()
65      * @see #initializeExternalTransactionController()
66      */

67     public Class JavaDoc getExternalTransactionControllerClass() {
68         return externalTransactionControllerClass;
69     }
70
71     /**
72      * INTERNAL: externalTransactionControllerNotNullWarning():
73        * When the external transaction controller is being initialized, we warn the developer
74        * if they have already defined the external transaction controller in some way other
75        * than subclassing ServerPlatformBase.
76        *
77        * This warning is omitted in 9.0.4.
78      *
79        * @see ServerPlatformBase
80      *
81      * @return void
82      *
83      */

84     protected void externalTransactionControllerNotNullWarning() {
85         //do nothing, because it would be really annoying to show a warning here
86
}
87 }
88
Popular Tags