1 32 33 package org.apache.sandesha.client; 34 35 36 import org.apache.axis.Handler; 37 import org.apache.axis.SimpleChain; 38 import org.apache.axis.components.logger.LogFactory; 39 import org.apache.commons.logging.Log; 40 41 import java.util.Iterator ; 42 import java.util.List ; 43 44 45 52 53 public class ClientHandlerUtil { 54 55 56 private static final Log log = LogFactory.getLog(ClientHandlerUtil.class.getName()); 57 58 59 public static SimpleChain getHandlerChain(List arr) { 60 61 SimpleChain reqHandlers = new SimpleChain(); 62 63 Iterator it = arr.iterator(); 64 65 boolean hasReqHandlers = false; 66 67 try { 68 69 while (it.hasNext()) { 70 71 hasReqHandlers = true; 72 73 String strClass = (String ) it.next(); 74 75 Class c = Class.forName(strClass); 76 77 Handler h = (Handler) c.newInstance(); 78 79 reqHandlers.addHandler(h); 80 81 } 82 83 } catch (Exception e) { 84 85 log.error(e); 86 87 return null; 88 89 } 90 91 if (hasReqHandlers) 92 93 return reqHandlers; 94 95 else 96 97 return null; 98 99 } 100 101 102 } 103 104 | Popular Tags |