daily pastebin goal
31%
SHARE
TWEET

Untitled

a guest Dec 11th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top