public synchronized void validateFile() throws ActiveMQException { try { if (file == null) { if (messageID <= 0) { throw new RuntimeException("MessageID not set on LargeMessage"); } file = createFile(); openFile(); bodySize = file.size(); } } catch (Exception e) { // TODO: There is an IO_ERROR on trunk now, this should be used here instead throw new ActiveMQInternalErrorException(e.getMessage(), e); } }
private long getBodySize() throws ActiveMQException { try { if (bodySize < 0) { if (file != null) { bodySize = file.size(); } else { SequentialFile tmpFile = createFile(); bodySize = tmpFile.size(); tmpFile.close(); } } return bodySize; } catch (Exception e) { ActiveMQIOErrorException errorException = new ActiveMQIOErrorException(); errorException.initCause(e); throw errorException; } }