fileCache.cachePackage(chunk); if (fileCache != null) { try { fileCache.cachePackage(chunk); } catch (Exception e) { ActiveMQClientLogger.LOGGER.errorAddingPacket(e);
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(); } }
public synchronized byte getByteFromCache(final long position) { readCache(position); return readCache.get((int) (position - readCachePositionStart)); }
fileCache.cachePackage(chunk); if (fileCache != null) { try { fileCache.cachePackage(chunk); } catch (Exception e) { ActiveMQClientLogger.LOGGER.errorAddingPacket(e);
fileCache.cachePackage(chunk); if (fileCache != null) { try { fileCache.cachePackage(chunk); } catch (Exception e) { ActiveMQClientLogger.LOGGER.errorAddingPacket(e);
fileCache.cachePackage(chunk); if (fileCache != null) { try { fileCache.cachePackage(chunk); } catch (Exception e) { ActiveMQClientLogger.LOGGER.errorAddingPacket(e);
fileCache.cachePackage(chunk); if (fileCache != null) { try { fileCache.cachePackage(chunk); } catch (Exception e) { ActiveMQClientLogger.LOGGER.errorAddingPacket(e);
fileCache.cachePackage(chunk); if (fileCache != null) { try { fileCache.cachePackage(chunk); } catch (Exception e) { ActiveMQClientLogger.LOGGER.errorAddingPacket(e);
fileCache.cachePackage(chunk); if (fileCache != null) { try { fileCache.cachePackage(chunk); } catch (Exception e) { ActiveMQClientLogger.LOGGER.errorAddingPacket(e);
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(); } }
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(); } }
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(); } }
private synchronized void readCache(final long position) { try { if (position < readCachePositionStart || position > readCachePositionEnd) { final FileChannel cachedChannel = 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(); } }
private synchronized void readCache(final long position) { try { if (position < readCachePositionStart || position > readCachePositionEnd) { final FileChannel cachedChannel = 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(); } }
private synchronized void readCache(final long position) { try { if (position < readCachePositionStart || position > readCachePositionEnd) { final FileChannel cachedChannel = 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(); } }
public LargeMessageControllerImpl(final ClientConsumerInternal consumerInternal, final long totalSize, final long readTimeout, final File cachedFile, final int bufferSize) { this.consumerInternal = consumerInternal; this.readTimeout = readTimeout; this.totalSize = totalSize; if (cachedFile == null) { fileCache = null; } else { fileCache = new FileCache(cachedFile); } this.bufferSize = bufferSize; }
public LargeMessageControllerImpl(final ClientConsumerInternal consumerInternal, final long totalSize, final long readTimeout, final File cachedFile, final int bufferSize) { this.consumerInternal = consumerInternal; this.readTimeout = readTimeout; this.totalSize = totalSize; if (cachedFile == null) { fileCache = null; } else { fileCache = new FileCache(cachedFile); } this.bufferSize = bufferSize; }
public LargeMessageControllerImpl(final ClientConsumerInternal consumerInternal, final long totalSize, final long readTimeout, final File cachedFile, final int bufferSize) { this.consumerInternal = consumerInternal; this.readTimeout = readTimeout; this.totalSize = totalSize; if (cachedFile == null) { fileCache = null; } else { fileCache = new FileCache(cachedFile); } this.bufferSize = bufferSize; }
public LargeMessageControllerImpl(final ClientConsumerInternal consumerInternal, final long totalSize, final long readTimeout, final File cachedFile, final int bufferSize) { this.consumerInternal = consumerInternal; this.readTimeout = readTimeout; this.totalSize = totalSize; if (cachedFile == null) { fileCache = null; } else { fileCache = new FileCache(cachedFile); } this.bufferSize = bufferSize; }
public LargeMessageControllerImpl(final ClientConsumerInternal consumerInternal, final long totalSize, final long readTimeout, final File cachedFile, final int bufferSize) { this.consumerInternal = consumerInternal; this.readTimeout = readTimeout; this.totalSize = totalSize; if (cachedFile == null) { fileCache = null; } else { fileCache = new FileCache(cachedFile); } this.bufferSize = bufferSize; }