1 /* 2 * $Id: TransactionConfig.java 22654 2011-08-12 07:32:57Z mike.schilling $ 3 * -------------------------------------------------------------------------------------- 4 * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com 5 * 6 * The software in this package is published under the terms of the CPAL v1.0 7 * license, a copy of which has been included with this distribution in the 8 * LICENSE.txt file. 9 */ 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 { 21 /** 22 * Whether there is a transaction available or not, ignore it 23 * <p> 24 * J2EE: NotSupported 25 */ 26 byte ACTION_NONE = 0; 27 28 /** 29 * Will ensure that a new transaction is created for each invocation 30 * <p> 31 * J2EE RequiresNew 32 */ 33 byte ACTION_ALWAYS_BEGIN = 1; 34 35 /** 36 * Will begin a new transaction if no transaction is already present 37 * <p> 38 * J2EE: Required 39 */ 40 byte ACTION_BEGIN_OR_JOIN = 2; 41 42 /** 43 * There must always be a transaction present for the invocation 44 * <p> 45 * J2EE: Mandatory 46 */ 47 byte ACTION_ALWAYS_JOIN = 3; 48 49 /** 50 * If there is a transaction available, then use it, otherwise continue processing 51 * <p> 52 * J2EE: Supports 53 */ 54 byte ACTION_JOIN_IF_POSSIBLE = 4; 55 56 /** 57 * There must not be a transaction present for the invocation 58 * <p> 59 * J2EE Never 60 */ 61 byte ACTION_NEVER = 5; 62 63 /** 64 * Be indifferent to any active transaction. Don;t check for one, and if there is one, don;t commit or abort it 65 * <p> 66 */ 67 byte ACTION_INDIFFERENT = 6; 68 69 /** 70 * Transaction action by default. Note that before 3.2 it was ACTION_NONE 71 * <p> 72 */ 73 byte ACTION_DEFAULT = ACTION_INDIFFERENT; 74 75 TransactionFactory getFactory(); 76 77 void setFactory(TransactionFactory factory); 78 79 byte getAction(); 80 81 void setAction(byte action); 82 83 boolean isTransacted(); 84 85 ConstraintFilter getConstraint(); 86 87 void setConstraint(ConstraintFilter constraint); 88 89 void setTimeout(int timeout); 90 91 int getTimeout(); 92 93 boolean isInteractWithExternal(); 94 95 void setInteractWithExternal(boolean interactWithExternal); 96 97 boolean isConfigured(); 98 }