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

java.lang.Object
  extended by org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle
      extended by org.jboss.soa.esb.listeners.lifecycle.AbstractScheduledManagedLifecycle
          extended by org.jboss.soa.esb.listeners.gateway.AbstractFileGateway
              extended by org.jboss.soa.esb.listeners.gateway.FileGatewayListener
                  extended by org.jboss.soa.esb.listeners.gateway.RemoteGatewayListener
                      extended by org.jboss.soa.esb.listeners.gateway.ReadOnlyRemoteGatewayListener
All Implemented Interfaces:
ManagedLifecycle

public class ReadOnlyRemoteGatewayListener
extends RemoteGatewayListener

This class extends RemoteGatewayListener and is intended to be used when the remote file system does not support write operations.

 Sample Listener Configuration:
 <ftp-listener name="FtpGateway"
  busidref="helloFTPChannel"
   maxThreads="1"
    is-gateway="true">
     <property name="pollLatencySeconds" value="5"/> <!-- Interval to poll the remote file system -->
     <property name="remoteFileSystemStrategy-configFile" value="/ftpfile-cache-config.xml"/> <!-- Optional-->
     <property name="remoteFileSystemStrategy-cacheListener" value=""org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.DeleteOnEvictTreeCacheListener"/> <!-- Optional-->
     <property name="remoteFileSystemStrategy-class" value="org.my.MyRemoteGatewayStrategy"/> <!-- Optional-->
</ftp-listener>
 

Author:
Daniel Bevenius

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.soa.esb.listeners.gateway.FileGatewayListener
FileGatewayListener.FileFilterInit
 
Field Summary
static java.lang.String REMOTE_FILE_SYSTEM_STRATEGY_CACHE_LISTENER
          Property to specify if a the TreeCacheListener should be used.
static java.lang.String REMOTE_FILE_SYSTEM_STRATEGY_CLASS
          Property to specify the RemoteFileSystemStrategy implementation
static java.lang.String REMOTE_FILE_SYSTEM_STRATEGY_CONFIG_FILE
          Property to specify a configuration file for REMOTE_FILE_SYSTEM_STRATEGY_CLASS
 
Fields inherited from class org.jboss.soa.esb.listeners.gateway.AbstractFileGateway
_deleteAfterOK, _errorDirectory, _errorSuffix, _inputDirectory, _inputSuffix, _logger, _maxMillisForResponse, _postProcessDirectory, _postProcessSuffix, _renameAfterOK, _workingSuffix, config, messageComposer, serviceInvoker, targetService
 
Fields inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle
PARAM_TERMINATION_PERIOD
 
Constructor Summary
ReadOnlyRemoteGatewayListener(ConfigTree config)
           
 
Method Summary
 boolean deleteFile(java.io.File file)
          Delegates to RemoteFileSystemStrategy.deleteFile(File)
protected  void doScheduledDestroy()
          Destroys the service and also after that stop the remotefileSystemStrategy in use
protected  void doStop()
          Stop the service and also after that stop the remotefileSystemStrategy in use
protected
<T> T
getNewInstanceOf(java.lang.String className)
           
protected  java.io.File getWorkFileName(java.io.File file, java.lang.String suffix)
          Delegates to RemoteFileSystemStrategy.getWorkFileName(File, String)
 void setRemotefileSystemStrategy(RemoteFileSystemStrategy remotefileSystemStrategy)
          Set the RemoteFileSystemStrategy to be used
 
Methods inherited from class org.jboss.soa.esb.listeners.gateway.RemoteGatewayListener
checkMyParms, seeIfOkToWorkOnDir
 
Methods inherited from class org.jboss.soa.esb.listeners.gateway.FileGatewayListener
checkInputSuffix
 
Methods inherited from class org.jboss.soa.esb.listeners.gateway.AbstractFileGateway
doInitialise, getFileInputDirectory, onSchedule, setFileWorking
 
Methods inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractScheduledManagedLifecycle
doDestroy, doStart
 
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

REMOTE_FILE_SYSTEM_STRATEGY_CLASS

public static final java.lang.String REMOTE_FILE_SYSTEM_STRATEGY_CLASS
Property to specify the RemoteFileSystemStrategy implementation

See Also:
Constant Field Values

REMOTE_FILE_SYSTEM_STRATEGY_CONFIG_FILE

public static final java.lang.String REMOTE_FILE_SYSTEM_STRATEGY_CONFIG_FILE
Property to specify a configuration file for REMOTE_FILE_SYSTEM_STRATEGY_CLASS

See Also:
Constant Field Values

REMOTE_FILE_SYSTEM_STRATEGY_CACHE_LISTENER

public static final java.lang.String REMOTE_FILE_SYSTEM_STRATEGY_CACHE_LISTENER
Property to specify if a the TreeCacheListener should be used. See DeleteOnEvictTreeCacheListener

See Also:
Constant Field Values
Constructor Detail

ReadOnlyRemoteGatewayListener

public ReadOnlyRemoteGatewayListener(ConfigTree config)
                              throws ConfigurationException,
                                     RegistryException,
                                     GatewayException
Throws:
ConfigurationException
RegistryException
GatewayException
Method Detail

deleteFile

public boolean deleteFile(java.io.File file)
                   throws GatewayException
Delegates to RemoteFileSystemStrategy.deleteFile(File)

Overrides:
deleteFile in class RemoteGatewayListener
Throws:
GatewayException

getWorkFileName

protected java.io.File getWorkFileName(java.io.File file,
                                       java.lang.String suffix)
Delegates to RemoteFileSystemStrategy.getWorkFileName(File, String)

Overrides:
getWorkFileName in class RemoteGatewayListener

setRemotefileSystemStrategy

public void setRemotefileSystemStrategy(RemoteFileSystemStrategy remotefileSystemStrategy)
Set the RemoteFileSystemStrategy to be used

Parameters:
remotefileSystemStrategy -

getNewInstanceOf

protected <T> T getNewInstanceOf(java.lang.String className)
                      throws ConfigurationException
Throws:
ConfigurationException

doStop

protected void doStop()
               throws ManagedLifecycleException
Stop the service and also after that stop the remotefileSystemStrategy in use

Overrides:
doStop in class AbstractScheduledManagedLifecycle
Throws:
ManagedLifecycleException - for errors while stopping.

doScheduledDestroy

protected void doScheduledDestroy()
                           throws ManagedLifecycleException
Destroys the service and also after that stop the remotefileSystemStrategy in use

Overrides:
doScheduledDestroy in class AbstractScheduledManagedLifecycle
Throws:
ManagedLifecycleException - for errors while destroying.