net.sf.xbus.technical.mail
Class POP3XMLReceiverThread

java.lang.Object
  extended by net.sf.xbus.technical.ReceiverThreadBase
      extended by net.sf.xbus.technical.mail.POP3XMLReceiverThread
All Implemented Interfaces:
java.lang.Runnable, Receiver
Direct Known Subclasses:
POP3ReceiverThread

public class POP3XMLReceiverThread
extends ReceiverThreadBase

The POP3XMLReceiverThread runs in the background and receives emails.

Author:
Dominique Boivin

Field Summary
 
Fields inherited from class net.sf.xbus.technical.ReceiverThreadBase
DEFAULT_ERROR_TIMEOUT, DEFAULT_TIMEOUT
 
Constructor Summary
POP3XMLReceiverThread(XBUSSystem source)
          Stores the interface name
 
Method Summary
protected  POP3XMLReceiver createReceiver()
          Creates an instance of POP3XMLReceiver used to read from a mailbox.
protected  java.lang.String getAddress()
          Returns a concatenation of the mailbox name and the server name.
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()
          Returns Constants.TYPE_OBJECT
protected  void initializeThread()
          Opens the connection to the POP3 server.
protected  java.lang.Object receive()
          Receives one message.
protected  void registerResources(TAManager taManager)
          Registers the POP3XMLReceiver in the TAManager.
 
Methods inherited from class net.sf.xbus.technical.ReceiverThreadBase
checkProceed, getErrorTimeout, getSource, getTimeout, incrementErrorCounter, initializeErrorCounter, interruptThread, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

POP3XMLReceiverThread

public POP3XMLReceiverThread(XBUSSystem source)
Stores the interface name

Parameters:
source - name of the interface definition
Method Detail

createReceiver

protected POP3XMLReceiver createReceiver()
Creates an instance of POP3XMLReceiver used to read from a mailbox.

Returns:
an instance of POP3XMLReceiver

initializeThread

protected void initializeThread()
                         throws XException
Opens the connection to the POP3 server.

Specified by:
initializeThread in class ReceiverThreadBase
Throws:
XException - if something goes wrong

registerResources

protected void registerResources(TAManager taManager)
                          throws XException
Registers the POP3XMLReceiver in the TAManager.

Specified by:
registerResources in class ReceiverThreadBase
Parameters:
taManager - the transaction manager in which the resources shall be registered
Throws:
XException - if something goes wrong

receive

protected java.lang.Object receive()
                            throws XException
Description copied from class: ReceiverThreadBase
Receives one message.

Specified by:
receive in class ReceiverThreadBase
Returns:
the received message or null when no message has been available
Throws:
XException - if something goes wrong
See Also:
ReceiverThreadBase.receive()

getType

public java.lang.String getType()
Returns Constants.TYPE_OBJECT

Returns:
Constants.TYPE_OBJECT

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 a concatenation of the mailbox name and the server name.

Specified by:
getAddress in class ReceiverThreadBase
Returns:
a concatenation of the mailbox name and the server name