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(); } }
public void blockAfter(Class... filter) { this.blockAfterFilter = new HashSet<Class>(Arrays.asList(filter)); replicationLatch.close(); blockingLatch.close(); }