Integer respId = (Integer) resp.getId();
SPFSession session = (SPFSession) sessions.remove(respId);
FutureSPFResult result = (FutureSPFResult) results.remove(respId);
DNSLookupContinuation cont = (DNSLookupContinuation) session.getAttribute(ATTRIBUTE_STAGED_EXECUTOR_CONTINUATION);
DNSResponse response;
if (resp.getException() != null) {
response = new DNSResponse((TimeoutException) resp.getException());
} else {
response = new DNSResponse((List) resp.getValue());
}
try {
cont = cont.getListener().onDNSResponse(response, session);
if (cont != null) {
invokeAsynchService(session, result, cont, false);
} else {
execute(session, result, false);