Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/main/java/net/sf/xbus/technical/mail/Email.java b/src/main/java/net/sf/xbus/technical/mail/Email.java
- index 39ecc2d..6e019cf 100644
- --- a/src/main/java/net/sf/xbus/technical/mail/Email.java
- +++ b/src/main/java/net/sf/xbus/technical/mail/Email.java
- @@ -8,7 +8,11 @@ import java.util.Vector;
- import javax.mail.internet.InternetAddress;
- import net.sf.xbus.base.core.Constants;
- +import net.sf.xbus.base.core.TAManager;
- import net.sf.xbus.base.core.XException;
- +import net.sf.xbus.base.core.trace.Trace;
- +import net.sf.xbus.base.notifyerror.NotifyError;
- +import net.sf.xbus.base.xbussystem.XBUSSystem;
- import net.sf.xbus.base.xml.XMLHelper;
- import org.w3c.dom.Document;
- @@ -283,4 +287,64 @@ public class Email
- return ((mContent != null) && (mContent.toUpperCase().indexOf("/HTML") != -1));
- }
- + protected String getAddress(POP3XMLReceiver pop3xmlReceiver)
- + {
- + return new StringBuffer(pop3xmlReceiver.mUser).append("@").append(pop3xmlReceiver.mHost).toString();
- + }
- +
- + /**
- + * Returns the onError.
- + *
- + * @param pop3xmlReceiver TODO
- + * @return String
- + */
- + public String getOnError(POP3XMLReceiver pop3xmlReceiver)
- + {
- + return pop3xmlReceiver.mOnError;
- + }
- +
- + /**
- + * This method will open the Transaction manager for this ressource adb use
- + * the {@link #doReceive(XBUSSystem)}method to process the reading
- + *
- + * @param pop3xmlReceiver TODO
- + * @param systemName name of the interface definition
- + * @see net.sf.xbus.base.xbussystem.XBUSSystem#getSystems(String, String)
- + * @exception XException if something goes wrong
- + */
- + public void receive(POP3XMLReceiver pop3xmlReceiver, String systemName)
- + {
- + pop3xmlReceiver.mDeleted = false;
- +
- + XBUSSystem xbusSystem = null;
- +
- + TAManager taManager = TAManager.getInstance();
- + taManager.clearManager();
- + taManager.registerResource(pop3xmlReceiver);
- +
- + try
- + {
- +
- + pop3xmlReceiver.readConfiguration(systemName);
- +
- + xbusSystem = new XBUSSystem(systemName);
- +
- + Trace.info("Start processing " + xbusSystem.getCompleteName());
- +
- + // POP3XMLReceiver will be registered by TAManager
- + pop3xmlReceiver.doReceive(xbusSystem);
- + }
- + catch (Exception t)
- + {
- + NotifyError.notifyError(pop3xmlReceiver, xbusSystem, t.getMessage(), null,
- + null);
- + }
- + finally
- + {
- + // close resources and remove from the resources
- + taManager.close();
- + taManager.removeResource(pop3xmlReceiver);
- + }
- + }
- +
- }
- diff --git a/src/main/java/net/sf/xbus/technical/mail/POP3XMLReceiver.java b/src/main/java/net/sf/xbus/technical/mail/POP3XMLReceiver.java
- index a6b1fbf..1058953 100644
- --- a/src/main/java/net/sf/xbus/technical/mail/POP3XMLReceiver.java
- +++ b/src/main/java/net/sf/xbus/technical/mail/POP3XMLReceiver.java
- @@ -50,8 +50,8 @@ public class POP3XMLReceiver
- ReceiverSingleInterface
- {
- - private String mHost = null;
- - private String mUser = null;
- + String mHost = null;
- + String mUser = null;
- private String mPassword = null;
- private Store mStore = null;
- @@ -60,7 +60,7 @@ public class POP3XMLReceiver
- protected Message mMessage = null;
- private Email mEmailMessage = null;
- - private boolean mDeleted = false;
- + boolean mDeleted = false;
- private String mReturncode = null;
- /**
- @@ -69,7 +69,7 @@ public class POP3XMLReceiver
- */
- private String mResolution = null;
- - private String mOnError = null;
- + String mOnError = null;
- /**
- * This method will open the Transaction manager for this ressource adb use
- @@ -81,37 +81,7 @@ public class POP3XMLReceiver
- */
- public void receive(String systemName)
- {
- - mDeleted = false;
- -
- - XBUSSystem xbusSystem = null;
- -
- - TAManager taManager = TAManager.getInstance();
- - taManager.clearManager();
- - taManager.registerResource(this);
- -
- - try
- - {
- -
- - readConfiguration(systemName);
- -
- - xbusSystem = new XBUSSystem(systemName);
- -
- - Trace.info("Start processing " + xbusSystem.getCompleteName());
- -
- - // POP3XMLReceiver will be registered by TAManager
- - doReceive(xbusSystem);
- - }
- - catch (Exception t)
- - {
- - NotifyError.notifyError(this, xbusSystem, t.getMessage(), null,
- - null);
- - }
- - finally
- - {
- - // close resources and remove from the resources
- - taManager.close();
- - taManager.removeResource(this);
- - }
- + mEmailMessage.receive(this, systemName);
- }
- protected boolean doReceive(XBUSSystem xbusSystem)
- @@ -461,7 +431,7 @@ public class POP3XMLReceiver
- */
- public String getOnError()
- {
- - return mOnError;
- + return mEmailMessage.getOnError(this);
- }
- /**
- @@ -627,7 +597,7 @@ public class POP3XMLReceiver
- protected String getAddress()
- {
- - return new StringBuffer(mUser).append("@").append(mHost).toString();
- + return mEmailMessage.getAddress(this);
- }
- /**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement