Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
TransactionConfig |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com | |
3 | * The software in this package is published under the terms of the CPAL v1.0 | |
4 | * license, a copy of which has been included with this distribution in the | |
5 | * LICENSE.txt file. | |
6 | */ | |
7 | package org.mule.api.transaction; | |
8 | ||
9 | import org.mule.transaction.constraints.ConstraintFilter; | |
10 | ||
11 | /** | |
12 | * <code>TransactionConfig</code> defines transaction configuration for a | |
13 | * transactional endpoint. | |
14 | */ | |
15 | public interface TransactionConfig | |
16 | { | |
17 | /** | |
18 | * Whether there is a transaction available or not, ignore it | |
19 | * <p> | |
20 | * J2EE: NotSupported | |
21 | */ | |
22 | byte ACTION_NONE = 0; | |
23 | ||
24 | /** | |
25 | * Will ensure that a new transaction is created for each invocation | |
26 | * <p> | |
27 | * J2EE RequiresNew | |
28 | */ | |
29 | byte ACTION_ALWAYS_BEGIN = 1; | |
30 | ||
31 | /** | |
32 | * Will begin a new transaction if no transaction is already present | |
33 | * <p> | |
34 | * J2EE: Required | |
35 | */ | |
36 | byte ACTION_BEGIN_OR_JOIN = 2; | |
37 | ||
38 | /** | |
39 | * There must always be a transaction present for the invocation | |
40 | * <p> | |
41 | * J2EE: Mandatory | |
42 | */ | |
43 | byte ACTION_ALWAYS_JOIN = 3; | |
44 | ||
45 | /** | |
46 | * If there is a transaction available, then use it, otherwise continue processing | |
47 | * <p> | |
48 | * J2EE: Supports | |
49 | */ | |
50 | byte ACTION_JOIN_IF_POSSIBLE = 4; | |
51 | ||
52 | /** | |
53 | * There must not be a transaction present for the invocation | |
54 | * <p> | |
55 | * J2EE Never | |
56 | */ | |
57 | byte ACTION_NEVER = 5; | |
58 | ||
59 | /** | |
60 | * Transaction action by default | |
61 | * <p> | |
62 | */ | |
63 | byte ACTION_DEFAULT = ACTION_NEVER; | |
64 | ||
65 | TransactionFactory getFactory(); | |
66 | ||
67 | void setFactory(TransactionFactory factory); | |
68 | ||
69 | byte getAction(); | |
70 | ||
71 | void setAction(byte action); | |
72 | ||
73 | boolean isTransacted(); | |
74 | ||
75 | ConstraintFilter getConstraint(); | |
76 | ||
77 | void setConstraint(ConstraintFilter constraint); | |
78 | ||
79 | void setTimeout(int timeout); | |
80 | ||
81 | int getTimeout(); | |
82 | ||
83 | boolean isInteractWithExternal(); | |
84 | ||
85 | void setInteractWithExternal(boolean interactWithExternal); | |
86 | ||
87 | boolean isConfigured(); | |
88 | } |