org.jboss.system.server.profileservice.repository.clustered.local.file
Class AddContentStreamAction
java.lang.Object
org.jboss.system.server.profileservice.repository.clustered.sync.AbstractSynchronizationAction<T>
org.jboss.system.server.profileservice.repository.clustered.sync.AbstractContentMetadataMutatorAction<FileBasedSynchronizationActionContext>
org.jboss.system.server.profileservice.repository.clustered.local.file.AbstractLocalContentChangeAction
org.jboss.system.server.profileservice.repository.clustered.local.file.AbstractFileWriteAction
org.jboss.system.server.profileservice.repository.clustered.local.file.AddContentStreamAction
- All Implemented Interfaces:
- SynchronizationAction<FileBasedSynchronizationActionContext>, SynchronizationReadAction<FileBasedSynchronizationActionContext>, TwoPhaseCommitAction<FileBasedSynchronizationActionContext>
public class AddContentStreamAction
- extends AbstractFileWriteAction
- implements SynchronizationReadAction<FileBasedSynchronizationActionContext>
SynchronizationReadAction
that reads from a InputStream
and besides returning ByteChunk
s, also writes the stream contents
to a local file. Used for pushing content from a stream to both the cluster
and the local filesystem.
- 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
AddContentStreamAction
public AddContentStreamAction(InputStream stream,
File targetFile,
FileBasedSynchronizationActionContext context,
ContentModification modification)
- Create a new StreamReadAction.
- Parameters:
stream
- the stream 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.
getLogger
protected org.jboss.logging.Logger getLogger()
- Specified by:
getLogger
in class AbstractLocalContentChangeAction
doCancel
protected void doCancel()
- Overrides:
doCancel
in class AbstractLocalContentChangeAction
doCommit
protected void doCommit()
- Overrides:
doCommit
in class AbstractLocalContentChangeAction
doComplete
protected void doComplete()
throws Exception
- Overrides:
doComplete
in class AbstractFileWriteAction
- Throws:
Exception
doPrepare
protected boolean doPrepare()
- Overrides:
doPrepare
in class AbstractLocalContentChangeAction
doRollbackFromCancelled
protected void doRollbackFromCancelled()
- Overrides:
doRollbackFromCancelled
in class AbstractLocalContentChangeAction
doRollbackFromOpen
protected void doRollbackFromOpen()
- Overrides:
doRollbackFromOpen
in class AbstractLocalContentChangeAction
doRollbackFromRollbackOnly
protected void doRollbackFromRollbackOnly()
- Overrides:
doRollbackFromRollbackOnly
in class AbstractLocalContentChangeAction
Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.