Skip to content

Package: TransactionSupport

TransactionSupport

Coverage

1: /*
2: * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Public License v. 2.0, which is available at
6: * http://www.eclipse.org/legal/epl-2.0.
7: *
8: * This Source Code may also be made available under the following Secondary
9: * Licenses when the conditions for such availability set forth in the
10: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11: * version 2 with the GNU Classpath Exception, which is available at
12: * https://www.gnu.org/software/classpath/license.html.
13: *
14: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15: */
16:
17: package jakarta.resource.spi;
18:
19: /**
20: * This interface may be optionally implemented by a
21: * <code>ManagedConnectionFactory</code> to provide its level of transaction
22: * support at runtime.
23: *
24: * <p>When a <code>ManagedConnectionFactory</code> implements this interface,
25: * the application server uses the <code>TransactionSupportLevel</code> returned
26: * by getTransactionSupport() method and not the value specified in the
27: * resource adapter deployment descriptor or deployer configuration
28: *
29: * @since 1.6
30: */
31: public interface TransactionSupport extends java.io.Serializable {
32:
33: /**
34: * An enumerated type that represents the levels of transaction support
35: * a resource adapter may support.
36: *
37: * @since 1.6
38: */
39: public enum TransactionSupportLevel {
40: /**
41: * The resource adapter supports neither resource manager nor Jakarta™ Transactions
42: * transactions.
43: * @since 1.6
44: */
45: NoTransaction,
46: /**
47: * The resource adapter supports resource manager local transactions
48: * by implementing the <code>LocalTransaction</code> interface.
49: * @since 1.6
50: */
51: LocalTransaction,
52: /**
53: * The resource adapter supports both resource manager local
54: * and Jakarta Transactions transactions by implementing the <code>LocalTransaction</code>
55: * and <code>XAResource</code> interfaces.
56: * @since 1.6
57: */
58: XATransaction
59: }
60:
61: /**
62: * Get the level of transaction support, supported by the
63: * <code>ManagedConnectionFactory</code>. A resource adapter must always
64: * return a level of transaction support whose ordinal value in
65: * <code>TransactionSupportLevel</code> enum is equal to or lesser than
66: * the resource adapter's transaction support classification.
67: * @return transaction support level
68: * @since 1.6
69: */
70: public TransactionSupportLevel getTransactionSupport();
71: }