类org.eclipse.lsp4j.jsonrpc.messages.CancelParams源码实例Demo

下面列出了怎么用org.eclipse.lsp4j.jsonrpc.messages.CancelParams的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: lsp4j   文件: RemoteEndpoint.java
/**
 * Cancellation is handled inside this class and not forwarded to the local endpoint.
 * 
 * @return {@code true} if the given message is a cancellation notification,
 *         {@code false} if it can be handled by the local endpoint
 */
protected boolean handleCancellation(NotificationMessage notificationMessage) {
	if (MessageJsonHandler.CANCEL_METHOD.getMethodName().equals(notificationMessage.getMethod())) {
		Object cancelParams = notificationMessage.getParams();
		if (cancelParams != null) {
			if (cancelParams instanceof CancelParams) {
				synchronized (receivedRequestMap) {
					String id = ((CancelParams) cancelParams).getId();
					CompletableFuture<?> future = receivedRequestMap.get(id);
					if (future != null)
						future.cancel(true);
					else
						LOG.warning("Unmatched cancel notification for request id " + id);
				}
				return true;
			} else {
				LOG.warning("Cancellation support is disabled, since the '" + MessageJsonHandler.CANCEL_METHOD.getMethodName() + "' method has been registered explicitly.");
			}
		} else {
			LOG.warning("Missing 'params' attribute of cancel notification.");
		}
	}
	return false;
}
 
源代码2 项目: n4js   文件: PatchedRemoteEndpoint.java
@Override
protected boolean handleCancellation(NotificationMessage notificationMessage) {
	if (MessageJsonHandler.CANCEL_METHOD.getMethodName().equals(notificationMessage.getMethod())) {
		Object cancelParams = notificationMessage.getParams();
		if (cancelParams != null) {
			if (cancelParams instanceof CancelParams) {
				String id = ((CancelParams) cancelParams).getId();
				LOG.debug("Client cancels: " + id);
				CompletableFuture<?> future;
				synchronized (receivedRequestMap) {
					future = receivedRequestMap.remove(id);
				}
				if (future != null)
					future.cancel(true);
				else
					LOG.debug("Unmatched cancel notification for request id " + id);
				return true;
			} else {
				LOG.warn("Cancellation support is disabled, since the '"
						+ MessageJsonHandler.CANCEL_METHOD.getMethodName()
						+ "' method has been registered explicitly.");
			}
		} else {
			LOG.warn("Missing 'params' attribute of cancel notification.");
		}
	}
	return false;
}
 
源代码3 项目: lsp4j   文件: RemoteEndpoint.java
protected void sendCancelNotification(Either<String, Number> id) {
	CancelParams cancelParams = new CancelParams();
	cancelParams.setRawId(id);
	notify(MessageJsonHandler.CANCEL_METHOD.getMethodName(), cancelParams);
}
 
源代码4 项目: MSPaintIDE   文件: DefaultRequestManager.java
@Override
public void cancelRequest(CancelParams params) {

}
 
源代码5 项目: MSPaintIDE   文件: RequestManager.java
void cancelRequest(CancelParams params); 
 类所在包
 类方法
 同包方法