if (webSocketClose != null) {
try {
final Map<Class<?>, Object> params = new HashMap<Class<?>, Object>();
params.put(Session.class, session);
params.put(Map.class, session.getPathParameters());
params.put(CloseReason.class, new CloseReason(CloseReason.CloseCodes.getCloseCode(cm.getReason()), cm.getString()));
invokeMethod(params, webSocketClose, session);
} catch (Exception e) {
AnnotatedEndpoint.this.onError(session, e);
}
}