org.jboss.soa.esb.actions
Class AbstractFileAction

java.lang.Object
  extended by org.jboss.soa.esb.actions.AbstractFileAction
All Implemented Interfaces:
ActionProcessor
Direct Known Subclasses:
FileCopier, FileToByteArray, FtpDownloader, FtpUploader, MockFileAction

public abstract class AbstractFileAction
extends java.lang.Object
implements ActionProcessor

Extend this class if you need to implement an action class intended to process one file at a time.

See FileCopier as an example.

This class are stateful.

Author:
Esteban.

Constructor Summary
AbstractFileAction()
           
 
Method Summary
protected abstract  java.lang.Object process(java.io.File file)
          Process the file message object.
 Message process(Message message)
          Files processed by action classes need to be renamed during processing to disable other listeners (or other threads launched by the same listener that started this thread) to pick up the same file
Once processing ends a suffix will be added to the name of the original file that has been processed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.soa.esb.actions.ActionProcessor
getErrorNotification, getOkNotification
 

Constructor Detail

AbstractFileAction

public AbstractFileAction()
Method Detail

process

public final Message process(Message message)
                      throws ActionProcessingException
Files processed by action classes need to be renamed during processing to disable other listeners (or other threads launched by the same listener that started this thread) to pick up the same file
Once processing ends a suffix will be added to the name of the original file that has been processed. The suffix will be different according to the result of processing (OK or Exception). Files could be moved to different directories as well
Parameters for these options can be provided at run time in the ConfigTree (arg 0 in constructor)

Specified by:
process in interface ActionProcessor
Parameters:
message - The message payload to be processed.
Returns:
The processing result.
Throws:
ActionProcessingException - Exception during payload processing.

process

protected abstract java.lang.Object process(java.io.File file)
                                     throws ActionProcessingException
Process the file message object.

Parameters:
file - The file to be processed.
Returns:
The processing result.
Throws:
ActionProcessingException - Exception while processing file.