com.zipwhip.api.CopyFutureStatusToNestedFuture Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zipwhip-api Show documentation
Show all versions of zipwhip-api Show documentation
Java client to support applications powered by the Zipwhip Cloud
The newest version!
package com.zipwhip.api;
import com.zipwhip.concurrent.ObservableFuture;
import com.zipwhip.events.Observer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* When the future finishes, if it's the current "connectFuture" clean up the references.
*/
public class CopyFutureStatusToNestedFuture implements Observer> {
private final static Logger LOGGER = LoggerFactory.getLogger(CopyFutureStatusToNestedFuture.class);
final ObservableFuture nestedFuture;
public CopyFutureStatusToNestedFuture(ObservableFuture nestedFuture) {
this.nestedFuture = nestedFuture;
}
@Override
public void notify(Object sender, ObservableFuture future) {
LOGGER.trace(String.format("Cloning the state from %s to %s", future, nestedFuture));
// notify people that care.
NestedObservableFuture.syncState(future, nestedFuture);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy