1 17 18 19 package org.apache.naming; 20 21 import javax.naming.Context ; 22 import javax.naming.Reference ; 23 24 30 31 public class TransactionRef 32 extends Reference { 33 34 35 37 38 41 public static final String DEFAULT_FACTORY = 42 org.apache.naming.factory.Constants.DEFAULT_TRANSACTION_FACTORY; 43 44 45 47 48 51 public TransactionRef() { 52 this(null, null); 53 } 54 55 56 62 public TransactionRef(String factory, String factoryLocation) { 63 super("javax.transaction.UserTransaction", factory, factoryLocation); 64 } 65 66 67 69 70 72 73 77 public String getFactoryClassName() { 78 String factory = super.getFactoryClassName(); 79 if (factory != null) { 80 return factory; 81 } else { 82 factory = System.getProperty(Context.OBJECT_FACTORIES); 83 if (factory != null) { 84 return null; 85 } else { 86 return DEFAULT_FACTORY; 87 } 88 } 89 } 90 91 92 94 95 } 96 | Popular Tags |