public class ExceptionEmailer extends AbstractInitializableAttribute implements ExceptionSubscriber
SendMail
without attachments or an output. The password is read from a file to avoid
storing it in the model.SendMail
Red (beth) |
Red (beth) |
NamedObj.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
StringParameter |
cc
Email address to copy on the message.
|
Parameter |
enableSSL
Enable the Secure Sockets Layer (SSL) protocol.
|
StringParameter |
from
Email address from which this is sent.
|
FileParameter |
passwordFile
The file that the password is stored in.
|
Parameter |
reallySendMail
If true, then actually send the email.
|
StringParameter |
replyTo
The address to which replies should be directed.
|
StringParameter |
SMTPHostName
Host name for the send mail server.
|
StringParameter |
SMTPPort
Outgoing SMTP mail port.
|
StringParameter |
SMTPUserName
User name for the send mail server.
|
StringParameter |
statusMessage
A status message reflecting the success or failure of actions taken
upon occurrence of an exception.
|
StringParameter |
to
Email address(es) to which this is sent.
|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
Constructor and Description |
---|
ExceptionEmailer(NamedObj container,
java.lang.String name)
Invoked by an exception handler (e.g.
|
Modifier and Type | Method and Description |
---|---|
void |
attributeChanged(Attribute attribute)
React to a change in an attribute.
|
java.lang.Object |
clone(Workspace workspace)
Clone the object into the specified workspace.
|
boolean |
exceptionHandled(boolean succesful,
java.lang.String message)
Invoked by an exception handler (e.g.
|
boolean |
exceptionOccurred(java.lang.String policy,
java.lang.Throwable exception)
Send a mail upon occurrence of an exception.
|
_getInitializableContainer, addInitializable, hierarchyChanged, hierarchyWillChange, initialize, preinitialize, removeInitializable, setContainer, wrapup
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
description, getContainer, getDisplayName, getFullName, getName, getName, setName
public StringParameter cc
public Parameter enableSSL
public StringParameter from
public FileParameter passwordFile
public Parameter reallySendMail
public StringParameter replyTo
public StringParameter SMTPHostName
public StringParameter SMTPPort
public StringParameter SMTPUserName
public StringParameter statusMessage
public StringParameter to
public ExceptionEmailer(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
This attribute requires the JavaMail 1.5 javax.mail.jar file be in the classpath.
To use this actor, download javax.mail.jar
https://java.net/projects/javamail/pages/Home
and place it in
$PTII/vendors/misc/javamail
. Below are the steps:
cd $PTII/vendors/misc/javamail wget --no-check-certificate http://java.net/projects/javamail/downloads/download/javax.mail.jar cd $PTII ./configure
In Eclipse, you will then need to refresh the project.
*container
- The container.name
- The name.IllegalActionException
- If the superclass throws it.NameDuplicationException
- If the superclass throws it.public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class NamedObj
attribute
- The attribute that changed.IllegalActionException
- If the change is not acceptable
to this container (not thrown in this base class).public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class AbstractInitializableAttribute
workspace
- The workspace for the new object.java.lang.CloneNotSupportedException
- If any of the attributes
cannot be cloned.Object.clone()
public boolean exceptionHandled(boolean succesful, java.lang.String message)
ExceptionSubscriber
ExceptionManager
) after
an exception has been handled.exceptionHandled
in interface ExceptionSubscriber
succesful
- True if the exception was successfully handled; false
otherwisemessage
- A status message from the exception handlerpublic boolean exceptionOccurred(java.lang.String policy, java.lang.Throwable exception)
exceptionOccurred
in interface ExceptionSubscriber
policy
- The exception handling policyexception
- The exception that occurred