axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r550540 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: dispatchers/ engine/
Date Mon, 25 Jun 2007 16:34:49 GMT
Author: dims
Date: Mon Jun 25 09:34:45 2007
New Revision: 550540

URL: http://svn.apache.org/viewvc?view=rev&rev=550540
Log:
Moving classes to the correct package. add deprecated stubs that extend the correct class
for backward compat. This is step 1. Need to fix references in existing axis2.xml's in the
next check-in and maybe add a log.warn if old class is used when loading dispatchers

Added:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/AddressingBasedDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/HTTPLocationBasedDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RequestURIBasedDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RequestURIOperationDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPActionBasedDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedDispatcher.java
Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/HTTPLocationBasedDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/RequestURIOperationDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/AddressingBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/AddressingBasedDispatcher.java?view=auto&rev=550540
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/AddressingBasedDispatcher.java
(added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/AddressingBasedDispatcher.java
Mon Jun 25 09:34:45 2007
@@ -0,0 +1,107 @@
+/*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.axis2.dispatchers;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.context.ServiceGroupContext;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.engine.AbstractDispatcher;
+import org.apache.axis2.i18n.Messages;
+import org.apache.axis2.util.LoggingControl;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Dispatcher based on the WS-Addressing properties.
+ */
+public class AddressingBasedDispatcher extends AbstractDispatcher implements AddressingConstants
{
+
+    /**
+     * Field NAME
+     */
+    public static final String NAME = "AddressingBasedDispatcher";
+    private static final Log log = LogFactory.getLog(AddressingBasedDispatcher.class);
+    private RequestURIBasedServiceDispatcher rubsd = new RequestURIBasedServiceDispatcher();
+    private ActionBasedOperationDispatcher abod = new ActionBasedOperationDispatcher();
+
+    public AxisOperation findOperation(AxisService service, MessageContext messageContext)
+            throws AxisFault {
+        return abod.findOperation(service, messageContext);
+    }
+
+    public AxisService findService(MessageContext messageContext) throws AxisFault {
+    	return rubsd.findService(messageContext);
+    }
+
+    public void initDispatcher() {
+        init(new HandlerDescription(NAME));
+    }
+
+    /**
+     * @param msgctx
+     * @throws org.apache.axis2.AxisFault
+     * @noinspection MethodReturnOfConcreteClass
+     */
+    public InvocationResponse invoke(MessageContext msgctx) throws AxisFault {
+        // first check we can dispatch using the relates to
+        if (msgctx.getRelatesTo() != null) {
+            String relatesTo = msgctx.getRelatesTo().getValue();
+
+            if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
+                log.debug(msgctx.getLogIDString() + " " + Messages.getMessage("checkingrelatesto",
+                                                                              relatesTo));
+            }
+            if (relatesTo != null && !"".equals(relatesTo) && (msgctx.getOperationContext()==null))
{
+                OperationContext operationContext =
+                        msgctx.getConfigurationContext()
+                                .getOperationContext(relatesTo);
+
+                if (operationContext != null) //noinspection TodoComment
+                {
+//                    if(operationContext.isComplete()){
+//                        // If the dispatch happens because of the RelatesTo and the mep
is complete
+//                        // we should throw a more descriptive fault.
+//                        throw new AxisFault(Messages.getMessage("duplicaterelatesto",relatesTo));
+//                    }
+                    msgctx.setAxisOperation(operationContext.getAxisOperation());
+                    msgctx.setOperationContext(operationContext);
+                    msgctx.setServiceContext((ServiceContext) operationContext.getParent());
+                    msgctx.setAxisService(
+                            ((ServiceContext) operationContext.getParent()).getAxisService());
+
+                    // TODO : Is this necessary here?
+                    msgctx.getAxisOperation().registerMessageContext(msgctx, operationContext);
+
+                    msgctx.setServiceGroupContextId(
+                            ((ServiceGroupContext) msgctx.getServiceContext().getParent()).getId());
+
+                    if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled())
{
+                        log.debug(msgctx.getLogIDString() +
+                                " Dispatched successfully on the RelatesTo. operation=" +
+                                operationContext.getAxisOperation());
+                    }
+                    return InvocationResponse.CONTINUE;
+                }
+            }
+        }
+        return super.invoke(msgctx);
+    }
+}

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/HTTPLocationBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/HTTPLocationBasedDispatcher.java?view=auto&rev=550540
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/HTTPLocationBasedDispatcher.java
(added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/HTTPLocationBasedDispatcher.java
Mon Jun 25 09:34:45 2007
@@ -0,0 +1,134 @@
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+
+package org.apache.axis2.dispatchers;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.engine.AbstractDispatcher;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.AxisEndpoint;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.description.WSDL2Constants;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * Dispatches the operation based on the information from the target endpoint URL.
+ */
+public class HTTPLocationBasedDispatcher extends AbstractDispatcher {
+
+    public static final String NAME = "HTTPLocationBasedDispatcher";
+    private static final Log log = LogFactory.getLog(HTTPLocationBasedDispatcher.class);
+
+    /*
+     *  (non-Javadoc)
+     * @see org.apache.axis2.engine.AbstractDispatcher#findOperation(org.apache.axis2.description.AxisService,
org.apache.axis2.context.MessageContext)
+     */
+    public AxisOperation findOperation(AxisService service, MessageContext messageContext)
+            throws AxisFault {
+
+        AxisService axisService = messageContext.getAxisService();
+        if (axisService != null) {
+            String uri = messageContext.getTo().getAddress();
+            String httpLocation = parseRequestURL(uri, messageContext
+                    .getConfigurationContext().getServiceContextPath());
+
+            if (httpLocation != null) {
+                AxisEndpoint axisEndpoint = (AxisEndpoint) messageContext
+                        .getProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME);
+                if (axisEndpoint != null) {
+                    Map httpLocationTable = (Map) axisEndpoint.getBinding()
+                            .getProperty(WSDL2Constants.HTTP_LOCATION_TABLE);
+                    if (httpLocationTable != null) {
+                        return getOperationFromHTTPLocation(httpLocation, httpLocationTable);
+                    }
+                }
+            } else {
+                log.debug("Attempt to check for Operation using HTTP Location failed");
+                return null;
+            }
+        }
+        return null;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
+     */
+    public AxisService findService(MessageContext messageContext) throws AxisFault {
+        // This Dispatcher does not need to resolve the service, as that is handled
+        // by the RequestURIBasedDispatcher.
+        return null;
+    }
+
+    public void initDispatcher() {
+        init(new HandlerDescription(NAME));
+    }
+
+    private String parseRequestURL(String path, String servicePath) {
+
+        int index = path.lastIndexOf(servicePath);
+        String service = null;
+
+        if (-1 != index) {
+            int serviceStart = index + servicePath.length();
+            if (path.length() > serviceStart + 1) {
+                service = path.substring(serviceStart + 1);
+            }
+        }
+
+        if (service != null) {
+            index = service.indexOf("/");
+            if (-1 != index) {
+                service = service.substring(index);
+            } else {
+                int queryIndex = service.indexOf("?");
+                if (queryIndex != -1) {
+                    service = service.substring(queryIndex);
+                }
+            }
+        }
+        return service;
+    }
+
+    /**
+     * Given the requestPath that the request came to his method returns the corresponding
axisOperation
+     *
+     * @param requestPath - Part of the request url which is the part after the service name
+     * @return AxisOperation - The corresponding AxisOperation
+     */
+    private AxisOperation getOperationFromHTTPLocation(String requestPath, Map httpLocationTable)
{
+
+        Collection httpLocations = httpLocationTable.keySet();
+        Iterator iter = httpLocations.iterator();
+        while (iter.hasNext()) {
+            String location = (String) iter.next();
+            int index = requestPath.indexOf(location);
+            if (index == 0) {
+                return (AxisOperation) httpLocationTable.get(location);
+            }
+
+        }
+        return null;
+    }
+}
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RequestURIBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RequestURIBasedDispatcher.java?view=auto&rev=550540
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RequestURIBasedDispatcher.java
(added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RequestURIBasedDispatcher.java
Mon Jun 25 09:34:45 2007
@@ -0,0 +1,53 @@
+/*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.axis2.dispatchers;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.engine.AbstractDispatcher;
+
+/**
+ * Dispatches the service based on the information from the target endpoint URL.
+ */
+public class RequestURIBasedDispatcher extends AbstractDispatcher {
+
+    public static final String NAME = "RequestURIBasedDispatcher";
+    private RequestURIBasedServiceDispatcher rubsd = new RequestURIBasedServiceDispatcher();
+    
+    /*
+     *  (non-Javadoc)
+     * @see org.apache.axis2.engine.AbstractDispatcher#findOperation(org.apache.axis2.description.AxisService,
org.apache.axis2.context.MessageContext)
+     */
+    public AxisOperation findOperation(AxisService service, MessageContext messageContext)
+            throws AxisFault {
+        // This Dispatcher does not need to resolve the operation, as that is handled
+        // by the RequestURIOperationDispatcher.
+        return null;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
+     */
+    public AxisService findService(MessageContext messageContext) throws AxisFault {
+    	return rubsd.findService(messageContext);
+    }
+
+    public void initDispatcher() {
+        init(new HandlerDescription(NAME));
+    }
+}

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RequestURIOperationDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RequestURIOperationDispatcher.java?view=auto&rev=550540
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RequestURIOperationDispatcher.java
(added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RequestURIOperationDispatcher.java
Mon Jun 25 09:34:45 2007
@@ -0,0 +1,53 @@
+/*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.axis2.dispatchers;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.engine.AbstractDispatcher;
+
+/**
+ * Dispatches the operation based on the information from the target endpoint URL.
+ */
+public class RequestURIOperationDispatcher extends AbstractDispatcher {
+
+    public static final String NAME = "RequestURIOperationDispatcher";
+    private RequestURIBasedOperationDispatcher rubod = new RequestURIBasedOperationDispatcher();
+
+    /*
+     *  (non-Javadoc)
+     * @see org.apache.axis2.engine.AbstractDispatcher#findOperation(org.apache.axis2.description.AxisService,
org.apache.axis2.context.MessageContext)
+     */
+    public AxisOperation findOperation(AxisService service, MessageContext messageContext)
+            throws AxisFault {
+    	return rubod.findOperation(service, messageContext);
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
+     */
+    public AxisService findService(MessageContext messageContext) throws AxisFault {
+        // This Dispatcher does not need to resolve the service, as that is handled
+        // by the RequestURIBasedDispatcher.
+        return null;
+    }
+
+    public void initDispatcher() {
+        init(new HandlerDescription(NAME));
+    }
+}

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPActionBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPActionBasedDispatcher.java?view=auto&rev=550540
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPActionBasedDispatcher.java
(added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPActionBasedDispatcher.java
Mon Jun 25 09:34:45 2007
@@ -0,0 +1,59 @@
+/*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.axis2.dispatchers;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.engine.AbstractDispatcher;
+import org.apache.axis2.util.LoggingControl;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Dispatches based on the SOAPAction.
+ */
+public class SOAPActionBasedDispatcher extends AbstractDispatcher {
+
+    /**
+     * Field NAME
+     */
+    public static final String NAME = "SOAPActionBasedDispatcher";
+    private static final Log log = LogFactory.getLog(SOAPActionBasedDispatcher.class);
+    private ActionBasedOperationDispatcher abod = new ActionBasedOperationDispatcher();
+
+    public AxisOperation findOperation(AxisService service, MessageContext messageContext)
+            throws AxisFault {
+        return abod.findOperation(service, messageContext);
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
+     */
+    public AxisService findService(MessageContext messageContext) throws AxisFault {
+        if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
+            log.debug(messageContext.getLogIDString() +
+                    " Checking for Service using SOAPAction is a TODO item");
+        }
+        return null;
+    }
+
+    public void initDispatcher() {
+        init(new HandlerDescription(NAME));
+    }
+}

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedDispatcher.java?view=auto&rev=550540
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedDispatcher.java
(added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedDispatcher.java
Mon Jun 25 09:34:45 2007
@@ -0,0 +1,110 @@
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+
+package org.apache.axis2.dispatchers;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.engine.AbstractDispatcher;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.util.LoggingControl;
+import org.apache.axis2.util.Utils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Dispatches based on the namespace URI of the first child of
+ * the body.
+ */
+public class SOAPMessageBodyBasedDispatcher extends AbstractDispatcher {
+
+    /**
+     * Field NAME
+     */
+    public static final String NAME = "SOAPMessageBodyBasedDispatcher";
+    private static final Log log = LogFactory.getLog(SOAPMessageBodyBasedDispatcher.class);
+
+    public AxisOperation findOperation(AxisService service, MessageContext messageContext)
+            throws AxisFault {
+
+        OMElement bodyFirstChild = messageContext.getEnvelope().getBody().getFirstElement();
+
+        AxisOperation axisOperation = null;
+        if (bodyFirstChild != null){
+           axisOperation = service.getOperationByMessageElementQName(bodyFirstChild.getQName());
+
+           // this is required for services uses the RPC message receiver
+           if (axisOperation == null){
+               QName operationName = new QName(bodyFirstChild.getLocalName());
+               axisOperation = service.getOperation(operationName);
+           }
+
+        }
+        return axisOperation;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
+     */
+    public AxisService findService(MessageContext messageContext) throws AxisFault {
+        String serviceName;
+
+        OMElement bodyFirstChild = messageContext.getEnvelope().getBody().getFirstElement();
+
+        if (bodyFirstChild != null) {
+            OMNamespace ns = bodyFirstChild.getNamespace();
+
+            if (ns != null) {
+                String filePart = ns.getNamespaceURI();
+
+                if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
+                    log.debug(messageContext.getLogIDString() +
+                            " Checking for Service using SOAP message body's first child's
namespace : "
+                            + filePart);
+                }
+                ConfigurationContext configurationContext =
+                        messageContext.getConfigurationContext();
+                String[] values = Utils.parseRequestURLForServiceAndOperation(filePart,
+                                                                              configurationContext.getServiceContextPath());
+
+                if (values[0] != null) {
+                    serviceName = values[0];
+
+                    AxisConfiguration registry =
+                            configurationContext.getAxisConfiguration();
+
+                    return registry.getService(serviceName);
+                }
+            }
+        }
+
+        return null;
+    }
+
+    public void initDispatcher() {
+        init(new HandlerDescription(NAME));
+    }
+}

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java?view=diff&rev=550540&r1=550539&r2=550540
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
Mon Jun 25 09:34:45 2007
@@ -14,95 +14,9 @@
 
 package org.apache.axis2.engine;
 
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.AddressingConstants;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.OperationContext;
-import org.apache.axis2.context.ServiceContext;
-import org.apache.axis2.context.ServiceGroupContext;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.HandlerDescription;
-import org.apache.axis2.dispatchers.ActionBasedOperationDispatcher;
-import org.apache.axis2.dispatchers.RequestURIBasedServiceDispatcher;
-import org.apache.axis2.i18n.Messages;
-import org.apache.axis2.util.LoggingControl;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 /**
  * Dispatcher based on the WS-Addressing properties.
+ * @deprecated use org.apache.axis2.dispatchers.AddressingBasedDispatcher
  */
-public class AddressingBasedDispatcher extends AbstractDispatcher implements AddressingConstants
{
-
-    /**
-     * Field NAME
-     */
-    public static final String NAME = "AddressingBasedDispatcher";
-    private static final Log log = LogFactory.getLog(AddressingBasedDispatcher.class);
-    private RequestURIBasedServiceDispatcher rubsd = new RequestURIBasedServiceDispatcher();
-    private ActionBasedOperationDispatcher abod = new ActionBasedOperationDispatcher();
-
-    public AxisOperation findOperation(AxisService service, MessageContext messageContext)
-            throws AxisFault {
-        return abod.findOperation(service, messageContext);
-    }
-
-    public AxisService findService(MessageContext messageContext) throws AxisFault {
-    	return rubsd.findService(messageContext);
-    }
-
-    public void initDispatcher() {
-        init(new HandlerDescription(NAME));
-    }
-
-    /**
-     * @param msgctx
-     * @throws org.apache.axis2.AxisFault
-     * @noinspection MethodReturnOfConcreteClass
-     */
-    public InvocationResponse invoke(MessageContext msgctx) throws AxisFault {
-        // first check we can dispatch using the relates to
-        if (msgctx.getRelatesTo() != null) {
-            String relatesTo = msgctx.getRelatesTo().getValue();
-
-            if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
-                log.debug(msgctx.getLogIDString() + " " + Messages.getMessage("checkingrelatesto",
-                                                                              relatesTo));
-            }
-            if (relatesTo != null && !"".equals(relatesTo) && (msgctx.getOperationContext()==null))
{
-                OperationContext operationContext =
-                        msgctx.getConfigurationContext()
-                                .getOperationContext(relatesTo);
-
-                if (operationContext != null) //noinspection TodoComment
-                {
-//                    if(operationContext.isComplete()){
-//                        // If the dispatch happens because of the RelatesTo and the mep
is complete
-//                        // we should throw a more descriptive fault.
-//                        throw new AxisFault(Messages.getMessage("duplicaterelatesto",relatesTo));
-//                    }
-                    msgctx.setAxisOperation(operationContext.getAxisOperation());
-                    msgctx.setOperationContext(operationContext);
-                    msgctx.setServiceContext((ServiceContext) operationContext.getParent());
-                    msgctx.setAxisService(
-                            ((ServiceContext) operationContext.getParent()).getAxisService());
-
-                    // TODO : Is this necessary here?
-                    msgctx.getAxisOperation().registerMessageContext(msgctx, operationContext);
-
-                    msgctx.setServiceGroupContextId(
-                            ((ServiceGroupContext) msgctx.getServiceContext().getParent()).getId());
-
-                    if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled())
{
-                        log.debug(msgctx.getLogIDString() +
-                                " Dispatched successfully on the RelatesTo. operation=" +
-                                operationContext.getAxisOperation());
-                    }
-                    return InvocationResponse.CONTINUE;
-                }
-            }
-        }
-        return super.invoke(msgctx);
-    }
+public class AddressingBasedDispatcher extends org.apache.axis2.dispatchers.AddressingBasedDispatcher
{
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/HTTPLocationBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/HTTPLocationBasedDispatcher.java?view=diff&rev=550540&r1=550539&r2=550540
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/HTTPLocationBasedDispatcher.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/HTTPLocationBasedDispatcher.java
Mon Jun 25 09:34:45 2007
@@ -17,117 +17,10 @@
 
 package org.apache.axis2.engine;
 
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.AxisEndpoint;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.HandlerDescription;
-import org.apache.axis2.description.WSDL2Constants;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-
 /**
  * Dispatches the operation based on the information from the target endpoint URL.
+ *
+ * @deprecated use org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher
  */
-public class HTTPLocationBasedDispatcher extends AbstractDispatcher {
-
-    public static final String NAME = "HTTPLocationBasedDispatcher";
-    private static final Log log = LogFactory.getLog(HTTPLocationBasedDispatcher.class);
-
-    /*
-     *  (non-Javadoc)
-     * @see org.apache.axis2.engine.AbstractDispatcher#findOperation(org.apache.axis2.description.AxisService,
org.apache.axis2.context.MessageContext)
-     */
-    public AxisOperation findOperation(AxisService service, MessageContext messageContext)
-            throws AxisFault {
-
-        AxisService axisService = messageContext.getAxisService();
-        if (axisService != null) {
-            String uri = messageContext.getTo().getAddress();
-            String httpLocation = parseRequestURL(uri, messageContext
-                    .getConfigurationContext().getServiceContextPath());
-
-            if (httpLocation != null) {
-                AxisEndpoint axisEndpoint = (AxisEndpoint) messageContext
-                        .getProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME);
-                if (axisEndpoint != null) {
-                    Map httpLocationTable = (Map) axisEndpoint.getBinding()
-                            .getProperty(WSDL2Constants.HTTP_LOCATION_TABLE);
-                    if (httpLocationTable != null) {
-                        return getOperationFromHTTPLocation(httpLocation, httpLocationTable);
-                    }
-                }
-            } else {
-                log.debug("Attempt to check for Operation using HTTP Location failed");
-                return null;
-            }
-        }
-        return null;
-    }
-
-    /*
-     *  (non-Javadoc)
-     * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
-     */
-    public AxisService findService(MessageContext messageContext) throws AxisFault {
-        // This Dispatcher does not need to resolve the service, as that is handled
-        // by the RequestURIBasedDispatcher.
-        return null;
-    }
-
-    public void initDispatcher() {
-        init(new HandlerDescription(NAME));
-    }
-
-    private String parseRequestURL(String path, String servicePath) {
-
-        int index = path.lastIndexOf(servicePath);
-        String service = null;
-
-        if (-1 != index) {
-            int serviceStart = index + servicePath.length();
-            if (path.length() > serviceStart + 1) {
-                service = path.substring(serviceStart + 1);
-            }
-        }
-
-        if (service != null) {
-            index = service.indexOf("/");
-            if (-1 != index) {
-                service = service.substring(index);
-            } else {
-                int queryIndex = service.indexOf("?");
-                if (queryIndex != -1) {
-                    service = service.substring(queryIndex);
-                }
-            }
-        }
-        return service;
-    }
-
-    /**
-     * Given the requestPath that the request came to his method returns the corresponding
axisOperation
-     *
-     * @param requestPath - Part of the request url which is the part after the service name
-     * @return AxisOperation - The corresponding AxisOperation
-     */
-    private AxisOperation getOperationFromHTTPLocation(String requestPath, Map httpLocationTable)
{
-
-        Collection httpLocations = httpLocationTable.keySet();
-        Iterator iter = httpLocations.iterator();
-        while (iter.hasNext()) {
-            String location = (String) iter.next();
-            int index = requestPath.indexOf(location);
-            if (index == 0) {
-                return (AxisOperation) httpLocationTable.get(location);
-            }
-
-        }
-        return null;
-    }
-}
\ No newline at end of file
+public class HTTPLocationBasedDispatcher extends org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher
{
+}

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java?view=diff&rev=550540&r1=550539&r2=550540
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java
Mon Jun 25 09:34:45 2007
@@ -13,41 +13,10 @@
 */
 package org.apache.axis2.engine;
 
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.HandlerDescription;
-import org.apache.axis2.dispatchers.RequestURIBasedServiceDispatcher;
-
 /**
  * Dispatches the service based on the information from the target endpoint URL.
+ *
+ * @deprecated use org.apache.axis2.dispatchers.RequestURIBasedDispatcher
  */
-public class RequestURIBasedDispatcher extends AbstractDispatcher {
-
-    public static final String NAME = "RequestURIBasedDispatcher";
-    private RequestURIBasedServiceDispatcher rubsd = new RequestURIBasedServiceDispatcher();
-    
-    /*
-     *  (non-Javadoc)
-     * @see org.apache.axis2.engine.AbstractDispatcher#findOperation(org.apache.axis2.description.AxisService,
org.apache.axis2.context.MessageContext)
-     */
-    public AxisOperation findOperation(AxisService service, MessageContext messageContext)
-            throws AxisFault {
-        // This Dispatcher does not need to resolve the operation, as that is handled
-        // by the RequestURIOperationDispatcher.
-        return null;
-    }
-
-    /*
-     *  (non-Javadoc)
-     * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
-     */
-    public AxisService findService(MessageContext messageContext) throws AxisFault {
-    	return rubsd.findService(messageContext);
-    }
-
-    public void initDispatcher() {
-        init(new HandlerDescription(NAME));
-    }
+public class RequestURIBasedDispatcher extends org.apache.axis2.dispatchers.RequestURIBasedDispatcher
{
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/RequestURIOperationDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/RequestURIOperationDispatcher.java?view=diff&rev=550540&r1=550539&r2=550540
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/RequestURIOperationDispatcher.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/RequestURIOperationDispatcher.java
Mon Jun 25 09:34:45 2007
@@ -13,41 +13,10 @@
 */
 package org.apache.axis2.engine;
 
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.HandlerDescription;
-import org.apache.axis2.dispatchers.RequestURIBasedOperationDispatcher;
-
 /**
  * Dispatches the operation based on the information from the target endpoint URL.
+ *
+ * @deprecated use org.apache.axis2.dispatchers.RequestURIOperationDispatcher
  */
-public class RequestURIOperationDispatcher extends AbstractDispatcher {
-
-    public static final String NAME = "RequestURIOperationDispatcher";
-    private RequestURIBasedOperationDispatcher rubod = new RequestURIBasedOperationDispatcher();
-
-    /*
-     *  (non-Javadoc)
-     * @see org.apache.axis2.engine.AbstractDispatcher#findOperation(org.apache.axis2.description.AxisService,
org.apache.axis2.context.MessageContext)
-     */
-    public AxisOperation findOperation(AxisService service, MessageContext messageContext)
-            throws AxisFault {
-    	return rubod.findOperation(service, messageContext);
-    }
-
-    /*
-     *  (non-Javadoc)
-     * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
-     */
-    public AxisService findService(MessageContext messageContext) throws AxisFault {
-        // This Dispatcher does not need to resolve the service, as that is handled
-        // by the RequestURIBasedDispatcher.
-        return null;
-    }
-
-    public void initDispatcher() {
-        init(new HandlerDescription(NAME));
-    }
+public class RequestURIOperationDispatcher extends org.apache.axis2.dispatchers.RequestURIOperationDispatcher
{
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java?view=diff&rev=550540&r1=550539&r2=550540
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java
Mon Jun 25 09:34:45 2007
@@ -13,47 +13,11 @@
 */
 package org.apache.axis2.engine;
 
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.HandlerDescription;
-import org.apache.axis2.dispatchers.ActionBasedOperationDispatcher;
-import org.apache.axis2.util.LoggingControl;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 /**
  * Dispatches based on the SOAPAction.
+ *
+ * @deprecated use org.apache.axis2.dispatchers.SOAPActionBasedDispatcher
  */
-public class SOAPActionBasedDispatcher extends AbstractDispatcher {
-
-    /**
-     * Field NAME
-     */
-    public static final String NAME = "SOAPActionBasedDispatcher";
-    private static final Log log = LogFactory.getLog(SOAPActionBasedDispatcher.class);
-    private ActionBasedOperationDispatcher abod = new ActionBasedOperationDispatcher();
-
-    public AxisOperation findOperation(AxisService service, MessageContext messageContext)
-            throws AxisFault {
-        return abod.findOperation(service, messageContext);
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
-     */
-    public AxisService findService(MessageContext messageContext) throws AxisFault {
-        if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
-            log.debug(messageContext.getLogIDString() +
-                    " Checking for Service using SOAPAction is a TODO item");
-        }
-        return null;
-    }
-
-    public void initDispatcher() {
-        init(new HandlerDescription(NAME));
-    }
+public class SOAPActionBasedDispatcher extends org.apache.axis2.dispatchers.SOAPActionBasedDispatcher
{
 }
+

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java?view=diff&rev=550540&r1=550539&r2=550540
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
Mon Jun 25 09:34:45 2007
@@ -17,92 +17,11 @@
 
 package org.apache.axis2.engine;
 
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.HandlerDescription;
-import org.apache.axis2.util.LoggingControl;
-import org.apache.axis2.util.Utils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.xml.namespace.QName;
-
 /**
  * Dispatches based on the namespace URI of the first child of
  * the body.
+ *
+ * @deprecated use org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher
  */
-public class SOAPMessageBodyBasedDispatcher extends AbstractDispatcher {
-
-    /**
-     * Field NAME
-     */
-    public static final String NAME = "SOAPMessageBodyBasedDispatcher";
-    private static final Log log = LogFactory.getLog(SOAPMessageBodyBasedDispatcher.class);
-
-    public AxisOperation findOperation(AxisService service, MessageContext messageContext)
-            throws AxisFault {
-
-        OMElement bodyFirstChild = messageContext.getEnvelope().getBody().getFirstElement();
-
-        AxisOperation axisOperation = null;
-        if (bodyFirstChild != null){
-           axisOperation = service.getOperationByMessageElementQName(bodyFirstChild.getQName());
-
-           // this is required for services uses the RPC message receiver
-           if (axisOperation == null){
-               QName operationName = new QName(bodyFirstChild.getLocalName());
-               axisOperation = service.getOperation(operationName);
-           }
-
-        }
-        return axisOperation;
-    }
-
-    /*
-     *  (non-Javadoc)
-     * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
-     */
-    public AxisService findService(MessageContext messageContext) throws AxisFault {
-        String serviceName;
-
-        OMElement bodyFirstChild = messageContext.getEnvelope().getBody().getFirstElement();
-
-        if (bodyFirstChild != null) {
-            OMNamespace ns = bodyFirstChild.getNamespace();
-
-            if (ns != null) {
-                String filePart = ns.getNamespaceURI();
-
-                if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
-                    log.debug(messageContext.getLogIDString() +
-                            " Checking for Service using SOAP message body's first child's
namespace : "
-                            + filePart);
-                }
-                ConfigurationContext configurationContext =
-                        messageContext.getConfigurationContext();
-                String[] values = Utils.parseRequestURLForServiceAndOperation(filePart,
-                                                                              configurationContext.getServiceContextPath());
-
-                if (values[0] != null) {
-                    serviceName = values[0];
-
-                    AxisConfiguration registry =
-                            configurationContext.getAxisConfiguration();
-
-                    return registry.getService(serviceName);
-                }
-            }
-        }
-
-        return null;
-    }
-
-    public void initDispatcher() {
-        init(new HandlerDescription(NAME));
-    }
+public class SOAPMessageBodyBasedDispatcher extends org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher
{
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message