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,7 +199,19 @@ public abstract class AbstractConnection implements Connection
|
||||||
LOG.debug("onOpen {}", this);
|
LOG.debug("onOpen {}", this);
|
||||||
|
|
||||||
for (Listener listener : _listeners)
|
for (Listener listener : _listeners)
|
||||||
|
onOpened(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onOpened(Listener listener)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
listener.onOpened(this);
|
listener.onOpened(this);
|
||||||
|
}
|
||||||
|
catch (Throwable x)
|
||||||
|
{
|
||||||
|
LOG.info("Failure while notifying listener " + listener, x);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -209,7 +221,19 @@ public abstract class AbstractConnection implements Connection
|
||||||
LOG.debug("onClose {}",this);
|
LOG.debug("onClose {}",this);
|
||||||
|
|
||||||
for (Listener listener : _listeners)
|
for (Listener listener : _listeners)
|
||||||
|
onClosed(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onClosed(Listener listener)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
listener.onClosed(this);
|
listener.onClosed(this);
|
||||||
|
}
|
||||||
|
catch (Throwable x)
|
||||||
|
{
|
||||||
|
LOG.info("Failure while notifying listener " + listener, x);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue