1 23 24 package com.sun.enterprise.transaction; 25 import com.sun.enterprise.transaction.monitor.JTSMonitorMBean; 26 import com.sun.enterprise.admin.event.tx.TransactionsRecoveryEvent; 27 import com.sun.enterprise.admin.event.tx.TransactionsRecoveryEventListener; 28 import com.sun.enterprise.admin.event.AdminEventListenerException; 29 30 import com.sun.enterprise.server.ApplicationServer; 31 import com.sun.enterprise.util.i18n.StringManager; 32 33 public class TransactionsRecoveryEventListenerImpl implements TransactionsRecoveryEventListener { 34 35 private static StringManager sm = StringManager.getManager(TransactionsRecoveryEventListenerImpl.class); 37 38 39 44 public void processEvent(TransactionsRecoveryEvent event) throws AdminEventListenerException 45 { 46 50 String currentServer = ApplicationServer.getServerContext().getInstanceName(); 51 52 boolean delegated = (!currentServer.equals(event.getServerName())); 53 54 try { 56 JTSMonitorMBean.recover(delegated, event.getLogDir()); 57 } catch (Exception ex) { 58 if (ex.getMessage() != null) 59 throw new AdminEventListenerException(ex.getMessage()); 60 else 61 throw new AdminEventListenerException(sm.getString("transaction.unexpected_exception_in_recover-transactions")); 62 } 63 } 64 } 65 | Popular Tags |