if (!scanControllers.isEmpty())
{
// loop from end to beginning, removing scans which are not held.
for (int i = scanControllers.size() - 1; i >= 0; i--)
{
ScanManager sc = (ScanManager) scanControllers.get(i);
if (sc.closeForEndTransaction(closeHeldControllers))
{
// TODO - now counting on scan's removing themselves by
// calling the closeMe() method.
/* scanControllers.removeElementAt(i); */
}
}
if (closeHeldControllers)
{
if (SanityManager.DEBUG)
{
SanityManager.ASSERT(scanControllers.isEmpty());
}
// just to make sure everything has been closed and removed.
scanControllers.clear();
}
}
if (!conglomerateControllers.isEmpty())
{
// loop from end to beginning, removing scans which are not held.
for (int i = conglomerateControllers.size() - 1; i >= 0; i--)
{
ConglomerateController cc =
(ConglomerateController)
conglomerateControllers.get(i);
if (cc.closeForEndTransaction(closeHeldControllers))
{
// TODO - now counting on cc's removing themselves by
// calling the closeMe() method.
/* conglomerateControllers.removeElementAt(i); */
}
}
if (closeHeldControllers)
{
if (SanityManager.DEBUG)
{
SanityManager.ASSERT(scanControllers.isEmpty());
}
// just to make sure everything has been closed and removed.
conglomerateControllers.clear();
}
}
if ((sortControllers != null) && !sortControllers.isEmpty())
{
if (closeHeldControllers)
{
// Loop from the end since the call to close() will remove the
// element from the list.
for (int i = sortControllers.size() - 1; i >= 0; i--)
{
SortController sc = (SortController) sortControllers.get(i);
sc.completedInserts();
}
sortControllers.clear();
}
}