@Override public XAResourceRecovery get() { Cache<?, ?> cache = this.cache.get(); XAResourceRecovery recovery = new InfinispanXAResourceRecovery(cache); if (cache.getCacheConfiguration().transaction().recovery().enabled()) { this.registry.get().addXAResourceRecovery(recovery); } return recovery; }
JBossLocalTransactionProvider(final ExtendedJBossXATerminator ext, final int staleTransactionTime, final TransactionManager tm, final XAResourceRecoveryRegistry registry, final Path xaRecoveryDirRelativeToPath) { Assert.checkMinimumParameter("setTransactionTimeout", 0, staleTransactionTime); this.staleTransactionTime = staleTransactionTime; this.ext = Assert.checkNotNullParam("ext", ext); this.tm = Assert.checkNotNullParam("tm", tm); try { ext.doRecover(null, null); } catch (Exception e) { // the recover method is called to load transactions from Narayana object store at startup // if it fails we ignore, troubles will be adjusted during runtime Log.log.doRecoverFailureOnIntialization(e); } this.fileSystemXAResourceRegistry = new FileSystemXAResourceRegistry(this, xaRecoveryDirRelativeToPath); registry.addXAResourceRecovery(fileSystemXAResourceRegistry::getInDoubtXAResources); }
/** * {@inheritDoc} */ public void addXAResourceRecovery(XAResourceRecovery recovery) { if (!(recovery instanceof org.jboss.tm.XAResourceRecovery)) throw new IllegalArgumentException("Recovery is not a org.jboss.tm.XAResourceRecovery instance"); delegator.addXAResourceRecovery((org.jboss.tm.XAResourceRecovery)recovery); }
public void init() { if (started.compareAndSet(false, true) && getTMRegistry() != null) { getTMRegistry().addXAResourceRecovery(WildFlyActiveMQRecoveryRegistry.getInstance()); } }
private void init() { if (started.compareAndSet(false, true) && getTMRegistry() != null) { getTMRegistry().addXAResourceRecovery(HornetQRecoveryRegistry.getInstance()); } }
@Override public XAResourceRecovery get() { Cache<?, ?> cache = this.cache.get(); XAResourceRecovery recovery = new InfinispanXAResourceRecovery(cache); if (cache.getCacheConfiguration().transaction().recovery().enabled()) { this.registry.get().addXAResourceRecovery(recovery); } return recovery; }
JBossLocalTransactionProvider(final ExtendedJBossXATerminator ext, final int staleTransactionTime, final TransactionManager tm, final XAResourceRecoveryRegistry registry, final Path xaRecoveryDirRelativeToPath) { Assert.checkMinimumParameter("setTransactionTimeout", 0, staleTransactionTime); this.staleTransactionTime = staleTransactionTime; this.ext = Assert.checkNotNullParam("ext", ext); this.tm = Assert.checkNotNullParam("tm", tm); try { ext.doRecover(null, null); } catch (Exception e) { // the recover method is called to load transactions from Narayana object store at startup // if it fails we ignore, troubles will be adjusted during runtime Log.log.doRecoverFailureOnIntialization(e); } this.fileSystemXAResourceRegistry = new FileSystemXAResourceRegistry(this, xaRecoveryDirRelativeToPath); registry.addXAResourceRecovery(fileSystemXAResourceRegistry::getInDoubtXAResources); }
JBossLocalTransactionProvider(final ExtendedJBossXATerminator ext, final int staleTransactionTime, final TransactionManager tm, final XAResourceRecoveryRegistry registry, final Path xaRecoveryDirRelativeToPath) { Assert.checkMinimumParameter("setTransactionTimeout", 0, staleTransactionTime); this.staleTransactionTime = staleTransactionTime; this.ext = Assert.checkNotNullParam("ext", ext); this.tm = Assert.checkNotNullParam("tm", tm); try { ext.doRecover(null, null); } catch (Exception e) { // the recover method is called to load transactions from Narayana object store at startup // if it fails we ignore, troubles will be adjusted during runtime Log.log.doRecoverFailureOnIntialization(e); } this.fileSystemXAResourceRegistry = new FileSystemXAResourceRegistry(this, xaRecoveryDirRelativeToPath); registry.addXAResourceRecovery(fileSystemXAResourceRegistry::getInDoubtXAResources); }
@Override public void start(StartContext context) { EmbeddedCacheManager container = this.dependencies.getCacheContainer(); CacheStoreFactoryRegistry cacheStoreFactoryRegistry = container.getGlobalComponentRegistry().getComponent(CacheStoreFactoryRegistry.class); cacheStoreFactoryRegistry.addCacheStoreFactory(this.dependencies.getDeployedCacheStoreFactory()); EntryMergePolicyFactoryRegistry mergePolicyRegistry = container.getGlobalComponentRegistry().getComponent(EntryMergePolicyFactoryRegistry.class); mergePolicyRegistry.addMergePolicyFactory(this.dependencies.getDeployedMergePolicyRegistry()); this.cache = SecurityActions.startCache(container, this.name, this.configurationName); XAResourceRecoveryRegistry recoveryRegistry = this.dependencies.getRecoveryRegistry(); if (recoveryRegistry != null) { this.recovery = new InfinispanXAResourceRecovery(this.name, container); recoveryRegistry.addXAResourceRecovery(this.recovery); } log.debugf("%s cache started", this.name); }
getXAResourceRecoveryRegistry().addXAResourceRecovery(this); recoveryRegistered = true;