If you think the Android project android-deferred-object listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/*
* Copyright 2012 Cristian Vrabie, Evelina Vrabie
*/*www.java2s.com*/
* This file is part of android-deferred-object.
*
* android-deferred-object is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
* android-deferred-object is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with Foobar. If not, see <http://www.gnu.org/licenses/>.
*/package org.codeandmagic.deferredobject;
/** User: cvrabie1 Date: 12/07/2012 */publicclass PromiseProxy<Resolved,Rejected,Progress> extends AbstractPromise<Resolved,Rejected,Progress>{
private Promise<Resolved,Rejected,Progress> proxiedPromise = null;
public Promise<Resolved, Rejected, Progress> getProxiedPromise() {
return proxiedPromise;
}
publicvoid setProxiedPromise(Promise<Resolved, Rejected, Progress> proxiedPromise) {
this.proxiedPromise = proxiedPromise;
proxiedPromise.then(new ResolveCallback<Resolved>() {
@Override
publicvoid onResolve(Resolved resolved) {
PromiseProxy.this.resolve(resolved);
}
}, new RejectCallback<Rejected>() {
@Override
publicvoid onReject(Rejected rejected) {
PromiseProxy.this.reject(rejected);
}
}, new ProgressCallback<Progress>() {
@Override
publicvoid onProgress(Progress progress) {
PromiseProxy.this.notify(progress);
}
});
}
}