Package org.jgrapes.mail
Class MailSender.SenderChannel
- All Implemented Interfaces:
Associator,Channel,Eligible,Subchannel,MailChannel
- Enclosing class:
MailSender
protected class MailSender.SenderChannel
extends MailConnectionManager<MailSender.SenderChannel,Event<?>>.AbstractMailChannel
The specific implementation of the
MailChannel.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jgrapes.core.Channel
Channel.DefaultNested classes/interfaces inherited from interface org.jgrapes.core.Subchannel
Subchannel.DefaultSubchannel -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSenderChannel(Event<?> event, Channel mainChannel, Properties sessionProps, Optional<Password> password) Instantiates a new monitor channel. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the connection.protected voidClose the connection (not the channel).protected voidsendMessage(SendMailMessage event) Send the message provided by the event.Methods inherited from class org.jgrapes.mail.MailConnectionManager.AbstractMailChannel
openEventMethods inherited from class org.jgrapes.io.util.ConnectionManager.Connection
downPipelineMethods inherited from class org.jgrapes.core.Subchannel.DefaultSubchannel
associated, mainChannel, setAssociated, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jgrapes.core.Associator
associated, associated, associated, associated, associatedGet, setAssociatedMethods inherited from interface org.jgrapes.core.Subchannel
defaultCriterion, isEligibleFor, mainChannel
-
Constructor Details
-
SenderChannel
public SenderChannel(Event<?> event, Channel mainChannel, Properties sessionProps, Optional<Password> password) throws MessagingException Instantiates a new monitor channel.- Parameters:
event- the event that triggered the creationmainChannel- the main channel (of thisSubchannel)sessionProps- the session propertiespassword- the password- Throws:
MessagingException- the messaging exception
-
-
Method Details
-
sendMessage
Send the message provided by the event.- Parameters:
event- the event- Throws:
MessagingException
-
close
Description copied from class:ConnectionManager.ConnectionCloses the connection.If the last connection is closed and the component is a generator (see {@link ConnectionManager#connectionsGenerate()), the component is unregistered as generator.
- Overrides:
closein classConnectionManager<MailSender.SenderChannel>.Connection
-
closeConnection
Close the connection (not the channel).May be reopened later if closed due to idle time over.
-