/** * If supplied xids contains any values seen on prev scans, replace the existing * XAResource with the supplied one and return true. Otherwise, return false. * * @param xaResource * @param xids * @return */ public boolean updateIfEquivalentRM(XAResource xaResource, Xid[] xids) { if(xids != null && xids.length > 0) { for(int i = 0; i < xids.length; i++) { if(contains(xids[i])) { _xares = xaResource; _lastValidated = System.currentTimeMillis(); return true; } } } // either (or both) passes have an empty Xid set, // so fallback to isSameRM as we can't use Xid matching if(isSameRM(xaResource)) { _xares = xaResource; _lastValidated = System.currentTimeMillis(); return true; } return false; }
if(isSameRM(xaResource)) { _xares = xaResource; _lastValidated = System.currentTimeMillis();
if(isSameRM(xaResource)) { _xares = xaResource; _lastValidated = System.currentTimeMillis();
if(isSameRM(xaResource)) { _xares = xaResource; _lastValidated = System.currentTimeMillis();
if(isSameRM(xaResource)) { _xares = xaResource; _lastValidated = System.currentTimeMillis();
if(isSameRM(xaResource)) { _xares = xaResource; _lastValidated = System.currentTimeMillis();
if (xidsToRecover.isSameRM(xares))
if (xidsToRecover.isSameRM(xares))
if (xidsToRecover.isSameRM(xares))
if (xidsToRecover.isSameRM(xares))
if (xidsToRecover.isSameRM(xares))
if (xidsToRecover.isSameRM(xares))
if (xidsToRecover.isSameRM(xares))
assertTrue(rxids.updateIfEquivalentRM(new TestResource(), xids)); assertFalse(rxids.isSameRM(new TestResource()));