Class MailMessageReceiver
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.Lifecycle
transport URI, store URI,
and monitoringStrategy to be set, in
addition to the messageFactory and
messageReceiver required by the
base class.
The MonitoringStrategy is used to detect new incoming email request. If the
monitoringStrategy is not explicitly set, this receiver will use the
Pop3PollingMonitoringStrategy for POP3 servers, and the
PollingMonitoringStrategy for IMAP servers.
- Since:
- 1.5.0
-
Field Summary
Fields inherited from class org.springframework.ws.transport.support.AbstractAsyncStandaloneMessageReceiver
DEFAULT_THREAD_NAME_PREFIXFields inherited from class org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCallsAbstractStandaloneMessageReceiver.activate()when the BeanFactory initializes the receiver instance.protected voidTemplate method invoked whenAbstractStandaloneMessageReceiver.activate()is invoked.protected voidTemplate method invoked whenAbstractStandaloneMessageReceiver.shutdown()is invoked.protected voidonStart()Template method invoked whenAbstractStandaloneMessageReceiver.start()is invoked.protected voidonStop()Template method invoked whenAbstractStandaloneMessageReceiver.stop()is invoked.voidSets the from address to use when sending response messages.voidsetJavaMailProperties(Properties javaMailProperties) Set JavaMail properties for theSession.voidsetMonitoringStrategy(MonitoringStrategy monitoringStrategy) Sets the monitoring strategy to use for retrieving new requests.voidsetSession(jakarta.mail.Session session) Set the JavaMailSession, possibly pulled from JNDI.voidsetStoreUri(String storeUri) Sets the JavaMail Store URI to be used for retrieving request messages.voidsetTransportUri(String transportUri) Sets the JavaMail Transport URI to be used for sending response messages.Methods inherited from class org.springframework.ws.transport.support.AbstractAsyncStandaloneMessageReceiver
createDefaultTaskExecutor, execute, setBeanName, setTaskExecutorMethods inherited from class org.springframework.ws.transport.support.AbstractStandaloneMessageReceiver
activate, destroy, isActive, isRunning, setAutoStartup, shutdown, start, stopMethods inherited from class org.springframework.ws.transport.support.SimpleWebServiceMessageReceiverObjectSupport
getMessageReceiver, handleConnection, setMessageReceiverMethods inherited from class org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport
getMessageFactory, handleConnection, handleNoEndpointFoundException, setMessageFactory
-
Constructor Details
-
MailMessageReceiver
public MailMessageReceiver()
-
-
Method Details
-
setFrom
Sets the from address to use when sending response messages.- Throws:
jakarta.mail.internet.AddressException
-
setJavaMailProperties
Set JavaMail properties for theSession.A new
Sessionwill be created with those properties. Use either this method orsetSession(jakarta.mail.Session), but not both.Non-default properties in this instance will override given JavaMail properties.
-
setSession
public void setSession(jakarta.mail.Session session) Set the JavaMailSession, possibly pulled from JNDI.Default is a new
Sessionwithout defaults, that is completely configured via this instance's properties.If using a pre-configured
Session, non-default properties in this instance will override the settings in theSession. -
setStoreUri
Sets the JavaMail Store URI to be used for retrieving request messages. Typically takes the form of[imap|pop3]://user:password@host:port/INBOX. Setting this property is required.For example,
imap://john:[email protected]/INBOX- See Also:
-
Session.getStore(URLName)
-
setTransportUri
Sets the JavaMail Transport URI to be used for sending response messages. Typically takes the form ofsmtp://user:password@host:port. Setting this property is required.For example,
smtp://john:[email protected]- See Also:
-
Session.getTransport(URLName)
-
setMonitoringStrategy
Sets the monitoring strategy to use for retrieving new requests. Default is thePollingMonitoringStrategy. -
afterPropertiesSet
Description copied from class:AbstractStandaloneMessageReceiverCallsAbstractStandaloneMessageReceiver.activate()when the BeanFactory initializes the receiver instance.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classAbstractAsyncStandaloneMessageReceiver- Throws:
Exception
-
onActivate
protected void onActivate() throws jakarta.mail.MessagingExceptionDescription copied from class:AbstractStandaloneMessageReceiverTemplate method invoked whenAbstractStandaloneMessageReceiver.activate()is invoked.- Specified by:
onActivatein classAbstractStandaloneMessageReceiver- Throws:
jakarta.mail.MessagingException
-
onStart
protected void onStart()Description copied from class:AbstractStandaloneMessageReceiverTemplate method invoked whenAbstractStandaloneMessageReceiver.start()is invoked.- Specified by:
onStartin classAbstractStandaloneMessageReceiver
-
onStop
protected void onStop()Description copied from class:AbstractStandaloneMessageReceiverTemplate method invoked whenAbstractStandaloneMessageReceiver.stop()is invoked.- Specified by:
onStopin classAbstractStandaloneMessageReceiver
-
onShutdown
protected void onShutdown()Description copied from class:AbstractStandaloneMessageReceiverTemplate method invoked whenAbstractStandaloneMessageReceiver.shutdown()is invoked.- Specified by:
onShutdownin classAbstractStandaloneMessageReceiver
-