FileDocCategorySizeDatePackage
TransactionsRecoveryMBean.javaAPI DocGlassfish v2 API5089Fri May 04 22:24:10 BST 2007com.sun.enterprise.admin.mbeans

TransactionsRecoveryMBean

public class TransactionsRecoveryMBean extends com.sun.enterprise.admin.config.BaseConfigMBean
object name for this mbean: :type=transactions-recovery,category=config TransactionsRecoveryMBean sends request to transactions recovery
author
alexkrav

Fields Summary
private static final com.sun.enterprise.util.i18n.StringManager
_strMgr
Constructors Summary
public TransactionsRecoveryMBean()

        super();
    
Methods Summary
private voidfine(java.lang.String s)

         _sLogger.log(Level.FINE, s); 
     
private com.sun.enterprise.admin.event.AdminEventResultforwardEvent(com.sun.enterprise.admin.event.AdminEvent e)

        AdminEventResult result = null;
        result = AdminEventMulticaster.multicastEvent(e);
        return result;
    
private java.lang.StringgetServerName()

        return ApplicationServer.getServerContext().getInstanceName();
    
public voidrecoverTransactions()
Recovers transaction for given server instance

throws
MBeanConfigException if not SUCCESS result of event handling

        
        fine("TransactionsRecoverytMBean.recoveryTransactions for server");
	 
        sendTransactionsRecoveryEvent(getServerName(), getServerName(), null);
        
    
private voidsendTransactionsRecoveryEvent(java.lang.String destinationServer, java.lang.String serverToRecover, java.lang.String transactionLogDir)

        AdminEvent event = new TransactionsRecoveryEvent(getServerName(), 
                    serverToRecover, 
                    transactionLogDir);
        event.setTargetDestination(destinationServer); 
        AdminEventResult res = forwardEvent(event);
        if(!AdminEventResult.SUCCESS.equals(res.getResultCode()))
        {
            Throwable exc = null;
            exc = res.getFirstThrowable();
            if (exc != null) {
                throw new MBeanConfigException(_strMgr.getString("tx.exceptionInTargetServer", 
                    exc.getMessage()));
            }
            throw new MBeanConfigException(_strMgr.getString("tx.notSuccessInSendReturn", 
                    res.getResultCode()));
        }