private void processSecondPasses(ArrayList<? extends SecondPass> secondPasses) { if ( secondPasses == null ) { return; } for ( SecondPass secondPass : secondPasses ) { secondPass.doSecondPass( getEntityBindingMap() ); } secondPasses.clear(); }
private void processEndOfQueue(List<FkSecondPass> endOfQueueFkSecondPasses) { /* * If a second pass raises a recoverableException, queue it for next round * stop of no pass has to be processed or if the number of pass to processes * does not diminish between two rounds. * If some failing pass remain, raise the original exception */ boolean stopProcess = false; RuntimeException originalException = null; while ( !stopProcess ) { List<FkSecondPass> failingSecondPasses = new ArrayList<>(); for ( FkSecondPass pass : endOfQueueFkSecondPasses ) { try { pass.doSecondPass( getEntityBindingMap() ); } catch (RecoverableException e) { failingSecondPasses.add( pass ); if ( originalException == null ) { originalException = (RuntimeException) e.getCause(); } } } stopProcess = failingSecondPasses.size() == 0 || failingSecondPasses.size() == endOfQueueFkSecondPasses.size(); endOfQueueFkSecondPasses = failingSecondPasses; } if ( endOfQueueFkSecondPasses.size() > 0 ) { throw originalException; } }
sp.doSecondPass( getEntityBindingMap() );
private void processSecondPasses(ArrayList<? extends SecondPass> secondPasses) { if ( secondPasses == null ) { return; } for ( SecondPass secondPass : secondPasses ) { secondPass.doSecondPass( getEntityBindingMap() ); } secondPasses.clear(); }
private void processEndOfQueue(List<FkSecondPass> endOfQueueFkSecondPasses) { /* * If a second pass raises a recoverableException, queue it for next round * stop of no pass has to be processed or if the number of pass to processes * does not diminish between two rounds. * If some failing pass remain, raise the original exception */ boolean stopProcess = false; RuntimeException originalException = null; while ( !stopProcess ) { List<FkSecondPass> failingSecondPasses = new ArrayList<>(); for ( FkSecondPass pass : endOfQueueFkSecondPasses ) { try { pass.doSecondPass( getEntityBindingMap() ); } catch (RecoverableException e) { failingSecondPasses.add( pass ); if ( originalException == null ) { originalException = (RuntimeException) e.getCause(); } } } stopProcess = failingSecondPasses.size() == 0 || failingSecondPasses.size() == endOfQueueFkSecondPasses.size(); endOfQueueFkSecondPasses = failingSecondPasses; } if ( endOfQueueFkSecondPasses.size() > 0 ) { throw originalException; } }
sp.doSecondPass( getEntityBindingMap() );