fr.profi.mzdb.util.concurrent.CallableCallback Maven / Gradle / Ivy
package fr.profi.mzdb.util.concurrent;
import java.util.concurrent.Callable;
/**
* @author JeT
*
*/
public class CallableCallback implements Callable {
private final Callable callable;
private final Callback callback;
/**
* @param callback
*/
public CallableCallback(Callable callable, Callback callback) {
super();
this.callable = callable;
this.callback = callback;
}
/*
* (non-Javadoc)
*
* @see java.util.concurrent.Callable#call()
*/
@Override
public V call() throws Exception {
V result = this.callable.call();
if (this.callback != null) {
this.callback.onCompletion(result);
}
return result;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy