public void cachePackage(final byte[] body) throws Exception { checkOpen(); cachedChannel.position(cachedChannel.size()); cachedChannel.write(ByteBuffer.wrap(body)); close(); }
private synchronized void readCache(final long position) { try { if (position < readCachePositionStart || position > readCachePositionEnd) { checkOpen(); if (position > cachedChannel.size()) { throw new ArrayIndexOutOfBoundsException("position > " + cachedChannel.size()); } readCachePositionStart = position / bufferSize * bufferSize; cachedChannel.position(readCachePositionStart); if (readCache == null) { readCache = ByteBuffer.allocate(bufferSize); } readCache.clear(); readCachePositionEnd = readCachePositionStart + cachedChannel.read(readCache) - 1; } } catch (Exception e) { ActiveMQClientLogger.LOGGER.errorReadingCache(e); throw new RuntimeException(e.getMessage(), e); } finally { close(); } }
@Override protected void finalize() { close(); if (cachedFile != null && cachedFile.exists()) { try { cachedFile.delete(); } catch (Exception e) { ActiveMQClientLogger.LOGGER.errorFinalisingCache(e); } } } }
@Override protected void finalize() { close(); if (cachedFile != null && cachedFile.exists()) { try { cachedFile.delete(); } catch (Exception e) { ActiveMQClientLogger.LOGGER.errorFinalisingCache(e); } } } }
@Override public synchronized void close() { if (fileCache != null) { fileCache.close(); } }
@Override protected void finalize() { close(); if (cachedFile != null && cachedFile.exists()) { try { cachedFile.delete(); } catch (Exception e) { ActiveMQClientLogger.LOGGER.errorFinalisingCache(e); } } } }
public void cachePackage(final byte[] body) throws Exception { checkOpen(); cachedChannel.position(cachedChannel.size()); cachedChannel.write(ByteBuffer.wrap(body)); close(); }
@Override public synchronized void close() { if (fileCache != null) { fileCache.close(); } }
@Override protected void finalize() { close(); if (cachedFile != null && cachedFile.exists()) { try { cachedFile.delete(); } catch (Exception e) { ActiveMQClientLogger.LOGGER.errorFinalisingCache(e); } } } }
@Override public synchronized void close() { if (fileCache != null) { fileCache.close(); } }
public void cachePackage(final byte[] body) throws Exception { checkOpen(); cachedChannel.position(cachedChannel.size()); cachedChannel.write(ByteBuffer.wrap(body)); close(); }
public void cachePackage(final byte[] body) throws Exception { checkOpen(); cachedChannel.position(cachedChannel.size()); cachedChannel.write(ByteBuffer.wrap(body)); close(); }
public void cachePackage(final byte[] body) throws Exception { final FileChannel cachedChannel = checkOpen(); cachedChannel.position(cachedChannel.size()); cachedChannel.write(ByteBuffer.wrap(body)); close(); }
@Override public synchronized void close() { if (fileCache != null) { fileCache.close(); } }
public void cachePackage(final byte[] body) throws Exception { final FileChannel cachedChannel = checkOpen(); cachedChannel.position(cachedChannel.size()); cachedChannel.write(ByteBuffer.wrap(body)); close(); }
@Override protected void finalize() { close(); if (cachedFile != null && cachedFile.exists()) { try { cachedFile.delete(); } catch (Exception e) { ActiveMQClientLogger.LOGGER.errorFinalisingCache(e); } } } }
@Override protected void finalize() { close(); if (cachedFile != null && cachedFile.exists()) { try { cachedFile.delete(); } catch (Exception e) { ActiveMQClientLogger.LOGGER.errorFinalisingCache(e); } } } }
public void cachePackage(final byte[] body) throws Exception { final FileChannel cachedChannel = checkOpen(); cachedChannel.position(cachedChannel.size()); cachedChannel.write(ByteBuffer.wrap(body)); close(); }
@Override public synchronized void close() { if (fileCache != null) { fileCache.close(); } }
@Override public synchronized void close() { if (fileCache != null) { fileCache.close(); } }