1 22 package org.jboss.tm.recovery; 23 24 import javax.management.ObjectName ; 25 26 import org.jboss.system.ServiceMBeanSupport; 27 import org.jboss.tm.XidFactoryMBean; 28 29 37 public class BatchRecoveryLoggerService 38 extends ServiceMBeanSupport 39 implements BatchRecoveryLoggerServiceMBean 40 { 41 42 protected BatchRecoveryLogger logger; 43 44 45 private ObjectName xidFactory; 46 47 50 public BatchRecoveryLoggerService() 51 { 52 logger = createLogger(); 53 } 54 55 59 protected BatchRecoveryLogger createLogger() 60 { 61 return new BatchRecoveryLogger(); 62 } 63 64 66 69 public void startService() throws Exception 70 { 71 super.startService(); 72 XidFactoryMBean xidFactoryObj = 73 (XidFactoryMBean) getServer().getAttribute(xidFactory, "Instance"); 74 logger.setXidFactory(xidFactoryObj); 75 logger.start(); 76 } 77 78 81 public void stopService() throws Exception 82 { 83 super.stopService(); 84 logger.stop(); 85 } 86 87 89 92 public RecoveryLogger getInstance() 93 { 94 return logger; 95 } 96 97 99 102 public String [] getDirectoryList() 103 { 104 return logger.getDirectoryList(); 105 } 106 107 111 public void setDirectoryList(String [] directoryList) 112 { 113 logger.setDirectoryList(directoryList); 114 } 115 116 119 public int getLogFileSize() 120 { 121 return logger.getLogFileSize(); 122 } 123 124 128 public void setLogFileSize(int logFileSize) 129 { 130 logger.setLogFileSize(logFileSize); 131 } 132 133 136 public String getHeuristicStatusLogDirectory() 137 { 138 return logger.getHeuristicStatusLogDirectory(); 139 } 140 141 145 public void setHeuristicStatusLogDirectory(String directory) 146 { 147 logger.setHeuristicStatusLogDirectory(directory); 148 } 149 150 153 public ObjectName getXidFactory() 154 { 155 return xidFactory; 156 } 157 158 162 public void setXidFactory(ObjectName xidFactory) 163 { 164 this.xidFactory = xidFactory; 165 } 166 167 } 168 | Popular Tags |