axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r280523 - in /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2: ./ context/ description/ engine/ transport/http/ util/
Date Tue, 13 Sep 2005 09:40:39 GMT
Author: chinthaka
Date: Tue Sep 13 02:40:07 2005
New Revision: 280523

URL: http://svn.apache.org/viewcvs?rev=280523&view=rev
Log:
- Implementing Service Groups (We are half way)
- changing the dispatching logic according to Axis2-85

Expect test failures from this, but code will compile. Sorry we need to share the code amongst
the implementers

Added:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/InstanceDispatcher.java
Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/OperationContext.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/OperationContextFactory.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OperationDescription.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DispatchingChecker.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java

Added: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/InstanceDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/InstanceDispatcher.java?rev=280523&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/InstanceDispatcher.java
(added)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/InstanceDispatcher.java
Tue Sep 13 02:40:07 2005
@@ -0,0 +1,72 @@
+package org.apache.axis2;
+
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.context.OperationContextFactory;
+import org.apache.axis2.description.OperationDescription;
+import org.apache.axis2.description.ServiceDescription;
+import org.apache.axis2.description.ServiceGroupDescription;
+import org.apache.axis2.handlers.AbstractHandler;
+
+/*
+ * Copyright 2001-2004 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.
+ *
+ * @author : Eran Chinthaka (chinthaka@apache.org)
+ */
+
+public class InstanceDispatcher extends AbstractHandler {
+    /**
+     * By the time the control comes to this handler the dispatching must have happened
+     * so that the message context contains the ServiceGroupDescription, ServiceDescription
and
+     * OperationDescription.
+     * This will then try to find the Contexts of ServiceGroup, Service and the Operation.
+     */
+
+
+    /**
+     * Post Condition : All the Contexts must be populated.
+     *
+     * @param msgContext
+     * @throws AxisFault
+     */
+    public void invoke(MessageContext msgContext) throws AxisFault {
+        System.out.println("Instance Dispatcher invoked .........");
+
+        OperationDescription operationDesc = msgContext.getOperationDescription();
+        ServiceDescription serviceDesc = msgContext.getServiceDescription();
+        ServiceGroupDescription serviceGroupDesc = msgContext.getServiceGroupDescription();
+        String serviceGroupContextId = msgContext.getServiceGroupContextId();
+
+        //  1. look up opCtxt using mc.addressingHeaders.relatesTo[0]
+        OperationContext operationContext = operationDesc.findForExistingOperationContext(msgContext);
+        if (operationContext != null) {
+            operationDesc.registerOperationContext(msgContext, operationContext);
+        } else { //  2. if null, create new opCtxt
+            operationContext =
+                    OperationContextFactory.createOperationContext(operationDesc.getAxisSpecifMEPConstant(),
operationDesc);
+            operationDesc.registerOperationContext(msgContext, operationContext);
+
+        }
+
+//  4. look up SGC using mc.getServiceGroupContextID() as the key
+//  5. if null create new sgc
+//  6. look up service ctxt as service name as the key
+//  7. if null create new
+//  8. set opCtxt.setServiceCtxt(sc)
+// 9. return
+
+
+    }
+}

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java?rev=280523&r1=280522&r2=280523&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java
Tue Sep 13 02:40:07 2005
@@ -92,6 +92,11 @@
 
     private OperationContext operationContext;
     private ServiceContext serviceContext;
+    private ServiceGroupContext serviceGroupContext;
+
+    private OperationDescription operationDescription;
+    private ServiceDescription serviceDescription;
+    private ServiceGroupDescription serviceGroupDescription;
     private ConfigurationContext configurationContext;
 
     private TransportInDescription transportIn;
