|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MessageTemplate<Type>
MessageTemplate it the template a Message of a Mailing is build of.
It must be able to build a Message for each recipient.
The Message has to be in the format that is able to be send by a
MessageGateway.
As MessageTemplates are likely to access resources, that have a state.
Eg. a Session to the Repository, Binary Values or Database access.
Therefore the template must be disposed if there no further use for it.
Mailing| Method Summary | |
|---|---|
Type |
buildMessage(Profile recipient)
Builds a personalized message for the recipient given as argument. |
void |
dispose()
Called if the Template will not be used any longer. |
Class<Type> |
getType()
|
void |
put(String var,
String replace)
Adds or overwrites a mapping of this replacer. |
| Method Detail |
|---|
Class<Type> getType()
Type buildMessage(Profile recipient)
throws MailingException
recipient given as argument.
disposed an
IllegalStateException is thrown.
recipient - to build a message for
null if the
MailingRecipient does not provide sufficient data to build a
Message (eg. no e-mail address to build a e-mail Message)
MailingException - in case of an error building the message that is
independent of the MailingRecipient eg. access to template storage
is in exceptional state.
IllegalStateException - in case method dispose
has been called before.
void dispose()
throws MailingException
buildMessage
will fail.
Implementations can dispose any used Resources eg.
Binary Values, Database access.
MailingException - in case of exception disposing one of the resources
void put(String var,
String replace)
var - name of the variable to mapreplace - the value of the variable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||