1 17 18 package org.apache.sandesha.server; 19 20 import org.apache.axis.Handler; 21 import org.apache.axis.MessageContext; 22 import org.apache.axis.providers.java.RPCProvider; 23 import org.apache.sandesha.Constants; 24 25 import java.util.Collections ; 26 import java.util.Map ; 27 28 35 36 public class DelegateInvokeHandler implements InvokeHandler { 37 private Map params = Collections.EMPTY_MAP; 38 39 public boolean handleInvoke(MessageContext aMessageContext) throws Exception { 40 Handler handler = (Handler) Class.forName(getActualInvoker()).newInstance(); 41 handler.invoke(aMessageContext); 42 return aMessageContext.getOperation().getMethod().getReturnType() == Void.TYPE; 43 } 44 45 protected String getActualInvoker() { 46 String invoker = (String ) getParms().get(Constants.INVOKER); 47 if (invoker == null || invoker.length() == 0) { 48 invoker = RPCProvider.class.getName(); 49 } 50 return invoker; 51 } 52 53 protected Map getParms() { 54 return params; 55 } 56 57 public void addParams(Map aParams) { 58 if (aParams != null) { 59 params = aParams; 60 } 61 } 62 } 63 64 | Popular Tags |