1 16 package org.apache.axis2.engine; 17 18 import org.apache.axis2.context.ConfigurationContext; 19 import org.apache.axis2.context.MessageContext; 20 import org.apache.axis2.context.OperationContext; 21 import org.apache.axis2.description.HandlerDescription; 22 import org.apache.axis2.description.OperationDescription; 23 import org.apache.axis2.description.ServiceDescription; 24 import org.apache.axis2.handlers.AbstractHandler; 25 26 import javax.xml.namespace.QName ; 27 28 31 public abstract class AbstractDispatcher extends AbstractHandler implements Handler { 32 35 public static final QName NAME = 36 new QName ("http://axis.ws.apache.org", "AddressingBasedDispatcher"); 37 38 41 private ConfigurationContext engineContext; 42 43 public AbstractDispatcher() { 44 init(new HandlerDescription(NAME)); 45 } 46 47 53 public final void invoke(MessageContext msgctx) throws AxisFault { 54 55 if(msgctx.getServiceContext() == null){ 56 ServiceDescription axisService = findService(msgctx); 57 if(axisService != null){ 58 msgctx.setServiceContext(axisService.findServiceContext(msgctx)); 59 } 60 } 61 62 if (msgctx.getServiceContext() != null && msgctx.getOperationContext() == null) { 63 OperationDescription axisOperation = findOperation(msgctx.getServiceContext().getServiceConfig(),msgctx); 64 if(axisOperation != null){ 65 OperationContext operationContext = axisOperation.findOperationContext(msgctx,msgctx.getServiceContext()); 66 msgctx.setOperationContext(operationContext); 67 } 68 } 69 70 } 71 72 public abstract ServiceDescription findService(MessageContext messageContext)throws AxisFault; 73 public abstract OperationDescription findOperation(ServiceDescription service,MessageContext messageContext)throws AxisFault; 74 75 } 76 | Popular Tags |