01: /*
02: * $Id: TransactionConfig.java 10489 2008-01-23 17:53:38Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.api.transaction;
12:
13: import org.mule.transaction.constraints.ConstraintFilter;
14:
15: /**
16: * <code>TransactionConfig</code> defines transaction configuration for a
17: * transactional endpoint.
18: */
19: public interface TransactionConfig {
20: /** Whether there is a transaction available or not, ignore it */
21: byte ACTION_NONE = 0;
22:
23: /** Will ensure that a new transaction is created for each invocation */
24: byte ACTION_ALWAYS_BEGIN = 1;
25:
26: /** Will begin a new transaction if no transaction is already present */
27: byte ACTION_BEGIN_OR_JOIN = 2;
28:
29: /** There must always be a transaction present for the invocation */
30: byte ACTION_ALWAYS_JOIN = 3;
31:
32: /** If there is a transaction available, then use it, otherwise continue processing */
33: byte ACTION_JOIN_IF_POSSIBLE = 4;
34:
35: TransactionFactory getFactory();
36:
37: void setFactory(TransactionFactory factory);
38:
39: byte getAction();
40:
41: void setAction(byte action);
42:
43: boolean isTransacted();
44:
45: ConstraintFilter getConstraint();
46:
47: void setConstraint(ConstraintFilter constraint);
48:
49: void setTimeout(int timeout);
50:
51: int getTimeout();
52: }
|