/** * {@inheritDoc} * The registry file is closed and deleted if there are no more resources left. * * @throws XAException if there is a problem deleting the registry file */ @Override protected void removeResource(XAResource resource) throws XAException { if (resources.remove(resource)) { if (resources.isEmpty()) { // delete file try { if (fileChannel != null) { fileChannel.close(); } Files.delete(filePath); openFilePaths.remove(filePath.toString()); } catch (IOException e) { throw Log.log.deleteXAResourceRecoveryFileFailed(XAException.XAER_RMERR, filePath, resource, e); } Log.log.xaResourceRecoveryFileDeleted(filePath); } // remove resource from in doubt list, in case the resource was in doubt inDoubtResources.remove(resource); } }
/** * {@inheritDoc} * The registry file is closed and deleted if there are no more resources left. * * @throws XAException if there is a problem deleting the registry file */ @Override protected void removeResource(XAResource resource) throws XAException { if (resources.remove(resource)) { if (resources.isEmpty()) { // delete file try { if (fileChannel != null) { fileChannel.close(); } Files.delete(filePath); openFilePaths.remove(filePath.toString()); } catch (IOException e) { throw Log.log.deleteXAResourceRecoveryFileFailed(XAException.XAER_RMERR, filePath, resource, e); } Log.log.xaResourceRecoveryFileDeleted(filePath); } // remove resource from in doubt list, in case the resource was in doubt inDoubtResources.remove(resource); } }
/** * {@inheritDoc} * The registry file is closed and deleted if there are no more resources left. * * @throws XAException if there is a problem deleting the registry file */ @Override protected void removeResource(XAResource resource) throws XAException { if (resources.remove(resource)) { if (resources.isEmpty()) { // delete file try { if (fileChannel != null) { fileChannel.close(); } Files.delete(filePath); openFilePaths.remove(filePath.toString()); } catch (IOException e) { throw Log.log.deleteXAResourceRecoveryFileFailed(XAException.XAER_RMERR, filePath, resource, e); } Log.log.xaResourceRecoveryFileDeleted(filePath); } // remove resource from in doubt list, in case the resource was in doubt inDoubtResources.remove(resource); } }