org.apache.axis2.transport.mail
Class MailTransportListener

java.lang.Object
  extended by org.apache.axis2.transport.base.AbstractTransportListener
      extended by org.apache.axis2.transport.base.AbstractTransportListenerEx<T>
          extended by org.apache.axis2.transport.base.AbstractPollingTransportListener<PollTableEntry>
              extended by org.apache.axis2.transport.mail.MailTransportListener
All Implemented Interfaces:
TransportErrorSource, ManagementSupport, org.apache.axis2.transport.TransportListener

public class MailTransportListener
extends AbstractPollingTransportListener<PollTableEntry>
implements ManagementSupport, TransportErrorSource

This mail transport lister implementation uses the base transport framework and is a polling transport. i.e. a service can register itself with custom a custom mail configuration (i.e. pop3 or imap) and specify its polling duration, and what action to be taken after processing messages. The transport always deletes processed mails from the folder they were fetched from and can be configured to be optionally moved to a different folder, if the server supports it (e.g. with imap). When checking for new mail, the transport ignores messages already flaged as SEEN and DELETED


Field Summary
static java.lang.String DELETE
           
static java.lang.String MOVE
           
 
Fields inherited from class org.apache.axis2.transport.base.AbstractTransportListener
cfgCtx, config, isNonBlocking, log, metrics, state, useAxis2ThreadPool, workerPool
 
Fields inherited from interface org.apache.axis2.transport.TransportListener
HOST_ADDRESS, PARAM_PORT
 
Constructor Summary
MailTransportListener()
           
 
Method Summary
 void addErrorListener(TransportErrorListener listener)
           
protected  PollTableEntry createEndpoint()
           
 void init(org.apache.axis2.context.ConfigurationContext cfgCtx, org.apache.axis2.description.TransportInDescription trpInDesc)
          Initializes the Mail transport
protected  void poll(PollTableEntry entry)
           
 void removeErrorListener(TransportErrorListener listener)
           
 
Methods inherited from class org.apache.axis2.transport.base.AbstractPollingTransportListener
destroy, maintenenceShutdown, onPollCompletion, pause, processFailure, resume, startEndpoint, stopEndpoint
 
Methods inherited from class org.apache.axis2.transport.base.AbstractTransportListenerEx
getEndpoints, getEPRsForService, startListeningForService, stopListeningForService
 
Methods inherited from class org.apache.axis2.transport.base.AbstractTransportListener
createMessageContext, disableTransportForService, getActiveThreadCount, getAvgSizeReceived, getAvgSizeSent, getBytesReceived, getBytesSent, getConfigurationContext, getEPRForService, getEPRsForService, getFaultsReceiving, getFaultsSending, getLastResetTime, getMaxSizeReceived, getMaxSizeSent, getMessagesReceived, getMessagesSent, getMetricsCollector, getMetricsWindow, getMinSizeReceived, getMinSizeSent, getQueueSize, getResponseCodeTable, getSessionContext, getTimeoutsReceiving, getTimeoutsSending, getTransportName, handleException, handleIncomingMessage, logException, resetStatistics, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.axis2.transport.base.ManagementSupport
getActiveThreadCount, getAvgSizeReceived, getAvgSizeSent, getBytesReceived, getBytesSent, getFaultsReceiving, getFaultsSending, getLastResetTime, getMaxSizeReceived, getMaxSizeSent, getMessagesReceived, getMessagesSent, getMetricsWindow, getMinSizeReceived, getMinSizeSent, getQueueSize, getResponseCodeTable, getTimeoutsReceiving, getTimeoutsSending, maintenenceShutdown, pause, resetStatistics, resume
 

Field Detail

DELETE

public static final java.lang.String DELETE
See Also:
Constant Field Values

MOVE

public static final java.lang.String MOVE
See Also:
Constant Field Values
Constructor Detail

MailTransportListener

public MailTransportListener()
Method Detail

init

public void init(org.apache.axis2.context.ConfigurationContext cfgCtx,
                 org.apache.axis2.description.TransportInDescription trpInDesc)
          throws org.apache.axis2.AxisFault
Initializes the Mail transport

Specified by:
init in interface org.apache.axis2.transport.TransportListener
Overrides:
init in class AbstractPollingTransportListener<PollTableEntry>
Parameters:
cfgCtx - the Axsi2 configuration context
trpInDesc - the POP3 transport in description from the axis2.xml
Throws:
org.apache.axis2.AxisFault - on error

poll

protected void poll(PollTableEntry entry)
Specified by:
poll in class AbstractPollingTransportListener<PollTableEntry>

createEndpoint

protected PollTableEntry createEndpoint()
Specified by:
createEndpoint in class AbstractTransportListenerEx<PollTableEntry>

addErrorListener

public void addErrorListener(TransportErrorListener listener)
Specified by:
addErrorListener in interface TransportErrorSource

removeErrorListener

public void removeErrorListener(TransportErrorListener listener)
Specified by:
removeErrorListener in interface TransportErrorSource


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.