Guest User

Untitled

a guest
Dec 11th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. public class AuditService {
  2. private CopyOnWriteArrayList<Audit> copyWrite;
  3.  
  4. public void flush(Audit... audits) {
  5. Collection<Audit> auditCollection = Arrays.asList(audits);
  6. this.copyWrite.addAll(auditCollection);
  7.  
  8. this.copyWrite.forEach(audit -> {
  9. try {
  10. // save audit object on database
  11. this.copyWrite.remove(audit);
  12. } catch (DataAccessException e) {
  13. // log it
  14. }
  15.  
  16. });
  17. }
  18. }
Add Comment
Please, Sign In to add comment