Skip to content

Commit

Permalink
Update ObjStoreBrowser usage according to JBTM-3973
Browse files Browse the repository at this point in the history
singleton
  • Loading branch information
marcosgopen committed Feb 3, 2025
1 parent 7baaf58 commit 02072ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ private static void setupStore(String storeDir) throws Exception {
recoveryManager = new RecoveryManagerImple(false);
recoveryManager.addModule(new LRARecoveryModule());

osb = new ObjStoreBrowser();
osb = ObjStoreBrowser.getInstance();
for(String[] typeAndBean: LRA_OSB_TYPES) {
osb.addType(typeAndBean[0], typeAndBean[1], typeAndBean[2]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.arjuna.ats.arjuna.common.recoveryPropertyManager;
import com.arjuna.ats.arjuna.tools.osb.mbean.ActionBean;
import com.arjuna.ats.arjuna.tools.osb.mbean.LogRecordWrapper;
import com.arjuna.ats.arjuna.tools.osb.mbean.OSBTypeHandler;
import com.arjuna.ats.arjuna.tools.osb.mbean.OSEntryBean;
import com.arjuna.ats.arjuna.tools.osb.mbean.ObjStoreBrowser;
import com.arjuna.ats.arjuna.tools.osb.mbean.UidWrapper;
Expand All @@ -23,6 +24,7 @@
import org.junit.Before;
import org.junit.Test;

import java.io.File;
import java.net.URI;

import static org.junit.Assert.assertEquals;
Expand All @@ -35,7 +37,7 @@ public class ObjStoreBrowserLRATest {
private RecoveryManagerImple recoveryManager;
private ObjStoreBrowser osb;

private static String[][] LRA_OSB_TYPES = {
private final static String[][] LRA_OSB_TYPES = {
// osTypeClassName, beanTypeClassName - see com.arjuna.ats.arjuna.tools.osb.mbean.ObjStoreBrowser
{LongRunningAction.getType().substring(1), LongRunningAction.class.getName(), LRAActionBean.class.getName()},
{FailedLongRunningAction.getType().substring(1), FailedLongRunningAction.class.getName(), LRAActionBean.class.getName()}
Expand All @@ -49,9 +51,11 @@ public void setUp() {
recoveryManager.addModule(new LRARecoveryModule());

// initiating the ObjStoreBrowser
osb = new ObjStoreBrowser();
osb = ObjStoreBrowser.getInstance();
for(String[] typeAndBean: LRA_OSB_TYPES) {
assertTrue(osb.addType(typeAndBean[0], typeAndBean[1], typeAndBean[2]));
String typeName = typeAndBean[0].replace("/", File.separator);
osb.addOSBTypeHandler(typeName, new OSBTypeHandler(true, true, typeAndBean[1], typeAndBean[2],
typeAndBean[0], null, this.getClass().getClassLoader()));
}
osb.start();
}
Expand Down

0 comments on commit 02072ff

Please sign in to comment.