Search in sources :

Example 1 with HornetqJournalEnvironmentBean

use of com.arjuna.ats.internal.arjuna.objectstore.hornetq.HornetqJournalEnvironmentBean in project wildfly by wildfly.

the class ArjunaObjectStoreEnvironmentService method start.

@Override
public void start(StartContext context) throws StartException {
    callbackHandle = pathManagerInjector.getValue().registerCallback(pathRef, PathManager.ReloadServerCallback.create(), PathManager.Event.UPDATED, PathManager.Event.REMOVED);
    String objectStoreDir = pathManagerInjector.getValue().resolveRelativePathEntry(path, pathRef);
    final ObjectStoreEnvironmentBean defaultActionStoreObjectStoreEnvironmentBean = BeanPopulator.getNamedInstance(ObjectStoreEnvironmentBean.class, null);
    if (useJournalStore) {
        HornetqJournalEnvironmentBean hornetqJournalEnvironmentBean = BeanPopulator.getDefaultInstance(com.arjuna.ats.internal.arjuna.objectstore.hornetq.HornetqJournalEnvironmentBean.class);
        hornetqJournalEnvironmentBean.setAsyncIO(enableAsyncIO);
        hornetqJournalEnvironmentBean.setStoreDir(objectStoreDir + "/HornetqObjectStore");
        defaultActionStoreObjectStoreEnvironmentBean.setObjectStoreType("com.arjuna.ats.internal.arjuna.objectstore.hornetq.HornetqObjectStoreAdaptor");
    } else {
        defaultActionStoreObjectStoreEnvironmentBean.setObjectStoreDir(objectStoreDir);
    }
    final ObjectStoreEnvironmentBean stateStoreObjectStoreEnvironmentBean = BeanPopulator.getNamedInstance(ObjectStoreEnvironmentBean.class, "stateStore");
    stateStoreObjectStoreEnvironmentBean.setObjectStoreDir(objectStoreDir);
    final ObjectStoreEnvironmentBean communicationStoreObjectStoreEnvironmentBean = BeanPopulator.getNamedInstance(ObjectStoreEnvironmentBean.class, "communicationStore");
    communicationStoreObjectStoreEnvironmentBean.setObjectStoreDir(objectStoreDir);
    if (useJdbcStore) {
        defaultActionStoreObjectStoreEnvironmentBean.setObjectStoreType("com.arjuna.ats.internal.arjuna.objectstore.jdbc.JDBCStore");
        stateStoreObjectStoreEnvironmentBean.setObjectStoreType("com.arjuna.ats.internal.arjuna.objectstore.jdbc.JDBCStore");
        communicationStoreObjectStoreEnvironmentBean.setObjectStoreType("com.arjuna.ats.internal.arjuna.objectstore.jdbc.JDBCStore");
        defaultActionStoreObjectStoreEnvironmentBean.setJdbcAccess("com.arjuna.ats.internal.arjuna.objectstore.jdbc.accessors.DataSourceJDBCAccess;datasourceName=" + dataSourceJndiName);
        stateStoreObjectStoreEnvironmentBean.setJdbcAccess("com.arjuna.ats.internal.arjuna.objectstore.jdbc.accessors.DataSourceJDBCAccess;datasourceName=" + dataSourceJndiName);
        communicationStoreObjectStoreEnvironmentBean.setJdbcAccess("com.arjuna.ats.internal.arjuna.objectstore.jdbc.accessors.DataSourceJDBCAccess;datasourceName=" + dataSourceJndiName);
        defaultActionStoreObjectStoreEnvironmentBean.setTablePrefix(jdbcSoreConfig.getActionTablePrefix());
        stateStoreObjectStoreEnvironmentBean.setTablePrefix(jdbcSoreConfig.getStateTablePrefix());
        communicationStoreObjectStoreEnvironmentBean.setTablePrefix(jdbcSoreConfig.getCommunicationTablePrefix());
        defaultActionStoreObjectStoreEnvironmentBean.setDropTable(jdbcSoreConfig.isActionDropTable());
        stateStoreObjectStoreEnvironmentBean.setDropTable(jdbcSoreConfig.isStateDropTable());
        communicationStoreObjectStoreEnvironmentBean.setDropTable(jdbcSoreConfig.isCommunicationDropTable());
    }
}
Also used : ObjectStoreEnvironmentBean(com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean) HornetqJournalEnvironmentBean(com.arjuna.ats.internal.arjuna.objectstore.hornetq.HornetqJournalEnvironmentBean)

Aggregations

ObjectStoreEnvironmentBean (com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean)1 HornetqJournalEnvironmentBean (com.arjuna.ats.internal.arjuna.objectstore.hornetq.HornetqJournalEnvironmentBean)1