{
doInternalWrite(bytes, sync, callback);
}
catch (IOException e)
{
factory.onIOError(new HornetQIOErrorException(e.getMessage(), e), e.getMessage(), this);
}
}
else
{
// This is a flow control on writing, just like maxAIO on libaio
maxIOSemaphore.acquire();
writerExecutor.execute(new Runnable()
{
public void run()
{
try
{
try
{
doInternalWrite(bytes, sync, callback);
}
catch (IOException e)
{
HornetQJournalLogger.LOGGER.errorSubmittingWrite(e);
factory.onIOError(new HornetQIOErrorException(e.getMessage(), e), e.getMessage(), NIOSequentialFile.this);
callback.onError(HornetQExceptionType.IO_ERROR.getCode(), e.getMessage());
}
catch (Throwable e)
{
HornetQJournalLogger.LOGGER.errorSubmittingWrite(e);