Skip to content

Commit

Permalink
Make all Record class and BeanPopulator to init at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
zhfeng committed Apr 26, 2024
1 parent 29ad05a commit 4b14a90
Showing 1 changed file with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
import jakarta.transaction.TransactionManager;
import jakarta.transaction.TransactionScoped;

import com.arjuna.ats.arjuna.common.CoordinatorEnvironmentBean;
import com.arjuna.ats.arjuna.common.CoreEnvironmentBean;
import com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean;
import com.arjuna.ats.arjuna.common.RecoveryEnvironmentBean;
import com.arjuna.ats.arjuna.coordinator.AbstractRecord;
import com.arjuna.ats.arjuna.recovery.TransactionStatusConnectionManager;
import com.arjuna.ats.internal.arjuna.coordinator.CheckedActionFactoryImple;
import com.arjuna.ats.internal.arjuna.objectstore.ShadowNoFileLockStore;
Expand All @@ -31,10 +35,15 @@
import com.arjuna.ats.internal.jta.recovery.arjunacore.RecoverConnectableAtomicAction;
import com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule;
import com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord;
import com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple;
import com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple;
import com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple;
import com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple;
import com.arjuna.ats.jdbc.common.JDBCEnvironmentBean;
import com.arjuna.ats.jta.common.JTAEnvironmentBean;
import com.arjuna.ats.jta.resources.LastResourceCommitOptimisation;
import com.arjuna.ats.txoj.common.TxojEnvironmentBean;
import com.arjuna.common.internal.util.propertyservice.BeanPopulator;
import com.arjuna.common.util.propertyservice.PropertiesFactory;

import io.quarkus.agroal.spi.JdbcDataSourceBuildItem;
Expand Down Expand Up @@ -107,16 +116,28 @@ public void build(NarayanaJtaRecorder recorder,
runtimeInit.produce(new RuntimeInitializedClassBuildItem(TransactionStatusConnectionManager.class.getName()));
runtimeInit.produce(new RuntimeInitializedClassBuildItem(JTAActionStatusServiceXAResourceOrphanFilter.class.getName()));
runtimeInit.produce(new RuntimeInitializedClassBuildItem(AtomicActionExpiryScanner.class.getName()));
runtimeInit.produce(new RuntimeInitializedClassBuildItem(TransactionImple.class.getName()));
runtimeInit.produce(new RuntimeInitializedClassBuildItem(BeanPopulator.class.getName()));

indexBuildItem.getIndex().getAllKnownSubclasses(AbstractRecord.class).stream()
.map(r -> new RuntimeInitializedClassBuildItem(r.name().toString()))
.forEach(runtimeInit::produce);

indexBuildItem.getIndex().getAllKnownSubclasses(JDBCImple_driver.class).stream()
.map(impl -> ReflectiveClassBuildItem.builder(impl.name().toString()).build())
.forEach(reflectiveClass::produce);
reflectiveClass.produce(ReflectiveClassBuildItem.builder(JTAEnvironmentBean.class,
UserTransactionImple.class,
CoreEnvironmentBean.class,
CoordinatorEnvironmentBean.class,
JDBCEnvironmentBean.class,
ObjectStoreEnvironmentBean.class,
TxojEnvironmentBean.class,
RecoveryEnvironmentBean.class).fields().methods().build());
reflectiveClass.produce(ReflectiveClassBuildItem.builder(UserTransactionImple.class,
CheckedActionFactoryImple.class,
LastResourceCommitOptimisation.class,
TransactionManagerImple.class,
TransactionSynchronizationRegistryImple.class,
ObjectStoreEnvironmentBean.class,
ShadowNoFileLockStore.class,
JDBCStore.class,
SocketProcessId.class,
Expand Down

0 comments on commit 4b14a90

Please sign in to comment.