1 22 package org.jboss.tm; 23 24 import javax.management.ObjectName ; 25 import javax.transaction.TransactionManager ; 26 27 import org.jboss.system.ServiceMBeanSupport; 28 import org.jboss.tm.integrity.TransactionIntegrityFactory; 29 import org.jboss.tm.recovery.RecoveryLogger; 30 import org.jboss.tm.recovery.RecoveryLoggerInstance; 31 32 45 public class TransactionManagerService 46 extends ServiceMBeanSupport 47 implements TransactionManagerServiceMBean 48 { 49 private ObjectName xidFactory; 50 51 private TransactionManagerInitializer initializer = new TransactionManagerInitializer(); 52 53 public static String JNDI_NAME = "java:/TransactionManager"; 55 public static String JNDI_IMPORTER = "java:/TransactionPropagationContextImporter"; 56 public static String JNDI_EXPORTER = "java:/TransactionPropagationContextExporter"; 57 58 protected void startService() 59 throws Exception 60 { 61 XidFactoryMBean xidFactoryObj = (XidFactoryMBean) getServer().getAttribute(xidFactory, "Instance"); 62 initializer.setXidFactory(xidFactoryObj); 63 initializer.start(); 64 } 65 66 protected void stopService() 67 { 68 initializer.stop(); 69 } 70 71 77 public void setRecoveryLogger(RecoveryLoggerInstance recoveryLogger) 78 { 79 initializer.setRecoveryLogger(recoveryLogger.getInstance()); 80 } 81 82 87 public void setTransactionIntegrityFactory(TransactionIntegrityFactory factory) 88 { 89 initializer.setTransactionIntegrityFactory(factory); 90 } 91 92 99 public ObjectName getXidFactory() 100 { 101 return xidFactory; 102 } 103 104 110 public void setXidFactory(ObjectName xidFactory) 111 { 112 this.xidFactory = xidFactory; 113 } 114 115 public void setRecoveryLogger(RecoveryLogger recoveryLogger) 116 { 117 initializer.setRecoveryLogger(recoveryLogger); 118 } 119 120 public boolean getGlobalIdsEnabled() 121 { 122 return initializer.getGlobalIdsEnabled(); 123 } 124 125 public void setGlobalIdsEnabled(boolean newValue) 126 { 127 initializer.setGlobalIdsEnabled(newValue); 128 } 129 130 public boolean isInterruptThreads() 131 { 132 return initializer.isInterruptThreads(); 133 } 134 135 public void setInterruptThreads(boolean interruptThreads) 136 { 137 initializer.setInterruptThreads(interruptThreads); 138 } 139 140 public int getTransactionTimeout() 141 { 142 return initializer.getTransactionTimeout(); 143 } 144 145 public void setTransactionTimeout(int timeout) 146 { 147 initializer.setTransactionTimeout(timeout); 148 } 149 150 public int getCompletionRetryLimit() 151 { 152 return initializer.getCompletionRetryLimit(); 153 } 154 155 public void setCompletionRetryLimit(int limit) 156 { 157 initializer.setCompletionRetryLimit(limit); 158 } 159 160 public int getCompletionRetryTimeout() 161 { 162 return initializer.getCompletionRetryTimeout(); 163 } 164 165 public void setCompletionRetryTimeout(int timeout) 166 { 167 initializer.setCompletionRetryTimeout(timeout); 168 } 169 170 public int getXARetryTimeout() 171 { 172 return initializer.getXARetryTimeout(); 173 } 174 175 public void setXARetryTimeout(int timeout) 176 { 177 initializer.setXARetryTimeout(timeout); 178 } 179 180 public int getPreparedTimeout() 181 { 182 return initializer.getPreparedTimeout(); 183 } 184 185 public void setPreparedTimeout(int timeout) 186 { 187 initializer.setPreparedTimeout(timeout); 188 } 189 190 public boolean isRootBranchRemembersHeuristicDecisions() 191 { 192 return initializer.isRootBranchRemembersHeuristicDecisions(); 193 } 194 195 public void setRootBranchRemembersHeuristicDecisions(boolean newValue) 196 { 197 initializer.setRootBranchRemembersHeuristicDecisions(newValue); 198 } 199 200 public boolean isReportHeuristicHazardAsHeuristicMixed() 201 { 202 return initializer.isReportHeuristicHazardAsHeuristicMixed(); 203 } 204 205 public void setReportHeuristicHazardAsHeuristicMixed(boolean newValue) 206 { 207 initializer.setReportHeuristicHazardAsHeuristicMixed(newValue); 208 } 209 210 public TransactionManager getTransactionManager() 211 { 212 return initializer.getTransactionManager(); 213 } 214 215 public JBossXATerminator getXATerminator() 216 { 217 return initializer.getXATerminator(); 218 } 219 220 public long getTransactionCount() 221 { 222 return initializer.getTransactionCount(); 223 } 224 225 public long getCommitCount() 226 { 227 return initializer.getCommitCount(); 228 } 229 230 public long getRollbackCount() 231 { 232 return initializer.getRollbackCount(); 233 } 234 235 public String listInDoubtTransactions() 236 { 237 return initializer.listInDoubtTransactions(); 238 } 239 240 public void heuristicallyCommit(long localTransactionId) 241 { 242 initializer.heuristicallyCommit(localTransactionId); 243 } 244 245 public void heuristicallyCommitAll() 246 { 247 initializer.heuristicallyCommitAll(); 248 } 249 250 public void heuristicallyRollback(long localTransactionId) 251 { 252 initializer.heuristicallyRollback(localTransactionId); 253 } 254 255 public void heuristicallyRollbackAll() 256 { 257 initializer.heuristicallyRollbackAll(); 258 } 259 260 public String listHeuristicallyCompletedTransactions() 261 { 262 return initializer.listHeuristicallyCompletedTransactions(); 263 } 264 265 public void forget(long localTransactionId) 266 { 267 initializer.forget(localTransactionId); 268 } 269 270 public void forgetAll() 271 { 272 initializer.forgetAll(); 273 } 274 275 public void registerXAExceptionFormatter(Class clazz, XAExceptionFormatter formatter) 276 { 277 initializer.registerXAExceptionFormatter(clazz, formatter); 278 } 279 280 public void unregisterXAExceptionFormatter(Class clazz) 281 { 282 initializer.unregisterXAExceptionFormatter(clazz); 283 } 284 } 285 | Popular Tags |