@Override public synchronized void deleteFile() throws Exception { validateFile(); releaseResources(); storageManager.deleteLargeMessageFile(this); }
/** * */ protected SequentialFile createFile() { return storageManager.createFileForLargeMessage(getMessageID(), durable); }
@Override public LargeBodyEncoder getBodyEncoder() throws ActiveMQException { validateFile(); return new DecodingContext(); }
@Override public void stop() throws Exception { stop(false, true); }
@Override public void storeID(final long journalID, final long id) throws Exception { readLock(); try { bindingsJournal.appendAddRecord(journalID, JournalRecordIds.ID_COUNTER_RECORD, BatchingIDGenerator.createIDEncodingSupport(id), true); } finally { readUnLock(); } }
@Override public Message copy() { SequentialFile newfile = storageManager.createFileForLargeMessage(messageID, durable); Message newMessage = new LargeServerMessageImpl(this, properties, newfile, messageID); return newMessage; }
@Override public void stop(boolean ioCriticalError, boolean sendFailover) throws Exception { try { enterCritical(CRITICAL_STOP); synchronized (this) { if (internalStop(ioCriticalError, sendFailover)) return; } } finally { leaveCritical(CRITICAL_STOP); } }
OperationContext getContext(final boolean sync) { if (sync) { return getContext(); } else { return DummyOperationContext.getInstance(); } }
@Override public synchronized void persistIdGenerator() { if (journalLoaded && idGenerator != null) { // Must call close to make sure last id is persisted idGenerator.persistCurrentID(); } }
@Override public synchronized int getMemoryEstimate() { if (memoryEstimate == -1) { // The body won't be on memory (aways on-file), so we don't consider this for paging memoryEstimate = getHeadersAndPropertiesEncodeSize() + DataConstants.SIZE_INT + getEncodeSize() + (16 + 4) * 2 + 1; } return memoryEstimate; }
@Override public void setContext(final OperationContext context) { OperationContextImpl.setContext(context); }
@Override public OperationContext getContext() { return OperationContextImpl.getContext(executorFactory); }
protected void checkForLongs() { if (forceLongs) { JournalStorageManager manager = (JournalStorageManager) server.getStorageManager(); BatchingIDGenerator idGenerator = (BatchingIDGenerator) manager.getIDGenerator(); idGenerator.forceNextID((Integer.MAX_VALUE) + 1L); } }
@Override public synchronized void done() { stored++; checkTasks(); }
@Override public SequentialFile getFile() throws ActiveMQException { validateFile(); return file; }
protected SequentialFile createFileForLargeMessage(final long messageID, final boolean durable) { if (durable) { return createFileForLargeMessage(messageID, LargeMessageExtension.DURABLE); } else { return createFileForLargeMessage(messageID, LargeMessageExtension.TEMPORARY); } }
@Override public void executeOnCompletion(IOCallback runnable, boolean storeOnly) { executeOnCompletion(runnable); }
@Override public void stop() throws Exception { stop(false, true); }
@Override public synchronized void pageSyncDone() { paged++; checkTasks(); }
@Override public synchronized void replicationDone() { replicated++; checkTasks(); }