01: package org.mockejb;
02:
03: import java.io.Serializable;
04:
05: /**
06: * Enumeration of possible values of the transaction attribute (transaction
07: * policy) as per EJB spec.
08: * <br>Used for setting the policy by calling <code>MockEjbObject.setTransactionPolicy()</code>
09: *
10: * @author Alexander Ananiev
11: */
12: public class TransactionPolicy implements Serializable {
13:
14: private final String name;
15:
16: private TransactionPolicy(String name) {
17: this .name = name;
18: }
19:
20: public String toString() {
21: return this .name;
22: }
23:
24: public static final TransactionPolicy SUPPORTS = new TransactionPolicy(
25: "Supports");
26:
27: public static final TransactionPolicy REQUIRED = new TransactionPolicy(
28: "Required");
29:
30: public static final TransactionPolicy REQUIRED_NEW = new TransactionPolicy(
31: "RequiredNew");
32:
33: public static final TransactionPolicy NOT_SUPPORTED = new TransactionPolicy(
34: "NotSupported");
35:
36: public static final TransactionPolicy NEVER = new TransactionPolicy(
37: "Never");
38:
39: public static final TransactionPolicy MANDATORY = new TransactionPolicy(
40: "Mandatory");
41:
42: }
|