Issue #3835 - add default methods to WebSocketSessionListener

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2019-07-03 11:33:32 +10:00
parent 196833d15e
commit 1554b3dbb1
8 changed files with 9 additions and 54 deletions

View File

@ -524,11 +524,6 @@ public class ClientContainer extends ContainerLifeCycle implements WebSocketCont
this.listener = listener;
}
@Override
public void onSessionCreated(WebSocketSession session)
{
}
@Override
public void onSessionOpened(WebSocketSession session)
{

View File

@ -96,11 +96,6 @@ public class SessionTrackingTest
CountDownLatch closedLatch = new CountDownLatch(2);
wsServerFactory.addSessionListener(new WebSocketSessionListener()
{
@Override
public void onSessionCreated(WebSocketSession session)
{
}
@Override
public void onSessionOpened(WebSocketSession session)
{

View File

@ -147,16 +147,6 @@ public class ConcurrentConnectTest
{
public CountDownLatch closeLatch = new CountDownLatch(MAX_CONNECTIONS);
@Override
public void onSessionCreated(WebSocketSession session)
{
}
@Override
public void onSessionOpened(WebSocketSession session)
{
}
@Override
public void onSessionClosed(WebSocketSession session)
{

View File

@ -139,11 +139,6 @@ public class BadNetworkTest
WebSocketServerFactory wssf = (WebSocketServerFactory)context.getServletContext().getAttribute(WebSocketServletFactory.class.getName());
wssf.addSessionListener(new WebSocketSessionListener()
{
@Override
public void onSessionCreated(WebSocketSession session)
{
}
@Override
public void onSessionOpened(WebSocketSession session)
{

View File

@ -63,16 +63,6 @@ public class ClientOpenSessionTracker implements Connection.Listener, WebSocketS
this.closeConnectionLatch.countDown();
}
@Override
public void onSessionCreated(WebSocketSession session)
{
}
@Override
public void onSessionOpened(WebSocketSession session)
{
}
@Override
public void onSessionClosed(WebSocketSession session)
{

View File

@ -102,16 +102,6 @@ public class ClientSessionsTest
client.addSessionListener(new WebSocketSessionListener()
{
@Override
public void onSessionCreated(WebSocketSession session)
{
}
@Override
public void onSessionOpened(WebSocketSession session)
{
}
@Override
public void onSessionClosed(WebSocketSession session)
{

View File

@ -43,12 +43,6 @@ public class SessionTracker extends AbstractLifeCycle implements WebSocketSessio
sessions.add(session);
}
@Override
public void onSessionOpened(WebSocketSession session)
{
// do nothing
}
@Override
public void onSessionClosed(WebSocketSession session)
{

View File

@ -20,9 +20,15 @@ package org.eclipse.jetty.websocket.common;
public interface WebSocketSessionListener
{
void onSessionCreated(WebSocketSession session);
default void onSessionCreated(WebSocketSession session)
{
}
void onSessionOpened(WebSocketSession session);
default void onSessionOpened(WebSocketSession session)
{
}
void onSessionClosed(WebSocketSession session);
default void onSessionClosed(WebSocketSession session)
{
}
}