Future future = (Future) currentFuture.get(); currentFuture.set(null); return future;
advisor = (InstanceAdvisor) in.readObject(); currentFuture = new ThreadLocal(); advisor.getMetaData().addMetaData(CURRENT_FUTURE, CURRENT_FUTURE, currentFuture, PayloadKey.TRANSIENT);
this.advisor = advisor;
try { Future oldFuture = getFuture(); if (oldFuture != null) oldFuture.release(); } catch (Exception e) { // eat it. } currentFuture.set(future);
out.writeObject(advisor);