use of org.jboss.as.txn.suspend.RecoverySuspendController in project wildfly by wildfly.
the class ArjunaRecoveryManagerService method start.
public synchronized void start(StartContext context) throws StartException {
// Recovery env bean
final RecoveryEnvironmentBean recoveryEnvironmentBean = recoveryPropertyManager.getRecoveryEnvironmentBean();
final SocketBinding recoveryBinding = recoveryBindingInjector.getValue();
recoveryEnvironmentBean.setRecoveryInetAddress(recoveryBinding.getSocketAddress().getAddress());
recoveryEnvironmentBean.setRecoveryPort(recoveryBinding.getSocketAddress().getPort());
final SocketBinding statusBinding = statusBindingInjector.getValue();
recoveryEnvironmentBean.setTransactionStatusManagerInetAddress(statusBinding.getSocketAddress().getAddress());
recoveryEnvironmentBean.setTransactionStatusManagerPort(statusBinding.getSocketAddress().getPort());
recoveryEnvironmentBean.setRecoveryListener(recoveryListener);
if (recoveryListener) {
ManagedBinding binding = ManagedBinding.Factory.createSimpleManagedBinding(recoveryBinding);
bindingManager.getValue().getNamedRegistry().registerBinding(binding);
}
final List<String> recoveryExtensions = new ArrayList<String>();
// must be first
recoveryExtensions.add(CommitMarkableResourceRecordRecoveryModule.class.getName());
recoveryExtensions.add(AtomicActionRecoveryModule.class.getName());
recoveryExtensions.add(TORecoveryModule.class.getName());
final List<String> expiryScanners;
if (System.getProperty("RecoveryEnvironmentBean.expiryScannerClassNames") != null) {
expiryScanners = recoveryEnvironmentBean.getExpiryScannerClassNames();
} else {
expiryScanners = new ArrayList<String>();
expiryScanners.add(ExpiredTransactionStatusManagerScanner.class.getName());
}
if (!jts) {
recoveryExtensions.add(com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.class.getName());
recoveryEnvironmentBean.setRecoveryModuleClassNames(recoveryExtensions);
recoveryEnvironmentBean.setExpiryScannerClassNames(expiryScanners);
recoveryEnvironmentBean.setRecoveryActivators(null);
final RecoveryManagerService recoveryManagerService = new RecoveryManagerService();
try {
recoveryManagerService.create();
} catch (Exception e) {
throw TransactionLogger.ROOT_LOGGER.managerStartFailure(e, "Recovery");
}
recoveryManagerService.start();
this.recoveryManagerService = recoveryManagerService;
} else {
final ORB orb = orbInjector.getValue();
new PostInitLoader(PostInitLoader.generateORBPropertyName("com.arjuna.orbportability.orb"), orb);
recoveryExtensions.add(TopLevelTransactionRecoveryModule.class.getName());
recoveryExtensions.add(ServerTransactionRecoveryModule.class.getName());
recoveryExtensions.add(JCAServerTransactionRecoveryModule.class.getName());
recoveryExtensions.add(com.arjuna.ats.internal.jta.recovery.jts.XARecoveryModule.class.getName());
expiryScanners.add(ExpiredContactScanner.class.getName());
expiryScanners.add(ExpiredToplevelScanner.class.getName());
expiryScanners.add(ExpiredServerScanner.class.getName());
recoveryEnvironmentBean.setRecoveryModuleClassNames(recoveryExtensions);
recoveryEnvironmentBean.setExpiryScannerClassNames(expiryScanners);
recoveryEnvironmentBean.setRecoveryActivatorClassNames(Collections.singletonList(com.arjuna.ats.internal.jts.orbspecific.recovery.RecoveryEnablement.class.getName()));
try {
final RecoveryManagerService recoveryManagerService = new com.arjuna.ats.jbossatx.jts.RecoveryManagerService(orb);
recoveryManagerService.create();
recoveryManagerService.start();
this.recoveryManagerService = recoveryManagerService;
} catch (Exception e) {
throw TransactionLogger.ROOT_LOGGER.managerStartFailure(e, "Recovery");
}
}
recoverySuspendController = new RecoverySuspendController(recoveryManagerService);
suspendControllerInjector.getValue().registerActivity(recoverySuspendController);
}
Aggregations