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
Nested ClassesModifier and TypeClassDescriptionprotected classA sub-channel for mail connections.Nested classes/interfaces inherited from class org.jgrapes.io.util.ConnectionManager
ConnectionManager.ConnectionNested classes/interfaces inherited from interface org.jgrapes.core.Channel
Channel.Default -
Field Summary
FieldsFields inherited from class org.jgrapes.io.util.ConnectionManager
connections -
Constructor Summary
ConstructorsConstructorDescriptionMailConnectionManager(Channel componentChannel) Creates a new server using the given channel. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidconfigureComponent(Map<String, String> values) Configure the component specific values.voidConfigure 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, setExecutorServiceMethods inherited from class org.jgrapes.core.Component
channel, component, defaultCriterion, isEligibleFor, setNameMethods 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, unregisterAsGeneratorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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 themailproperties 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
-