net.sf.xbus.technical.file
Class FileReceiverThread

java.lang.Object
  extended by net.sf.xbus.technical.ReceiverThreadBase
      extended by net.sf.xbus.technical.file.FileReceiverThread
All Implemented Interfaces:
java.lang.Runnable, Receiver
Direct Known Subclasses:
FileByteArrayListReceiverThread, FileLineReaderReceiverThread, FileStreamReceiverThread

public class FileReceiverThread
extends ReceiverThreadBase

The FileReceiverThread runs in the background and receives data from files when they exist.


Field Summary
 
Fields inherited from class net.sf.xbus.technical.ReceiverThreadBase
DEFAULT_ERROR_TIMEOUT, DEFAULT_TIMEOUT
 
Constructor Summary
FileReceiverThread(XBUSSystem source)
          Stores the interface name
 
Method Summary
protected  FileReceiver createReceiver()
          Creates an instance of FileReceiver used to read from a file.
protected  java.lang.String getAddress()
          Returns the file name of the received message.
protected  java.lang.String getReceiverClassName()
          Returns the name of the receiver class, used for example to determine values in the configuration.
 java.lang.String getType()
          A Receiver can receive data either as a String or as an Object from a neighboring system.
protected  void initializeThread()
          Not implemented because the run method is not the standard implementation.
protected  java.lang.Object receive()
          Not implemented because the run method is not the standard implementation.
protected  void registerResources(TAManager taManager)
          Not implemented because the run method is not the standard implementation.
 void run()
          Receives and processes messages for one system.
 
Methods inherited from class net.sf.xbus.technical.ReceiverThreadBase
checkProceed, getErrorTimeout, getSource, getTimeout, incrementErrorCounter, initializeErrorCounter, interruptThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileReceiverThread

public FileReceiverThread(XBUSSystem source)
Stores the interface name

Parameters:
source - name of the interface definition
Method Detail

run

public void run()
Receives and processes messages for one system. It is running until either the thread shall be stopped on demand or until a configurable amount of errors has occured, without a successful processed message between it.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class ReceiverThreadBase

createReceiver

protected FileReceiver createReceiver()
Creates an instance of FileReceiver used to read from a file.

Returns:
an instance of FileReceiver

initializeThread

protected void initializeThread()
Not implemented because the run method is not the standard implementation.

Specified by:
initializeThread in class ReceiverThreadBase

registerResources

protected void registerResources(TAManager taManager)
Not implemented because the run method is not the standard implementation.

Specified by:
registerResources in class ReceiverThreadBase
Parameters:
taManager - the transaction manager in which the resources shall be registered

receive

protected java.lang.Object receive()
Not implemented because the run method is not the standard implementation.

Specified by:
receive in class ReceiverThreadBase
Returns:
the received message or null when no message has been available

getType

public java.lang.String getType()
Description copied from interface: Receiver
A Receiver can receive data either as a String or as an Object from a neighboring system.

See Also:
Receiver.getType()

getReceiverClassName

protected java.lang.String getReceiverClassName()
Description copied from class: ReceiverThreadBase
Returns the name of the receiver class, used for example to determine values in the configuration.

Specified by:
getReceiverClassName in class ReceiverThreadBase
Returns:
the name of the receiver class
See Also:
ReceiverThreadBase.getReceiverClassName()

getAddress

protected java.lang.String getAddress()
Returns the file name of the received message.

Specified by:
getAddress in class ReceiverThreadBase
Returns:
the address of a received message
See Also:
ReceiverThreadBase.getAddress()