1 6 package org.jboss.webservice.jaf; 7 8 import javax.activation.CommandMap ; 9 import javax.activation.MailcapCommandMap ; 10 11 import org.jboss.logging.Logger; 12 13 24 public class JAFConfigService 25 { 26 private static Logger log = Logger.getLogger(JAFConfigService.class); 27 30 private String [] mailcaps = { 31 "text/xml;;x-java-content-handler=org.jboss.webservice.jaf.XMLDataContentHandler", 32 "application/xml;;x-java-content-handler=org.jboss.webservice.jaf.XMLDataContentHandler" 33 }; 34 35 public String [] getMailcaps() 36 { 37 return mailcaps; 38 } 39 40 public void setMailcaps(String [] mailcaps) 41 { 42 this.mailcaps = mailcaps; 43 } 44 45 51 public void start() throws Exception 52 { 53 CommandMap commandMap = CommandMap.getDefaultCommandMap(); 54 if (commandMap instanceof MailcapCommandMap ) 55 { 56 MailcapCommandMap mailMap = (MailcapCommandMap )commandMap; 57 for (int n = 0; n < mailcaps.length; n++) 58 { 59 String mailcap = mailcaps[n]; 60 mailMap.addMailcap(mailcap); 61 log.debug("Added mailcap: " + mailcap); 62 } 63 } 64 else 65 { 66 throw new Exception ("Cannot handle non-MailcapCommandMap, map=" 67 + commandMap); 68 } 69 } 70 71 76 public void stop() throws Exception 77 { 78 } 79 80 } 81 | Popular Tags |