|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.common.utils.batch.FileBatchJob dk.netarkivet.common.utils.batch.LoadableFileBatchJob
public class LoadableFileBatchJob
This implementation of FileBatchJob is a bridge to a class file given as a File object. The given class will be loaded and used to perform the actions of the FileBatchJob class.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class dk.netarkivet.common.utils.batch.FileBatchJob |
---|
FileBatchJob.ExceptionOccurrence |
Field Summary | |
---|---|
(package private) byte[] |
fileContents
The binary contents of the file before they are turned into a class. |
(package private) java.lang.String |
fileName
The name of the file before they are turned into a class. |
(package private) FileBatchJob |
loadedJob
The job loaded from file. |
(package private) org.apache.commons.logging.Log |
log
The class logger. |
Fields inherited from class dk.netarkivet.common.utils.batch.FileBatchJob |
---|
batchJobTimeout, exceptions, filesFailed, noOfFilesProcessed |
Constructor Summary | |
---|---|
LoadableFileBatchJob(java.io.File classFile,
java.util.List<java.lang.String> arguments)
Create a new batch job that runs the loaded class. |
Method Summary | |
---|---|
void |
finish(java.io.OutputStream os)
Finish up the job. |
void |
initialize(java.io.OutputStream os)
Initialize the job before runnning. |
protected void |
loadBatchJob()
Method for initializing the loaded batchjob. |
boolean |
postProcess(java.io.InputStream input,
java.io.OutputStream output)
Processes the concatenated result files. |
boolean |
processFile(java.io.File file,
java.io.OutputStream os)
Process one file stored in the bit archive. |
java.lang.String |
toString()
Override of the default toString to include name of loaded class. |
Methods inherited from class dk.netarkivet.common.utils.batch.FileBatchJob |
---|
addException, addFinishException, addInitializeException, getBatchJobTimeout, getExceptions, getFilenamePattern, getFilesFailed, getNoOfFilesProcessed, maxExceptionsReached, processOnlyFileNamed, processOnlyFilesMatching, processOnlyFilesMatching, processOnlyFilesNamed, setBatchJobTimeout |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
transient org.apache.commons.logging.Log log
transient FileBatchJob loadedJob
byte[] fileContents
java.lang.String fileName
Constructor Detail |
---|
public LoadableFileBatchJob(java.io.File classFile, java.util.List<java.lang.String> arguments) throws ArgumentNotValid
classFile
- the classfile for the batch job we want to run.arguments
- The arguments for the batchjobs. This can be null.
ArgumentNotValid
- If the classfile is null.Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public void initialize(java.io.OutputStream os)
initialize
in class FileBatchJob
os
- the OutputStream to which output should be writtenprotected void loadBatchJob() throws IOFailure
IOFailure
- If the batchjob cannot be loaded.public boolean processFile(java.io.File file, java.io.OutputStream os)
processFile
in class FileBatchJob
file
- the file to be processed.os
- the OutputStream to which output should be written
public void finish(java.io.OutputStream os)
finish
in class FileBatchJob
os
- the OutputStream to which output should be writtenpublic boolean postProcess(java.io.InputStream input, java.io.OutputStream output)
FileBatchJob
postProcess
in class FileBatchJob
input
- The inputstream to the file containing the concatenated
results.output
- The outputstream where the resulting data should be
written.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |