1 10 11 package org.mule.providers.email.filters; 12 13 import javax.mail.Message ; 14 15 import org.apache.commons.logging.Log; 16 import org.apache.commons.logging.LogFactory; 17 import org.mule.umo.UMOFilter; 18 import org.mule.umo.UMOMessage; 19 20 24 public abstract class AbstractMailFilter implements UMOFilter 25 { 26 29 protected transient Log logger = LogFactory.getLog(getClass()); 30 31 public final boolean accept(UMOMessage message) 32 { 33 if (message == null) 34 { 35 return false; 36 } 37 38 Object object = message.getPayload(); 39 if (object instanceof Message ) 40 { 41 return accept((Message )object); 42 } 43 else 44 { 45 throw new IllegalArgumentException ("The Mail filter does not understand: " 46 + object.getClass().getName()); 47 } 48 } 49 50 public abstract boolean accept(Message message); 51 } 52 | Popular Tags |