org.jboss.soa.esb.listeners.old
Class DirectoryPoller

java.lang.Object
  extended by org.jboss.soa.esb.listeners.old.AbstractListener
      extended by org.jboss.soa.esb.listeners.old.AbstractPoller
          extended by org.jboss.soa.esb.listeners.old.DirectoryPoller
All Implemented Interfaces:
java.lang.Runnable

public class DirectoryPoller
extends AbstractPoller


Nested Class Summary
static class DirectoryPoller.WorkingFile
          Working file.
 
Nested classes/interfaces inherited from class org.jboss.soa.esb.listeners.old.AbstractListener
AbstractListener.ActionProcessingPipeline
 
Field Summary
static java.lang.String FILE_ERROR_DIR
           
static java.lang.String FILE_ERROR_SFX
           
static java.lang.String FILE_INPUT_DIR
           
static java.lang.String FILE_INPUT_SFX
           
static java.lang.String FILE_POST_DEL
           
static java.lang.String FILE_POST_DIR
           
static java.lang.String FILE_POST_SFX
           
static java.lang.String FILE_WORK_SFX
           
protected  boolean m_bPostDel
           
protected  java.io.File m_oErrorDir
           
protected  java.io.FileFilter m_oFFilt
           
protected  java.io.File m_oInpDir
           
protected  java.io.File m_oPostDir
           
protected  java.lang.String m_sErrSfx
           
protected  java.lang.String m_sInpSfx
           
protected  java.lang.String m_sPostSfx
           
protected  java.lang.String m_sWrkSfx
           
 
Fields inherited from class org.jboss.soa.esb.listeners.old.AbstractPoller
m_iDfltPollMillis, m_iMinPollMillis, m_iPollMillis, PARM_POLL_LTCY
 
Fields inherited from class org.jboss.soa.esb.listeners.old.AbstractListener
listenerConfig, logger, m_iMaxThr, m_iQthr, m_iSleepForThreads, m_iUpperThreadLimit, m_oActionDefinitionFactory, m_oActions, m_oDad, m_oMsgFactory, m_oThrGrp, MESSAGE_PROCESSING_ACTIONS_LIST
 
Constructor Summary
DirectoryPoller(GpListener p_oDad, ConfigTree p_oParms, ActionDefinitionFactory actionDefinitionFactory)
           
 
Method Summary
protected  void close()
          Close the listener implemenation.
protected  java.util.List<java.lang.Object> pollForCandidates()
          Poll for message objects.
 java.lang.Object preProcess(java.lang.Object inputObject)
          Preprocess the message object before returning for pipeline processing.
protected  void processingComplete(java.lang.Object currentObject)
          Called on the listener implementation when pipeline processing of a message is complete.
protected  void processingError(java.lang.Object currentObject, ActionProcessor processor, java.lang.Throwable error)
          Called on the listener implementation when pipeline processing error has occured.
protected  void seeIfOkToWorkOnDir(java.io.File p_oDir)
           
 
Methods inherited from class org.jboss.soa.esb.listeners.old.AbstractPoller
receive
 
Methods inherited from class org.jboss.soa.esb.listeners.old.AbstractListener
run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_INPUT_DIR

public static final java.lang.String FILE_INPUT_DIR
See Also:
Constant Field Values

FILE_INPUT_SFX

public static final java.lang.String FILE_INPUT_SFX
See Also:
Constant Field Values

FILE_WORK_SFX

public static final java.lang.String FILE_WORK_SFX
See Also:
Constant Field Values

FILE_ERROR_DIR

public static final java.lang.String FILE_ERROR_DIR
See Also:
Constant Field Values

FILE_ERROR_SFX

public static final java.lang.String FILE_ERROR_SFX
See Also:
Constant Field Values

FILE_POST_DIR

public static final java.lang.String FILE_POST_DIR
See Also:
Constant Field Values

FILE_POST_SFX

public static final java.lang.String FILE_POST_SFX
See Also:
Constant Field Values

FILE_POST_DEL

public static final java.lang.String FILE_POST_DEL
See Also:
Constant Field Values

m_oInpDir

protected java.io.File m_oInpDir

m_oErrorDir

protected java.io.File m_oErrorDir

m_oPostDir

protected java.io.File m_oPostDir

m_oFFilt

protected java.io.FileFilter m_oFFilt

m_sInpSfx

protected java.lang.String m_sInpSfx

m_sWrkSfx

protected java.lang.String m_sWrkSfx

m_sErrSfx

protected java.lang.String m_sErrSfx

m_sPostSfx

protected java.lang.String m_sPostSfx

m_bPostDel

protected boolean m_bPostDel
Constructor Detail

DirectoryPoller

public DirectoryPoller(GpListener p_oDad,
                       ConfigTree p_oParms,
                       ActionDefinitionFactory actionDefinitionFactory)
                throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

preProcess

public java.lang.Object preProcess(java.lang.Object inputObject)
Description copied from class: AbstractPoller
Preprocess the message object before returning for pipeline processing.

Specified by:
preProcess in class AbstractPoller
Parameters:
inputObject - Object - Must be a File representing the file that has to be processed
Returns:
Object - an array of 3 Files containing:

[0] renamed file (workSuffix appended to input file name)

[1] target file name in case actionClass is unable to complete successfuly

[2] target file name in case actionClass finishes successfuly


pollForCandidates

protected java.util.List<java.lang.Object> pollForCandidates()
Description copied from class: AbstractPoller
Poll for message objects.

Specified by:
pollForCandidates in class AbstractPoller
Returns:
A list of message objects, or an empty list if there are no message objects.

seeIfOkToWorkOnDir

protected void seeIfOkToWorkOnDir(java.io.File p_oDir)
                           throws java.lang.Exception
Throws:
java.lang.Exception

close

protected void close()
Description copied from class: AbstractListener
Close the listener implemenation.

Allows the listener to perform relevant close/cleanup tasks.

Specified by:
close in class AbstractListener

processingError

protected void processingError(java.lang.Object currentObject,
                               ActionProcessor processor,
                               java.lang.Throwable error)
Description copied from class: AbstractListener
Called on the listener implementation when pipeline processing error has occured.

Specified by:
processingError in class AbstractListener
Parameters:
currentObject - The message that was initialy supplied to the pipeline.
processor - The processor that raised the error. Can be null where the error was raised before pipeline processing of the message.
error - The error. Can be null.

processingComplete

protected void processingComplete(java.lang.Object currentObject)
Description copied from class: AbstractListener
Called on the listener implementation when pipeline processing of a message is complete.

Specified by:
processingComplete in class AbstractListener
Parameters:
currentObject - The message that was initialy supplied to the pipeline.