public abstract class AbstractSequentialFile extends Object implements SequentialFile
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractSequentialFile.DelegateCallback |
protected class |
AbstractSequentialFile.LocalBufferObserver |
| Modifier and Type | Field and Description |
|---|---|
protected SequentialFileFactory |
factory |
protected long |
fileSize |
protected AtomicLong |
position |
protected TimedBuffer |
timedBuffer |
protected TimedBufferObserver |
timedBufferObserver
Instead of having AIOSequentialFile implementing the Observer, I have done it on an inner class.
|
protected Executor |
writerExecutor
Used for asynchronous writes
|
| Constructor and Description |
|---|
AbstractSequentialFile(String directory,
File file,
SequentialFileFactory factory,
Executor writerExecutor) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
copyTo(SequentialFile newFileName) |
void |
delete() |
boolean |
exists() |
boolean |
fits(int size) |
protected File |
getFile() |
String |
getFileName() |
protected ByteBuffer |
newBuffer(int size,
int limit) |
long |
position() |
void |
position(long pos) |
void |
renameTo(String newFileName) |
void |
setTimedBuffer(TimedBuffer buffer) |
void |
write(EncodingSupport bytes,
boolean sync) |
void |
write(EncodingSupport bytes,
boolean sync,
IOAsyncTask callback) |
void |
write(HornetQBuffer bytes,
boolean sync) |
void |
write(HornetQBuffer bytes,
boolean sync,
IOAsyncTask callback) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcalculateBlockStart, cloneFile, fill, getAlignment, isOpen, open, open, read, read, size, sync, waitForClose, writeDirect, writeDirect, writeInternalprotected final SequentialFileFactory factory
protected long fileSize
protected final AtomicLong position
protected TimedBuffer timedBuffer
protected final TimedBufferObserver timedBufferObserver
protected final Executor writerExecutor
public AbstractSequentialFile(String directory, File file, SequentialFileFactory factory, Executor writerExecutor)
file - directory - public final boolean exists()
exists in interface SequentialFilepublic final String getFileName()
getFileName in interface SequentialFilepublic final void delete()
throws Exception
delete in interface SequentialFileExceptionpublic void copyTo(SequentialFile newFileName) throws Exception
copyTo in interface SequentialFileExceptionpublic void position(long pos)
throws Exception
position in interface SequentialFileExceptionpublic long position()
throws Exception
position in interface SequentialFileExceptionpublic final void renameTo(String newFileName) throws Exception
renameTo in interface SequentialFileExceptionpublic void close()
throws Exception
close in interface SequentialFileExceptionpublic final boolean fits(int size)
fits in interface SequentialFilepublic void setTimedBuffer(TimedBuffer buffer)
setTimedBuffer in interface SequentialFilepublic void write(HornetQBuffer bytes, boolean sync, IOAsyncTask callback) throws Exception
write in interface SequentialFileExceptionpublic void write(HornetQBuffer bytes, boolean sync) throws Exception
write in interface SequentialFileExceptionpublic void write(EncodingSupport bytes, boolean sync, IOAsyncTask callback) throws Exception
write in interface SequentialFileExceptionpublic void write(EncodingSupport bytes, boolean sync) throws Exception
write in interface SequentialFileExceptionprotected File getFile()
protected ByteBuffer newBuffer(int size, int limit)
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.