Skip to content

Commit

Permalink
Add start and stop Recovery Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
zhfeng committed Jun 15, 2022
1 parent e644ded commit f26b6e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ public javax.transaction.UserTransaction userTransaction() {

@Produces
@ApplicationScoped
@Unremovable
public XAResourceRecoveryRegistry xaResourceRecoveryRegistry() {
return new RecoveryManagerService();
RecoveryManagerService recoveryManagerService = new RecoveryManagerService();
recoveryManagerService.create();
recoveryManagerService.start();
return recoveryManagerService;
}

@Produces
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.arjuna.ats.arjuna.common.arjPropertyManager;
import com.arjuna.ats.arjuna.coordinator.TransactionReaper;
import com.arjuna.ats.arjuna.coordinator.TxControl;
import com.arjuna.ats.arjuna.recovery.RecoveryManager;
import com.arjuna.ats.jta.common.jtaPropertyManager;
import com.arjuna.common.util.propertyservice.PropertiesFactory;

Expand Down Expand Up @@ -74,6 +75,7 @@ public void handleShutdown(ShutdownContext context) {
context.addLastShutdownTask(new Runnable() {
@Override
public void run() {
RecoveryManager.manager().terminate(true);
TransactionReaper.terminate(false);
}
});
Expand Down

0 comments on commit f26b6e9

Please sign in to comment.