@@ -159,6 +164,11 @@
     private boolean isSOAP11 = true;
 
     /**
+     * This will hold a key to retrieve the correct ServiceGroupContext.
+     */
+    private String serviceGroupContextId;
+
+    /**
      * Conveniance Method, but before call engine.send() or  engine.receive() one must send
transport in/out
      *
      * @param engineContext
@@ -780,4 +790,46 @@
     public boolean isSOAP11() {
         return isSOAP11;
     }
+
+    public ServiceGroupContext getServiceGroupContext() {
+        return serviceGroupContext;
+    }
+
+    public void setServiceGroupContext(ServiceGroupContext serviceGroupContext) {
+        this.serviceGroupContext = serviceGroupContext;
+    }
+
+    public OperationDescription getOperationDescription() {
+        return operationDescription;
+    }
+
+    public void setOperationDescription(OperationDescription operationDescription) {
+        this.operationDescription = operationDescription;
+    }
+
+    public ServiceDescription getServiceDescription() {
+        return serviceDescription;
+    }
+
+    public void setServiceDescription(ServiceDescription serviceDescription) {
+        this.serviceDescription = serviceDescription;
+    }
+
+    public ServiceGroupDescription getServiceGroupDescription() {
+        return serviceGroupDescription;
+    }
+
+    public void setServiceGroupDescription(ServiceGroupDescription serviceGroupDescription)
{
+        this.serviceGroupDescription = serviceGroupDescription;
+    }
+
+    public String getServiceGroupContextId() {
+        return serviceGroupContextId;
+    }
+
+    public void setServiceGroupContextId(String serviceGroupContextId) {
+        this.serviceGroupContextId = serviceGroupContextId;
+    }
+
+
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/OperationContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/OperationContext.java?rev=280523&r1=280522&r2=280523&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/OperationContext.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/OperationContext.java
Tue Sep 13 02:40:07 2005
@@ -73,6 +73,14 @@
                 .getOperationContextMap();
     }
 
+    public OperationContext(OperationDescription axisOperation) {
+        super(null);
+        this.axisOperation = axisOperation;
+        this.operationMEP = axisOperation.getAxisSpecifMEPConstant();
+        this.operationContextMap = getServiceContext().getEngineContext()
+                .getOperationContextMap();
+    }
+
     /**
      * @return Returns the axisOperation.
      */

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/OperationContextFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/OperationContextFactory.java?rev=280523&r1=280522&r2=280523&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/OperationContextFactory.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/OperationContextFactory.java
Tue Sep 13 02:40:07 2005
@@ -48,4 +48,30 @@
         }
     }
 
+    /**
+     * When you call this make sure you set the parent later.
+     * @param mepURI
+     * @param axisOp
+     * @return
+     * @throws AxisFault
+     */
+    public static OperationContext createOperationContext(
+        int mepURI,
+        OperationDescription axisOp)
+        throws AxisFault {
+        if (MEP_CONSTANT_IN_OUT == mepURI
+            || MEP_CONSTANT_IN_ONLY == mepURI
+            || MEP_CONSTANT_IN_OPTIONAL_OUT == mepURI
+            || MEP_CONSTANT_ROBUST_IN_ONLY == mepURI
+            || MEP_CONSTANT_OUT_ONLY == mepURI
+            || MEP_CONSTANT_OUT_IN == mepURI
+            || MEP_CONSTANT_OUT_OPTIONAL_IN == mepURI
+            || MEP_CONSTANT_ROBUST_OUT_ONLY == mepURI) {
+            return new OperationContext(axisOp);
+
+        } else {
+            throw new AxisFault(Messages.getMessage("unSupportedMEP","ID is "+ mepURI));
+        }
+    }
+
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OperationDescription.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OperationDescription.java?rev=280523&r1=280522&r2=280523&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OperationDescription.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OperationDescription.java
Tue Sep 13 02:40:07 2005
@@ -16,8 +16,8 @@
 import javax.xml.namespace.QName;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.HashMap;
+import java.util.Iterator;
 
 /**
  * @author chathura@opensource.lk
@@ -186,8 +186,7 @@
      * @param msgContext
      * @return
      */
