Fixes #2847 - Wrap Connection.Listener invocations in try/catch.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
e93dc59e10
commit
1a7eac5966
|
@ -199,8 +199,20 @@ public abstract class AbstractConnection implements Connection
|
|||
LOG.debug("onOpen {}", this);
|
||||
|
||||
for (Listener listener : _listeners)
|
||||
onOpened(listener);
|
||||
}
|
||||
|
||||
private void onOpened(Listener listener)
|
||||
{
|
||||
try
|
||||
{
|
||||
listener.onOpened(this);
|
||||
}
|
||||
catch (Throwable x)
|
||||
{
|
||||
LOG.info("Failure while notifying listener " + listener, x);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose()
|
||||
|
@ -209,8 +221,20 @@ public abstract class AbstractConnection implements Connection
|
|||
LOG.debug("onClose {}",this);
|
||||
|
||||
for (Listener listener : _listeners)
|
||||
onClosed(listener);
|
||||
}
|
||||
|
||||
private void onClosed(Listener listener)
|
||||
{
|
||||
try
|
||||
{
|
||||
listener.onClosed(this);
|
||||
}
|
||||
catch (Throwable x)
|
||||
{
|
||||
LOG.info("Failure while notifying listener " + listener, x);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EndPoint getEndPoint()
|
||||
|
|
Loading…
Reference in New Issue