package it.mice.voila.runtime.mail.manager;

import it.mice.voila.runtime.mail.beans.MailConfig;
import it.mice.voila.runtime.mail.beans.MailEvent;
import it.mice.voila.runtime.mail.beans.MailTemplate;
/**
 * Concrete Mail Manager that load mail engine configuration via spring xml configuration file (generally applicationContext-Mail.xml).
 */
public class XmlMailManager extends MailManager {

	/* (non-Javadoc)
	 * @see it.mice.voila.runtime.mail.senders.MailSenderAdapter#initMailConfigs(java.util.Map)
	 */
	@Override
	protected void initMailConfigs() {
		getMailConfigs().putAll(getApplicationContext().getBeansOfType(MailConfig.class));
	}

	/* (non-Javadoc)
	 * @see it.mice.voila.runtime.mail.senders.MailSenderAdapter#initMailTemplates(java.util.Map)
	 */
	@Override
	protected void initMailTemplates() {
		getMailTemplates().putAll(getApplicationContext().getBeansOfType(MailTemplate.class));
	}

	/* (non-Javadoc)
	 * @see it.mice.voila.runtime.mail.senders.MailSenderAdapter#initMailEvents(java.util.Map)
	 */
	@Override
	protected void initMailEvents() {
		getMailEvents().putAll(getApplicationContext().getBeansOfType(MailEvent.class));
	}

}