-    public OperationContext findOperationContext(MessageContext msgContext,
-                                                 ServiceContext serviceContext) throws AxisFault
{
+    public OperationContext findOperationContext(MessageContext msgContext, ServiceContext
serviceContext) throws AxisFault {
         OperationContext operationContext = null;
 
         if (null == msgContext.getRelatesTo()) {
@@ -195,8 +194,7 @@
             // one
             operationContext =
                     OperationContextFactory.createOperationContext(
-                            getAxisSpecifMEPConstant(), this,
-                            serviceContext);
+                            getAxisSpecifMEPConstant(),  this, serviceContext);
 
         } else {
             // So this message is part of an ongoing MEP
@@ -213,6 +211,51 @@
 
         }
 
+        registerOperationContext(msgContext, operationContext);
+
+        return operationContext;
+
+    }
+
+    /**
+     * This will not create a new operation context if there is no one already.
+     * @param msgContext
+     * @return
+     * @throws AxisFault
+     */
+    public OperationContext findForExistingOperationContext(MessageContext msgContext) throws
AxisFault {
+        OperationContext operationContext = null;
+
+        if (null == msgContext.getRelatesTo()) {
+//            //Its a new incomming message so get the factory to create a new
+//            // one
+//            operationContext =
+//                    OperationContextFactory.createOperationContext(
+//                            getAxisSpecifMEPConstant(), this);
+            return null;
+
+        } else {
+            // So this message is part of an ongoing MEP
+            //			operationContext =
+            ConfigurationContext configContext = msgContext.getSystemContext();
+            operationContext =
+                    configContext.getOperationContext(
+                            msgContext.getRelatesTo().getValue());
+
+            if (null == operationContext) {
+                throw new AxisFault(Messages.getMessage("cannotCorrealteMsg",
+                        this.getName().toString(),msgContext.getRelatesTo().getValue()));
+            }
+
+        }
+
+        registerOperationContext(msgContext, operationContext);
+
+        return operationContext;
+
+    }
+
+    public void registerOperationContext(MessageContext msgContext, OperationContext operationContext)
throws AxisFault {
         msgContext.getSystemContext().registerOperationContext(
                 msgContext.getMessageID(), operationContext);
         operationContext.addMessageContext(msgContext);
@@ -220,9 +263,6 @@
         if (operationContext.isComplete()) {
             operationContext.cleanup();
         }
-
-        return operationContext;
-
     }
 
     public MessageReceiver getMessageReceiver() {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java?rev=280523&r1=280522&r2=280523&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java
Tue Sep 13 02:40:07 2005
@@ -18,7 +18,6 @@
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.description.HandlerDescription;
 import org.apache.axis2.description.OperationDescription;
 import org.apache.axis2.description.ServiceDescription;
@@ -58,24 +57,40 @@
      */
     public final void invoke(MessageContext msgctx) throws AxisFault {
 
-        if (msgctx.getServiceContext() == null) {
-            ServiceDescription axisService = findService(msgctx);
-            if (axisService != null) {
-                msgctx.setServiceContext(
-                        axisService.findServiceContext(msgctx));
+        ServiceDescription serviceDescription = null;
+        if(msgctx.getServiceDescription() == null){
+            serviceDescription = findService(msgctx);
+            if (serviceDescription != null) {
+                msgctx.setServiceDescription(serviceDescription);
+                // TODO Chinthaka : set the Service Group Context to the message Context
             }
         }
 
-        if (msgctx.getServiceContext() != null &&
-                msgctx.getOperationContext() == null) {
-            OperationDescription axisOperation = findOperation(
-                    msgctx.getServiceContext().getServiceConfig(), msgctx);
-            if (axisOperation != null) {
-                OperationContext operationContext = axisOperation.findOperationContext(
-                        msgctx, msgctx.getServiceContext());
-                msgctx.setOperationContext(operationContext);
+        if(msgctx.getServiceDescription() != null && msgctx.getOperationDescription()
== null){
+            OperationDescription operationDescription = findOperation(serviceDescription,
msgctx);
+            if(operationDescription != null){
+                msgctx.setOperationDescription(operationDescription);
             }
         }
+
+//        if (msgctx.getServiceContext() == null) {
+//            ServiceDescription axisService = findService(msgctx);
+//            if (axisService != null) {
+//                msgctx.setServiceContext(
+//                        axisService.findServiceContext(msgctx));
+//            }
+//        }
+//
+//        if (msgctx.getServiceContext() != null &&
+//                msgctx.getOperationContext() == null) {
+//            OperationDescription axisOperation = findOperation(
+//                    msgctx.getServiceContext().getServiceConfig(), msgctx);
+//            if (axisOperation != null) {
+//                OperationContext operationContext = axisOperation.findOperationContext(
+//                        msgctx, msgctx.getServiceContext());
+//                msgctx.setOperationContext(operationContext);
+//            }
+//        }
 
     }
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java?rev=280523&r1=280522&r2=280523&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
Tue Sep 13 02:40:07 2005
@@ -16,8 +16,8 @@
 package org.apache.axis2.engine;
 
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.storage.AxisStorage;
 import org.apache.axis2.description.*;
+import org.apache.axis2.storage.AxisStorage;
 
 import javax.xml.namespace.QName;
 import java.util.ArrayList;
@@ -138,4 +138,5 @@
     //to check whether a given paramter is locked
     public boolean isParamterLocked(String paramterName);
 
+    public ServiceGroupDescription getServiceGroup(String serviceNameAndGroupString);
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java?rev=280523&r1=280522&r2=280523&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
Tue Sep 13 02:40:07 2005
@@ -16,13 +16,14 @@
 package org.apache.axis2.engine;
 
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.storage.AxisStorage;
+import org.apache.axis2.InstanceDispatcher;
 import org.apache.axis2.deployment.DeploymentEngine;
 import org.apache.axis2.deployment.repository.util.ArchiveReader;
 import org.apache.axis2.deployment.util.PhasesInfo;
 import org.apache.axis2.description.*;
 import org.apache.axis2.phaseresolver.PhaseMetadata;
 import org.apache.axis2.phaseresolver.PhaseResolver;
+import org.apache.axis2.storage.AxisStorage;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -138,10 +139,15 @@
         inPhasesUptoAndIncludingPostDispatch.add(dispatch);
 
         Phase postDispatch = new Phase(PhaseMetadata.PHASE_POST_DISPATCH);
+
         DispatchingChecker dispatchingChecker = new DispatchingChecker();
         dispatchingChecker.getHandlerDesc().setParent(this);
 
-        postDispatch.addHandler(dispatchingChecker);
+        InstanceDispatcher instanceDispatcher = new InstanceDispatcher();
+        instanceDispatcher.getHandlerDesc().setParent(this);
+
+        postDispatch.addHandler(dispatchingChecker,0);
+        postDispatch.addHandler(instanceDispatcher,1);
         inPhasesUptoAndIncludingPostDispatch.add(postDispatch);
     }
 
@@ -288,6 +294,10 @@
         } else {
             return false;
         }
+    }
+
+    public ServiceGroupDescription getServiceGroup(String serviceNameAndGroupString) {
+        return null;  //TODO Deepal please implement this
     }
 
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DispatchingChecker.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DispatchingChecker.java?rev=280523&r1=280522&r2=280523&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DispatchingChecker.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DispatchingChecker.java
Tue Sep 13 02:40:07 2005
@@ -53,21 +53,17 @@
      */
     public final void invoke(MessageContext msgctx) throws AxisFault {
         EndpointReference toEPR = msgctx.getTo();
-        if (msgctx.getServiceContext() == null) {
+        if (msgctx.getServiceDescription() == null) {
             throw new AxisFault(
                     "Service Not found EPR is " +
-                    ((toEPR != null) ? toEPR.getAddress() : ""));
-        }
-
-        if (msgctx.getServiceContext() != null &&
-                msgctx.getOperationContext() == null) {
+                            ((toEPR != null) ? toEPR.getAddress() : ""));
+        } else if (msgctx.getOperationDescription() == null) {
             throw new AxisFault(
                     "Operation Not found EPR is " +
-                    ((toEPR != null) ? toEPR.getAddress() : "") +
-                    " and WSA Action = " +
-                    msgctx.getWSAAction());
+                            ((toEPR != null) ? toEPR.getAddress() : "") +
+                            " and WSA Action = " +
+                            msgctx.getWSAAction());
         }
-
     }
 
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java?rev=280523&r1=280522&r2=280523&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
Tue Sep 13 02:40:07 2005
@@ -112,6 +112,7 @@
             msgContext.setProperty(MessageContext.TRANSPORT_HEADERS, getTransportHeaders(httpServletRequest));
 
             out = httpServletResponse.getOutputStream();
+            msgContext.setServiceGroupContextId(httpServletRequest.getSession().getId());
             boolean processed =
                     HTTPTransportUtils.processHTTPGetRequest(msgContext,
                             httpServletRequest.getInputStream(),

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java?rev=280523&r1=280522&r2=280523&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java Tue Sep
13 02:40:07 2005
@@ -17,6 +17,7 @@
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
+import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.description.*;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.Handler;
@@ -156,6 +157,31 @@
             }
         }
         return values;
