blob: a7ce5bb61a24763350ddc667fb2dabb572944f70 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.clustercontroller.utils.communication.async;
public abstract class PipedAsyncOperation<S, T> extends RedirectedAsyncOperation<S, T> {
private T result;
public PipedAsyncOperation(AsyncOperation<S> source) {
super(source);
setOnCompleteTask(new AsyncCallback<S>() {
@Override
public void done(AsyncOperation<S> op) {
result = convertResult(op.getResult());
}
});
}
public abstract T convertResult(S result);
@Override
public T getResult() {
return result;
}
}
|