本文整理匯總了Java中org.eclipse.jetty.client.api.Request.abort方法的典型用法代碼示例。如果您正苦於以下問題:Java Request.abort方法的具體用法?Java Request.abort怎麽用?Java Request.abort使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jetty.client.api.Request
的用法示例。
在下文中一共展示了Request.abort方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getRequestAbortListener
import org.eclipse.jetty.client.api.Request; //導入方法依賴的package包/類
private Request.BeginListener getRequestAbortListener(final SalesforceHttpRequest request) {
return new Request.BeginListener() {
@Override
public void onBegin(Request redirect) {
Throwable cause = request.getAbortCause();
if (cause != null) {
redirect.abort(cause);
}
}
};
}
示例2: handleCancelEvent
import org.eclipse.jetty.client.api.Request; //導入方法依賴的package包/類
private void handleCancelEvent(JSONObject data) {
try {
int requestId = data.getInt("id");
logger.debug("Received cancel for request {}", requestId);
// Find and abort running request
if (runningRequests.containsKey(requestId)) {
Request request = runningRequests.get(requestId);
request.abort(new InterruptedException());
runningRequests.remove(requestId);
}
} catch (JSONException e) {
logger.error("{}", e.getMessage());
}
}
示例3: onClientRequestFailure
import org.eclipse.jetty.client.api.Request; //導入方法依賴的package包/類
protected void onClientRequestFailure(Request proxyRequest, HttpServletRequest request, Throwable failure) {
LOG.error(getRequestId(request) + " client request failure", failure);
proxyRequest.abort(failure);
}