1 22 package org.jboss.test.recover.bean; 23 24 import org.jboss.test.recover.interfaces.MockLogger; 25 import org.jboss.tm.TxManager; 26 import org.jboss.tm.recovery.BatchRecoveryLogger; 27 import org.jboss.tm.recovery.BatchRecoveryLoggerService; 28 29 37 public class MockLoggerService 38 extends BatchRecoveryLoggerService 39 implements MockLoggerServiceMBean 40 { 41 protected BatchRecoveryLogger createLogger() 42 { 43 return new MockLogger(); 44 } 45 46 public boolean isCrashOnFailure() 47 { 48 return ((MockLogger)logger).isCrashOnFailure(); 49 } 50 51 public void setCrashOnFailure(boolean crashOnFailure) 52 { 53 ((MockLogger)logger).setCrashOnFailure(crashOnFailure); 54 } 55 56 public int getFailBefore() 57 { 58 return ((MockLogger)logger).getFailBefore(); 59 } 60 61 public void setFailBefore(int failBefore) 62 { 63 ((MockLogger)logger).setFailBefore(failBefore); 64 } 65 66 public int getFailAfter() 67 { 68 return ((MockLogger)logger).getFailAfter(); 69 } 70 71 public void setFailAfter(int failAfter) 72 { 73 ((MockLogger)logger).setFailAfter(failAfter); 74 } 75 76 public boolean isFailBeforeCommitting() 77 { 78 return ((MockLogger)logger).isFailBeforeCommitting(); 79 } 80 81 public void setFailBeforeCommitting(boolean failBeforeCommitting) 82 { 83 ((MockLogger)logger).setFailBeforeCommitting(failBeforeCommitting); 84 } 85 86 public boolean isFailAfterCommitting() 87 { 88 return ((MockLogger)logger).isFailAfterCommitting(); 89 } 90 91 public void setFailAfterCommitting(boolean failAfterCommitting) 92 { 93 ((MockLogger)logger).setFailAfterCommitting(failAfterCommitting); 94 } 95 96 public boolean isFailBeforePreparing() 97 { 98 return ((MockLogger)logger).isFailBeforePreparing(); 99 } 100 101 public void setFailBeforePreparing(boolean failBeforePreparing) 102 { 103 ((MockLogger)logger).setFailBeforePreparing(failBeforePreparing); 104 } 105 106 public boolean isFailAfterPreparing() 107 { 108 return ((MockLogger)logger).isFailAfterPreparing(); 109 } 110 111 public void setFailAfterPreparing(boolean failAfterPreparing) 112 { 113 ((MockLogger)logger).setFailAfterPreparing(failAfterPreparing); 114 } 115 116 public boolean isFailBeforeSavingHeuristicStatus() 117 { 118 return ((MockLogger)logger).isFailBeforeSavingHeuristicStatus(); 119 } 120 121 public void setFailBeforeSavingHeuristicStatus( 122 boolean failBeforeSavingHeuristicStatus) 123 { 124 ((MockLogger)logger).setFailBeforeSavingHeuristicStatus( 125 failBeforeSavingHeuristicStatus); 126 } 127 128 public boolean isFailAfterSavingHeuristicStatus() 129 { 130 return ((MockLogger)logger).isFailAfterSavingHeuristicStatus(); 131 } 132 133 public void setFailAfterSavingHeuristicStatus( 134 boolean failAfterSavingHeuristicStatus) 135 { 136 ((MockLogger)logger).setFailAfterSavingHeuristicStatus( 137 failAfterSavingHeuristicStatus); 138 } 139 140 public boolean isFailBeforeClearingHeuristicStatus() 141 { 142 return ((MockLogger)logger).isFailBeforeClearingHeuristicStatus(); 143 } 144 145 public void setFailBeforeClearingHeuristicStatus( 146 boolean failBeforeClearingHeuristicStatus) 147 { 148 ((MockLogger)logger).setFailBeforeClearingHeuristicStatus( 149 failBeforeClearingHeuristicStatus); 150 } 151 152 public boolean isFailAfterClearingHeuristicStatus() 153 { 154 return ((MockLogger)logger).isFailAfterClearingHeuristicStatus(); 155 } 156 157 public void setFailAfterClearingHeuristicStatus( 158 boolean failAfterClearingHeuristicStatus) 159 { 160 ((MockLogger)logger).setFailAfterClearingHeuristicStatus( 161 failAfterClearingHeuristicStatus); 162 } 163 164 public void startService() throws Exception 165 { 166 super.startService(); 167 TxManager.getInstance().setRecoveryLogger(logger); 168 } 169 170 } 171 | Popular Tags |