@Override
protected void onFullCloseMessage(final WebSocketChannel channel, BufferedBinaryMessage message) throws IOException {
Pooled<ByteBuffer[]> data = message.getData();
final ByteBuffer buffer = WebSockets.mergeBuffers(data.getResource());
final CloseMessage cm = new CloseMessage(buffer);
data.free();
try {
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);
}
}