Package org.jgrapes.mail
Class MailConnectionManager<C extends MailConnectionManager<C,O>.AbstractMailChannel,O extends Event<?>>
java.lang.Object
org.jgrapes.core.internal.ComponentVertex
org.jgrapes.core.Component
org.jgrapes.io.util.ConnectionManager<C>
org.jgrapes.mail.MailConnectionManager<C,O>
- Type Parameters:
C
- the type of the channelO
- the type of the open event
- All Implemented Interfaces:
Iterable<ComponentType>
,Channel
,ComponentType
,Eligible
,Manager
- Direct Known Subclasses:
MailMonitor
,MailSender
public abstract class MailConnectionManager<C extends MailConnectionManager<C,O>.AbstractMailChannel,O extends Event<?>>
extends ConnectionManager<C>
Provides a base class for mail components using connections.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
A sub-channel for mail connections.Nested classes/interfaces inherited from class org.jgrapes.io.util.ConnectionManager
ConnectionManager.Connection
Nested classes/interfaces inherited from interface org.jgrapes.core.Channel
Channel.Default
-
Field Summary
Fields inherited from class org.jgrapes.io.util.ConnectionManager
connections
-
Constructor Summary
ConstructorDescriptionMailConnectionManager
(Channel componentChannel) Creates a new server using the given channel. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
configureComponent
(Map<String, String> values) Configure the component specific values.void
Configure the component.password()
Return the password.setMailProperties
(Map<String, String> props) Sets the mail properties.setPassword
(Password password) Sets the password.Methods inherited from class org.jgrapes.io.util.ConnectionManager
connectionsGenerate, 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, channelReplacements, 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
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
mailProps
-
-
Constructor Details
-
MailConnectionManager
Creates a new server using the given channel.- Parameters:
componentChannel
- the component’s channel
-
-
Method Details
-
setMailProperties
Sets the mail properties.See the Jakarta Mail documentation for available settings. The given properties are merged with the already existing properties.
- Parameters:
props
- the props- Returns:
- the mail monitor
-
setPassword
Sets the password.- Parameters:
password
- the new password
-
password
Return the password.- Returns:
- the optional password
-
onConfigUpdate
Configure the component.Attempts to access all paths specified in the package description in sequence as described in
org.jgrapes.mail
. For each path, merges themail
properties and invokesconfigureComponent(java.util.Map<java.lang.String, java.lang.String>)
with the available key/value pairs.- Parameters:
event
- the event
-
configureComponent
Configure the component specific values.- Parameters:
values
- the values
-