+    }
+
+    public static void extractServiceGroupAndServiceInfo(String filePart, MessageContext
messageContext) throws AxisFault {
+        String[] values = parseRequestURLForServiceAndOperation(
+                filePart);
+        String serviceNameAndGroup = values[0];
+        if (serviceNameAndGroup != null) {
+            String[] serviceNameAndGroupStrings = serviceNameAndGroup.split(":");
+            AxisConfiguration registry =
+                    messageContext.getSystemContext().getAxisConfiguration();
+            if(serviceNameAndGroupStrings[0] != null){
+                ServiceGroupDescription serviceGroup = registry.getServiceGroup(serviceNameAndGroupStrings[0]);
+                String serviceNameStr = "";
+                if(serviceNameAndGroupStrings.length == 1){
+                    // This means user has not given a service name.
+                    // the notations is ...../axis2/services/<ServiceGroupName>
+                    serviceNameStr = serviceNameAndGroupStrings[0];
+                }
+                ServiceDescription serviceDescription = registry.getService(new QName(serviceNameStr));
+                if(serviceGroup != null && serviceDescription != null){
+                    messageContext.setServiceGroupDescription(serviceGroup);
+                    messageContext.setServiceDescription(serviceDescription);
+                }
+            }
+        }
     }
 
 }



Mime
View raw message