@Override public void init() throws MessagingException { String mapping = getInitParameter("mapping"); if (mapping != null) { mappings = RecipientRewriteTableUtil.getXMLMappings(mapping); } }
/** * @see org.apache.james.rrt.lib.AbstractRecipientRewriteTable#doConfigure(org.apache.commons.configuration.HierarchicalConfiguration) */ @SuppressWarnings("unchecked") protected void doConfigure(HierarchicalConfiguration arg0) throws ConfigurationException { List<String> mapConf = arg0.getList("mapping"); mappings = new HashMap<String, String>(); if (mapConf != null && mapConf.size() > 0) { for (int i = 0; i < mapConf.size(); i++) { mappings.putAll(RecipientRewriteTableUtil.getXMLMappings(mapConf.get(i))); } } else { throw new ConfigurationException("No mapping configured"); } }