org.jboss.soa.esb.listeners.gateway
Class AbstractFileGateway

java.lang.Object
  extended by org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle
      extended by org.jboss.soa.esb.listeners.gateway.AbstractFileGateway
All Implemented Interfaces:
java.io.Serializable, Initializable, ManagedLifecycle, ScheduledEventListener
Direct Known Subclasses:
FileGatewayListener

public abstract class AbstractFileGateway
extends AbstractManagedLifecycle
implements ScheduledEventListener

Base class for all file gateways: local filesystem, ftp, sftp and ftps.

Implementations for file manipulation (getFileList, getFileContents, renameFile and deleteFile) must be provided by factory

Since:
Version 4.0
Author:
schifest@heuristica.com.ar
See Also:
Serialized Form

Field Summary
protected  boolean _deleteAfterOK
           
protected  java.io.File _errorDirectory
           
protected  java.lang.String _errorSuffix
           
protected  java.io.FileFilter _fileFilter
           
protected  java.io.File _inputDirectory
           
protected  java.lang.String _inputSuffix
           
protected static org.apache.log4j.Logger _logger
           
protected  long _maxMillisForResponse
           
protected  java.io.File _postProcessDirectory
           
protected  java.lang.String _postProcessSuffix
           
protected  java.lang.String _workingSuffix
           
protected  ConfigTree config
           
protected  MessageComposer messageComposer
           
protected  ServiceInvoker serviceInvoker
           
protected  Service targetService
           
 
Fields inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle
PARAM_TERMINATION_PERIOD
 
Constructor Summary
protected AbstractFileGateway(ConfigTree config)
           
 
Method Summary
protected  void checkInputSuffix()
           
protected  void doDestroy()
          Handle the destroy of the managed instance.
protected  void doInitialise()
          Handle the initialisation of the managed instance.
protected  void doStart()
          Handle the start of the managed instance.
protected  void doStop()
          Handle the stop of the managed instance.
protected  void doThreadedDestroy()
          Handle the threaded destroy of the managed instance.
static java.io.File getFileInputDirectory(ConfigTree config)
           
protected  java.io.File getWorkFileName(java.io.File fileIn, java.lang.String suffix)
           
 void initialize(ConfigTree config)
          Initialize.
 void onSchedule()
          Execute on trigger from the scheduler.
 void uninitialize()
          Uninitialize.
 
Methods inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle
addManagedLifecycleEventListener, changeState, destroy, getConfig, getState, getTerminationPeriod, initialise, removeManagedLifecycleEventListener, start, stop, waitUntilDestroyed, waitUntilDestroyed, waitUntilNotState, waitUntilState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_logger

protected static final org.apache.log4j.Logger _logger

config

protected ConfigTree config

_maxMillisForResponse

protected long _maxMillisForResponse

targetService

protected Service targetService

serviceInvoker

protected ServiceInvoker serviceInvoker

messageComposer

protected MessageComposer messageComposer

_deleteAfterOK

protected boolean _deleteAfterOK

_inputDirectory

protected java.io.File _inputDirectory

_errorDirectory

protected java.io.File _errorDirectory

_postProcessDirectory

protected java.io.File _postProcessDirectory

_inputSuffix

protected java.lang.String _inputSuffix

_postProcessSuffix

protected java.lang.String _postProcessSuffix

_workingSuffix

protected java.lang.String _workingSuffix

_errorSuffix

protected java.lang.String _errorSuffix

_fileFilter

protected java.io.FileFilter _fileFilter
Constructor Detail

AbstractFileGateway

protected AbstractFileGateway(ConfigTree config)
                       throws ConfigurationException,
                              RegistryException,
                              GatewayException
Throws:
ConfigurationException
RegistryException
GatewayException
Method Detail

doInitialise

protected void doInitialise()
                     throws ManagedLifecycleException
Handle the initialisation of the managed instance.

Specified by:
doInitialise in class AbstractManagedLifecycle
Throws:
ManagedLifecycleException - for errors while initialisation.

initialize

public void initialize(ConfigTree config)
                throws ConfigurationException
Description copied from interface: Initializable
Initialize.

Specified by:
initialize in interface Initializable
Parameters:
config - The configuration.
Throws:
ConfigurationException

uninitialize

public void uninitialize()
Description copied from interface: Initializable
Uninitialize.

Specified by:
uninitialize in interface Initializable

doStart

protected void doStart()
                throws ManagedLifecycleException
Description copied from class: AbstractManagedLifecycle
Handle the start of the managed instance.

Specified by:
doStart in class AbstractManagedLifecycle
Throws:
ManagedLifecycleException - for errors while starting.

doStop

protected void doStop()
               throws ManagedLifecycleException
Description copied from class: AbstractManagedLifecycle
Handle the stop of the managed instance.

Specified by:
doStop in class AbstractManagedLifecycle
Throws:
ManagedLifecycleException - for errors while stopping.

doDestroy

protected void doDestroy()
                  throws ManagedLifecycleException
Description copied from class: AbstractManagedLifecycle
Handle the destroy of the managed instance.

Specified by:
doDestroy in class AbstractManagedLifecycle
Throws:
ManagedLifecycleException - for errors while destroying.

onSchedule

public void onSchedule()
                throws SchedulingException
Execute on trigger from the scheduler.

Specified by:
onSchedule in interface ScheduledEventListener
Throws:
SchedulingException - Exception processing schedule event.

getWorkFileName

protected java.io.File getWorkFileName(java.io.File fileIn,
                                       java.lang.String suffix)

doThreadedDestroy

protected void doThreadedDestroy()
                          throws ManagedLifecycleException
Handle the threaded destroy of the managed instance.

Throws:
ManagedLifecycleException - for errors while destroying.

checkInputSuffix

protected void checkInputSuffix()
                         throws ConfigurationException
Throws:
ConfigurationException

getFileInputDirectory

public static java.io.File getFileInputDirectory(ConfigTree config)
                                          throws ConfigurationException
Throws:
ConfigurationException