@SuppressWarnings("synthetic-access")
public void receivedNodeHello(FcpConnection fcpConnection, NodeHello nodeHello) {
FcpClient.this.nodeHello = nodeHello;
- completionLatch.countDown();
+ complete();
}
}.execute();
}
fcpConnection.sendMessage(clientGet);
} catch (IOException ioe1) {
getResult.success(false).exception(ioe1);
- completionLatch.countDown();
+ complete();
}
} else {
getResult.success(false).errorCode(getFailed.getCode());
- completionLatch.countDown();
+ complete();
}
}
return;
}
getResult.success(true).contentType(allData.getContentType()).contentLength(allData.getDataLength()).inputStream(allData.getPayloadInputStream());
- completionLatch.countDown();
+ complete();
}
}.execute();
@Override
public void receivedEndListPeers(FcpConnection fcpConnection, EndListPeers endListPeers) {
if (endListPeers.getIdentifier().equals(identifier)) {
- completionLatch.countDown();
+ complete();
}
}
}.execute();
*/
@Override
public void receivedPeer(FcpConnection fcpConnection, Peer peer) {
- completionLatch.countDown();
+ complete();
}
}.execute();
}
*/
@Override
public void receivedPeer(FcpConnection fcpConnection, Peer peer) {
- completionLatch.countDown();
+ complete();
}
}.execute();
}
*/
@Override
public void receivedPeerRemoved(FcpConnection fcpConnection, PeerRemoved peerRemoved) {
- completionLatch.countDown();
+ complete();
}
}.execute();
}
*/
@Override
public void receivedEndListPeerNotes(FcpConnection fcpConnection, EndListPeerNotes endListPeerNotes) {
- completionLatch.countDown();
+ complete();
}
}.execute();
return objectWrapper.get();
@Override
public void receivedPeer(FcpConnection fcpConnection, Peer receivedPeer) {
if (receivedPeer.getIdentity().equals(peer.getIdentity())) {
- completionLatch.countDown();
+ complete();
}
}
}.execute();
@Override
public void receivedSSKKeypair(FcpConnection fcpConnection, SSKKeypair sskKeypair) {
sskKeypairWrapper.set(sskKeypair);
- completionLatch.countDown();
+ complete();
}
}.execute();
return sskKeypairWrapper.get();
*/
@Override
public void receivedEndListPersistentRequests(FcpConnection fcpConnection, EndListPersistentRequests endListPersistentRequests) {
- completionLatch.countDown();
+ complete();
}
}.execute();
return requests.values();
return;
}
pluginReplies.putAll(fcpPluginReply.getReplies());
- completionLatch.countDown();
+ complete();
}
}.execute();
@Override
public void receivedNodeData(FcpConnection fcpConnection, NodeData nodeData) {
nodeDataWrapper.set(nodeData);
- completionLatch.countDown();
+ complete();
}
}.execute();
return nodeDataWrapper.get();
private abstract class ExtendedFcpAdapter extends FcpAdapter {
/** The count down latch used to wait for completion. */
- protected final CountDownLatch completionLatch = new CountDownLatch(1);
+ private final CountDownLatch completionLatch = new CountDownLatch(1);
/** The FCP exception, if any. */
protected FcpException fcpException;
public abstract void run() throws IOException;
/**
+ * Signals completion of the command processing.
+ */
+ protected void complete() {
+ completionLatch.countDown();
+ }
+
+ /**
* {@inheritDoc}
*/
@Override