org.zeroexchange.messaging
Class AbstractMessageListener<T extends Event>

java.lang.Object
  extended by org.zeroexchange.messaging.AbstractMessageListener<T>
All Implemented Interfaces:
DataProcessor, EventProcessor<T>
Direct Known Subclasses:
ContractCreatedOwnerListener, ContractStatusChangedMessageListener, PrivateMessageSentListener, UserRegisteredListener, UsersInvitationMessageListener

public abstract class AbstractMessageListener<T extends Event>
extends Object
implements EventProcessor<T>, DataProcessor

Author:
black

Constructor Summary
AbstractMessageListener()
           
 
Method Summary
protected  String getDefaultResourcePrefix()
          Returns the default template name.
protected  String getDefaultSubject()
          Returns subject of the sending email.
protected  String replacePlaceholders(String target, Map<String,Object> parameters)
          Replaces the placeholders.
protected  void send(Collection<User> recipients, User sender, String subject, String body)
          Sends the message using the template.
protected  void sendTemplate(Collection<User> recipients, User sender, String subject, Map<String,Object> parameters)
          Sends the message using the template.
protected  void sendTemplate(Collection<User> recipients, User sender, String subject, String templatePath, Map<String,Object> foreignParameters)
          Sends the message using the template.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.zeroexchange.event.EventProcessor
onEvent
 
Methods inherited from interface org.zeroexchange.common.processors.DataProcessor
getProcessingClass
 

Constructor Detail

AbstractMessageListener

public AbstractMessageListener()
Method Detail

sendTemplate

protected void sendTemplate(Collection<User> recipients,
                            User sender,
                            String subject,
                            Map<String,Object> parameters)
Sends the message using the template.


replacePlaceholders

protected String replacePlaceholders(String target,
                                     Map<String,Object> parameters)
Replaces the placeholders.


sendTemplate

protected void sendTemplate(Collection<User> recipients,
                            User sender,
                            String subject,
                            String templatePath,
                            Map<String,Object> foreignParameters)
Sends the message using the template.


send

protected void send(Collection<User> recipients,
                    User sender,
                    String subject,
                    String body)
Sends the message using the template.


getDefaultSubject

protected String getDefaultSubject()
Returns subject of the sending email.


getDefaultResourcePrefix

protected String getDefaultResourcePrefix()
Returns the default template name.



Copyright © 2013. All Rights Reserved.