1 /* 2 * $Id: UMOTransactionConfig.java 10524 2008-01-24 19:20:11Z akuzmin $ 3 * -------------------------------------------------------------------------------------- 4 * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.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.umo; 12 13 import org.mule.transaction.constraints.ConstraintFilter; 14 15 /** 16 * <code>UMOTransactionConfig</code> defines transaction configuration for a 17 * transactional endpoint. 18 */ 19 public interface UMOTransactionConfig 20 { 21 /** 22 * Whether there is a transaction available or not, ignore it 23 */ 24 byte ACTION_NONE = 0; 25 26 /** 27 * Will ensure that a new transaction is created for each invocation 28 */ 29 byte ACTION_ALWAYS_BEGIN = 1; 30 31 /** 32 * Will begin a new transaction if no transaction is already present 33 */ 34 byte ACTION_BEGIN_OR_JOIN = 2; 35 36 /** 37 * There must always be a transaction present for the invocation 38 */ 39 byte ACTION_ALWAYS_JOIN = 3; 40 41 /** 42 * If there is a transaction available, then use it, otherwise continue processing 43 */ 44 byte ACTION_JOIN_IF_POSSIBLE = 4; 45 46 UMOTransactionFactory getFactory(); 47 48 void setFactory(UMOTransactionFactory factory); 49 50 byte getAction(); 51 52 void setAction(byte action); 53 54 boolean isTransacted(); 55 56 ConstraintFilter getConstraint(); 57 58 void setConstraint(ConstraintFilter constraint); 59 60 void setTimeout(int timeout); 61 62 int getTimeout(); 63 64 /** 65 * There is a need to separate ACTION_NONE with TransactionFactory and 66 * not initialized transaction config (factory was not sed) 67 * 68 * @return true if transaction factory is set 69 */ 70 boolean isConfigured(); 71 72 }