RemoteEndpointImpl remoteEndpoint = (RemoteEndpointImpl) request.getAttribute(RemoteEndpointImpl.class.getName());
if (remoteEndpoint != null) {
if (event.isCancelled() || event.isClosedByClient()) {
remoteEndpoint.status().status(event.isCancelled() ? Status.STATUS.UNEXPECTED_CLOSE : Status.STATUS.CLOSED_BY_CLIENT);
request.removeAttribute(RemoteEndpointImpl.class.getName());
trackedUUID.remove(r.uuid());
invokeOpenOrClose(onCloseMethod, remoteEndpoint);
} else if (event.isResumedOnTimeout() || event.isResuming()) {
remoteEndpoint.status().status(Status.STATUS.CLOSED_BY_TIMEOUT);