Пример #1
0
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeObject(value);
   if (lockable) {
     try {
       if (!latch.await(1, TimeUnit.MINUTES)) throw new RuntimeException("Cannot serialize!!");
     } catch (InterruptedException e) {
       e.printStackTrace();
     }
     latch.close();
   }
 }
Пример #2
0
 public void blockAfter(Class... filter) {
   this.blockAfterFilter = new HashSet<Class>(Arrays.asList(filter));
   replicationLatch.close();
   blockingLatch.close();
 }