// suspend pull threads
_sourcesConn.getConnectionStatus().suspendOnError(exception);
// send an error event to dispatcher through dbusEventBuffer
DbusEventInternalReadable errorEvent = null;
if (exception instanceof BootstrapDatabaseTooOldException)
{
errorEvent = _eventFactory.createErrorEvent(
new DbusErrorEvent(exception, DbusEventInternalWritable.BOOTSTRAPTOOOLD_ERROR_SRCID));
}
else if (exception instanceof PullerRetriesExhaustedException)
{
errorEvent = _eventFactory.createErrorEvent(
new DbusErrorEvent(exception, DbusEventInternalWritable.PULLER_RETRIES_EXPIRED));
}
else
{
throw new InvalidEventException("Got an unrecognizable exception ");
}
byte[] errorEventBytes = new byte[errorEvent.getRawBytes().limit()];
if (LOG.isDebugEnabled())
{
LOG.debug("error event size: " + errorEventBytes.length);
LOG.debug("error event:" + errorEvent.toString());
}
errorEvent.getRawBytes().get(errorEventBytes);
ByteArrayInputStream errIs = new ByteArrayInputStream(errorEventBytes);
ReadableByteChannel errRbc = Channels.newChannel(errIs);
boolean success = false;
int retryCounter = 0;