Add getLastHandler to WebSocketHandlerDecorator

This commit is contained in:
Rossen Stoyanchev
2013-06-19 09:46:21 -04:00
parent d20dabf1fb
commit 5feac07738
2 changed files with 50 additions and 0 deletions

View File

@@ -42,6 +42,14 @@ public class WebSocketHandlerDecorator implements WebSocketHandler {
return this.delegate;
}
public WebSocketHandler getLastHandler() {
WebSocketHandler result = delegate;
while (result instanceof WebSocketHandlerDecorator) {
result = ((WebSocketHandlerDecorator) result).getDelegate();
}
return result;
}
@Override
public void afterConnectionEstablished(WebSocketSession session) throws Exception {
this.delegate.afterConnectionEstablished(session);