1 43 package org.objectweb.jotm; 44 45 import javax.transaction.xa.Xid ; 47 48 57 public class InternalTransactionContext implements TransactionContext { 58 59 62 private int timeout; 63 64 67 private Coordinator coordinator; 68 69 72 private Terminator terminator; 73 74 77 private Xid xid; 78 79 82 private boolean isJotmCtx=true; 83 84 87 public InternalTransactionContext(int t, Coordinator c, Terminator term, Xid x) { 88 timeout = t; 89 coordinator = c; 90 terminator=term; 91 xid = x; 92 93 if (TraceTm.jta.isDebugEnabled()) { 94 TraceTm.jta.debug("xid=" + xid + ", timeout=" + timeout); 95 } 96 } 97 98 public InternalTransactionContext(int t, Coordinator c, Xid x) { 99 timeout = t; 100 coordinator = c; 101 terminator=(Terminator )c; 102 xid = x; 103 104 if (TraceTm.jta.isDebugEnabled()) { 105 TraceTm.jta.debug("xid=" + xid + ", timeout=" + timeout); 106 } 107 } 108 109 112 public int getTimeout() { 113 return timeout; 114 } 115 116 119 public Coordinator getCoordinator() { 120 return coordinator; 121 } 122 123 126 public void setCoordinator(Coordinator coord) { 127 this.coordinator = coord; 128 } 129 130 133 public Terminator getTerminator() { 134 return terminator ; 135 } 136 137 140 public void setTerminator(Terminator term) { 141 this.terminator = term; 142 } 143 144 147 public Control getControl() { 148 return (Control) coordinator; 149 } 150 151 154 public org.objectweb.jotm.Xid getXid() { 155 if (TraceTm.jta.isDebugEnabled()) { 156 TraceTm.jta.debug("xid=" + xid); 157 } 158 return (org.objectweb.jotm.Xid) xid; 159 } 160 161 166 public void setNotJotmCtx() { 167 isJotmCtx= false; 168 } 169 170 175 public boolean isJotmCtx() { 176 return isJotmCtx; 177 } 178 179 } 180 | Popular Tags |