org.jboss.system.server.profileservice.repository.clustered.local.file
Class FileReadAction
java.lang.Object
org.jboss.system.server.profileservice.repository.clustered.sync.AbstractSynchronizationAction<FileBasedSynchronizationActionContext>
org.jboss.system.server.profileservice.repository.clustered.local.file.FileReadAction
- All Implemented Interfaces:
- SynchronizationAction<FileBasedSynchronizationActionContext>, SynchronizationReadAction<FileBasedSynchronizationActionContext>, TwoPhaseCommitAction<FileBasedSynchronizationActionContext>
public class FileReadAction
- extends AbstractSynchronizationAction<FileBasedSynchronizationActionContext>
- implements SynchronizationReadAction<FileBasedSynchronizationActionContext>
SynchronizationReadAction
that reads from a File
.
- Version:
- $Revision: $
- Author:
- Brian Stansberry
Methods inherited from class org.jboss.system.server.profileservice.repository.clustered.sync.AbstractSynchronizationAction |
cancel, commit, complete, getContext, getMarkedRemovedItem, getRepositoryContentModification, getState, isCancelled, isComplete, prepare, rollback |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_CHUNK_BUFFER_SIZE
public static final int MAX_CHUNK_BUFFER_SIZE
- Max file transfer buffer size that we read at a time.
This influences the number of times that we will invoke disk read/write file
operations versus how much memory we will consume for a file transfer.
- See Also:
- Constant Field Values
FileReadAction
public FileReadAction(File file,
FileBasedSynchronizationActionContext context,
ContentModification modification)
- Create a new FileReadAction.
- Parameters:
file
- the file to readcontext
- the overall context of the modificationmodification
- the modification
getNextBytes
public ByteChunk getNextBytes()
throws IOException
- Description copied from interface:
SynchronizationReadAction
- Gets the next chunk of bytes from the item associated with this action.
Each call to this method will retrieve more bytes
- Specified by:
getNextBytes
in interface SynchronizationReadAction<FileBasedSynchronizationActionContext>
- Returns:
- a ByteChunk.
- Throws:
IOException
- if there is a problem reading the bytes.
doCancel
protected void doCancel()
- Specified by:
doCancel
in class AbstractSynchronizationAction<FileBasedSynchronizationActionContext>
doCommit
protected void doCommit()
- Specified by:
doCommit
in class AbstractSynchronizationAction<FileBasedSynchronizationActionContext>
doComplete
protected void doComplete()
throws Exception
- Specified by:
doComplete
in class AbstractSynchronizationAction<FileBasedSynchronizationActionContext>
- Throws:
Exception
doPrepare
protected boolean doPrepare()
- Specified by:
doPrepare
in class AbstractSynchronizationAction<FileBasedSynchronizationActionContext>
doRollbackFromCancelled
protected void doRollbackFromCancelled()
- Specified by:
doRollbackFromCancelled
in class AbstractSynchronizationAction<FileBasedSynchronizationActionContext>
doRollbackFromComplete
protected void doRollbackFromComplete()
- Specified by:
doRollbackFromComplete
in class AbstractSynchronizationAction<FileBasedSynchronizationActionContext>
doRollbackFromOpen
protected void doRollbackFromOpen()
- Specified by:
doRollbackFromOpen
in class AbstractSynchronizationAction<FileBasedSynchronizationActionContext>
doRollbackFromPrepared
protected void doRollbackFromPrepared()
- Specified by:
doRollbackFromPrepared
in class AbstractSynchronizationAction<FileBasedSynchronizationActionContext>
doRollbackFromRollbackOnly
protected void doRollbackFromRollbackOnly()
- Specified by:
doRollbackFromRollbackOnly
in class AbstractSynchronizationAction<FileBasedSynchronizationActionContext>
Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.