The system wide connection is created upon the start of the component.
Additional connections can be created by firing events of type
Nested Class SummaryModifier and TypeClassDescription
protected classThe specific implementation of the
Nested classes/interfaces inherited from class org.jgrapes.mail.MailConnectionManager
Nested classes/interfaces inherited from class org.jgrapes.io.util.ConnectionManager
Method SummaryModifier and TypeMethodDescription
protected voidConfigure the component specific values.
protected booleanIf connections are event generators, register the component as generator upon the creation of the first connection and unregister it when closing the last one.Returns the max idle time.
voidSends the message as specified by the event.
voidOpen a connection for sending mail as specified by the event.
voidStart the component.Sets the mail properties.Sets the maximum idle time.
Methods inherited from class org.jgrapes.mail.MailConnectionManager
onConfigUpdate, password, setPassword
Methods inherited from class org.jgrapes.io.util.ConnectionManager
executorService, onClose, onStop, setExecutorService
Methods inherited from class org.jgrapes.core.Component
channel, component, defaultCriterion, isEligibleFor, setName
Methods inherited from class org.jgrapes.core.internal.ComponentVertex
activeEventPipeline, addHandler, attach, children, componentPath, componentVertex, detach, fire, initComponentsHandlers, iterator, name, newEventPipeline, newEventPipeline, parent, registerAsGenerator, root, toString, unregisterAsGenerator
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
MailSenderCreates a new component base with its channel set to the given channel.
As a special case
Channel.SELFcan be passed to the constructor to make the component use itself as channel. The special value is necessary as you obviously cannot pass an object to be constructed to its constructor.
componentChannel- the channel that the component’s handlers listen on by default and that
Manager.fire(Event, Channel...)sends the event to
connectionsGenerateprotected boolean connectionsGenerate()Description copied from class:
ConnectionManagerIf connections are event generators, register the component as generator upon the creation of the first connection and unregister it when closing the last one.
setMailPropertiesSets the mail properties.
See the Jakarta Mail documentation for available settings.
setMaxIdleTimeSets the maximum idle time.
An open connection to the mail server is closed after this time.
maxIdleTime- the new max idle time
maxIdleTimeReturns the max idle time.
- the duration
configureComponentDescription copied from class:
MailConnectionManagerConfigure the component specific values.
onStartStart the component.
event- the event
onOpenMailSender@Handler public void onOpenMailSender
(OpenMailSender event, Channel channel) throws MessagingExceptionOpen a connection for sending mail as specified by the event.
Properties configured for the component are used as fallbacks, so simply sending an event without specific properties opens another system connection.
event- the event
channel- the channel
onMessageSends the message as specified by the event.
event- the event
MessagingException- the messaging exception