1 25 26 28 package org.objectweb.jonas.jtests.beans.transacted; 29 30 import java.rmi.RemoteException ; 31 32 import javax.transaction.Status ; 33 import javax.transaction.UserTransaction ; 34 35 import org.objectweb.jonas.common.Log; 36 import org.objectweb.jonas.jtm.TransactionService; 37 import org.objectweb.jonas.service.ServiceManager; 38 import org.objectweb.util.monolog.api.BasicLevel; 39 import org.objectweb.util.monolog.api.Logger; 40 import org.objectweb.jonas.jtests.util.JBean; 41 42 45 public class SimpleCommon extends JBean { 46 47 static protected Logger logger = null; 48 49 52 protected void initLogger() { 53 if (logger == null) 54 logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); 55 } 56 57 61 public boolean opwith_notsupported() { 62 logger.log(BasicLevel.DEBUG, ""); 63 return isAssociated(); 64 } 65 66 70 public boolean opwith_supports() { 71 logger.log(BasicLevel.DEBUG, ""); 72 return isAssociated(); 73 } 74 75 79 public boolean opwith_required() { 80 logger.log(BasicLevel.DEBUG, ""); 81 return isAssociated(); 82 } 83 84 88 public boolean opwith_requires_new() { 89 logger.log(BasicLevel.DEBUG, ""); 90 return isAssociated(); 91 } 92 93 97 public boolean opwith_mandatory() { 98 logger.log(BasicLevel.DEBUG, ""); 99 return isAssociated(); 100 } 101 102 106 public boolean opwith_never() { 107 logger.log(BasicLevel.DEBUG, ""); 108 return isAssociated(); 109 } 110 111 114 public boolean required_call_requires_new() { 115 logger.log(BasicLevel.DEBUG, ""); 116 boolean tx = opwith_requires_new(); 117 if (!tx) { 118 logger.log(BasicLevel.ERROR, "opwith_requires_new was outside tx"); 119 return false; } 121 return isAssociated(); 122 } 123 124 127 public boolean call_requires_new_on(Simple other) throws RemoteException { 128 logger.log(BasicLevel.DEBUG, ""); 129 boolean tx = other.opwith_requires_new(); 130 if (!tx) { 131 logger.log(BasicLevel.ERROR, "opwith_requires_new was outside tx"); 132 return false; } 134 return isAssociated(); 135 } 136 137 } 138 | Popular Tags |