axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r379679 - in /webservices/axis2/trunk/java/modules: addressing/src/org/apache/axis2/handlers/addressing/ core/src/org/apache/axis2/client/ core/src/org/apache/axis2/context/ core/src/org/apache/axis2/deployment/ core/src/org/apache/axis2/de...
Date Wed, 22 Feb 2006 04:51:25 GMT
Author: deepal
Date: Tue Feb 21 20:51:23 2006
New Revision: 379679

URL: http://svn.apache.org/viewcvs?rev=379679&view=rev
Log:
- fixing bugs
- code improvements 
- Service context getMyEPR

Modified:
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/ServiceClient.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceContext.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/InstanceDispatcher.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/ListenerManager.java

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?rev=379679&r1=379678&r2=379679&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
Tue Feb 21 20:51:23 2006
@@ -66,8 +66,7 @@
             // we always defaults to Submission.WSA_NAMESPACE. Hope this is fine.
             addressingNamespace = Final.WSA_NAMESPACE.equals(addressingVersionFromCurrentMsgCtxt)
                     ? Final.WSA_NAMESPACE : Submission.WSA_NAMESPACE;
-        } else if (msgContext.getOperationContext() != null)
-        { // check for a IN message context, else default to WSA Final
+        } else if (msgContext.getOperationContext() != null) { // check for a IN message
context, else default to WSA Final
             MessageContext inMessageContext = msgContext.getOperationContext()
                     .getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
             if (inMessageContext != null) {
@@ -151,8 +150,7 @@
     }
 
     private void processRelatesTo(SOAPEnvelope envelope, Options messageContextOptions) {
-        if (!isAddressingHeaderAlreadyAvailable(WSA_RELATES_TO, envelope, addressingNamespaceObject))
-        {
+        if (!isAddressingHeaderAlreadyAvailable(WSA_RELATES_TO, envelope, addressingNamespaceObject))
{
             RelatesTo relatesTo = messageContextOptions.getRelatesTo();
             OMElement relatesToHeader = null;
 
@@ -194,14 +192,13 @@
 
     private void processReplyTo(SOAPEnvelope envelope, Options messageContextOptions, MessageContext
msgContext) {
         EndpointReference epr;
-        if (!isAddressingHeaderAlreadyAvailable(WSA_REPLY_TO, envelope, addressingNamespaceObject))
-        {
+        if (!isAddressingHeaderAlreadyAvailable(WSA_REPLY_TO, envelope, addressingNamespaceObject))
{
             epr = messageContextOptions.getReplyTo();
             if (epr == null) {//optional
-
-                if (msgContext.getServiceContext() != null && msgContext.getServiceContext().getMyEPRAddress()
!= null)
-                {
-                    epr = new EndpointReference(msgContext.getServiceContext().getMyEPRAddress());
+                if (msgContext.getServiceContext() != null &&
+                        msgContext.getServiceContext().getMyEPR() != null) {
+//                     epr = new EndpointReference(msgContext.getServiceContext().getMyEPRAddress());
+                    epr = msgContext.getServiceContext().getMyEPR();
                 } else {
                     // setting anonymous URI. Defaulting to Final.
                     epr = new EndpointReference(anonymousURI);
@@ -219,8 +216,7 @@
 
     private void processToEPR(Options messageContextOptions, SOAPEnvelope envelope) {
         EndpointReference epr = messageContextOptions.getTo();
-        if (epr != null && !isAddressingHeaderAlreadyAvailable(WSA_TO, envelope,
addressingNamespaceObject))
-        {
+        if (epr != null && !isAddressingHeaderAlreadyAvailable(WSA_TO, envelope,
addressingNamespaceObject)) {
             String address = epr.getAddress();
             if (!"".equals(address) && address != null) {
                 SOAPHeaderBlock toHeaderBlock = envelope.getHeader().addHeaderBlock(WSA_TO,
addressingNamespaceObject);
@@ -247,8 +243,7 @@
     protected void addToSOAPHeader(EndpointReference epr,
                                    String type,
                                    SOAPEnvelope envelope) {
-        if (epr == null || isAddressingHeaderAlreadyAvailable(type, envelope, addressingNamespaceObject))
-        {
+        if (epr == null || isAddressingHeaderAlreadyAvailable(type, envelope, addressingNamespaceObject))
{
             return;
         }
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/ServiceClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/ServiceClient.java?rev=379679&r1=379678&r2=379679&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/ServiceClient.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/ServiceClient.java
Tue Feb 21 20:51:23 2006
@@ -558,13 +558,14 @@
         mc.setEnvelope(se);
     }
 
+
     /**
-     * To get the EPR of the service client if there is
-     *
-     * @return <code>String</code>
+     * To get the EPR that the service is running
+     * transport : can be null , if it is null then epr will be craetd using any available
+     * transports
      */
-    public String getMyEPRAddress() {
-        return serviceContext.getMyEPRAddress();
+    public EndpointReference getMyEPR(String transport) throws AxisFault {
+        return serviceContext.getMyEPR(transport);
     }
 
     /**
@@ -581,6 +582,7 @@
     public void setTargetEPR(EndpointReference targetEpr) {
         serviceContext.setTargetEPR(targetEpr);
     }
+
 
     /**
      * This class acts as a callback that allows users to wait on the result.

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceContext.java?rev=379679&r1=379678&r2=379679&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceContext.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceContext.java
Tue Feb 21 20:51:23 2006
@@ -17,12 +17,13 @@
 
 package org.apache.axis2.context;
 
+import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
+import org.apache.axis2.engine.ListenerManager;
 
 import javax.xml.namespace.QName;
-import java.util.ArrayList;
 
 /**
  * Well this is never clearly defined, what it does or the lifecycle.
@@ -30,8 +31,8 @@
  */
 public class ServiceContext extends AbstractContext {
 
-    private String myEPRAddress;
     private EndpointReference targetEPR;
+    private EndpointReference myEPR;
 
     private transient AxisService axisService;
     private String serviceInstanceID;
@@ -39,13 +40,11 @@
 
     //to store service implementation class , to handler session
     private Object serviceImpl;
-    private ArrayList replyTorefpars;
 
     public ServiceContext(AxisService serviceConfig, ServiceGroupContext serviceGroupContext)
{
         super(serviceGroupContext);
         this.serviceGroupContext = serviceGroupContext;
         this.axisService = serviceConfig;
-        this.replyTorefpars = new ArrayList();
         if (serviceConfig != null) {
             serviceInstanceID = serviceConfig.getName();
         }
@@ -95,12 +94,16 @@
         return serviceGroupContext;
     }
 
-    public String getMyEPRAddress() {
-        return myEPRAddress;
-    }
-
-    public void setMyEPRAddress(String myEPRAddress) {
-        this.myEPRAddress = myEPRAddress;
+    public EndpointReference getMyEPR(String transport) throws AxisFault {
+        axisService.isEnableAllTransport();
+        ConfigurationContext configctx = getConfigurationContext();
+        if (configctx != null) {
+            ListenerManager lm = configctx.getListenerManager();
+            if (!lm.isStopped()) {
+                return lm.getERPforService(axisService.getName(), null, transport);
+            }
+        }
+        return null;
     }
 
     public EndpointReference getTargetEPR() {
@@ -109,5 +112,13 @@
 
     public void setTargetEPR(EndpointReference targetEPR) {
         this.targetEPR = targetEPR;
+    }
+
+    public EndpointReference getMyEPR() {
+        return myEPR;
+    }
+
+    public void setMyEPR(EndpointReference myEPR) {
+        this.myEPR = myEPR;
     }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java?rev=379679&r1=379678&r2=379679&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
Tue Feb 21 20:51:23 2006
@@ -502,8 +502,8 @@
             org.apache.axis2.util.Utils.calculateDefaultModuleVersion(axisConfig.getModules(),
axisConfig);
             try {
                 axisConfig.setRepository(axis2repository);
+                validateSystemPredefinedPhases();
                 if (!useDefault) {
-                    validateSystemPredefinedPhases();
                     engageModules();
                 }
             } catch (AxisFault axisFault) {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java?rev=379679&r1=379678&r2=379679&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
Tue Feb 21 20:51:23 2006
@@ -17,15 +17,7 @@
 
 package org.apache.axis2.deployment.repository.util;
 
-import org.apache.axis2.deployment.AxisServiceBuilder;
-import org.apache.axis2.deployment.DeploymentConstants;
-import org.apache.axis2.deployment.DeploymentEngine;
-import org.apache.axis2.deployment.DeploymentErrorMsgs;
-import org.apache.axis2.deployment.DeploymentException;
-import org.apache.axis2.deployment.DescriptionBuilder;
-import org.apache.axis2.deployment.ModuleBuilder;
-import org.apache.axis2.deployment.ServiceBuilder;
-import org.apache.axis2.deployment.ServiceGroupBuilder;
+import org.apache.axis2.deployment.*;
 import org.apache.axis2.deployment.util.Utils;
 import org.apache.axis2.description.AxisModule;
 import org.apache.axis2.description.AxisService;
@@ -34,20 +26,11 @@
 import org.apache.axis2.i18n.Messages;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.ws.commons.om.OMAttribute;
 import org.apache.ws.commons.om.OMElement;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
+import java.io.*;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.zip.ZipEntry;
@@ -68,8 +51,8 @@
 
         if (TAG_SERVICE.equals(elementName)) {
             AxisService axisService = null;
-            OMAttribute serviceNameatt = rootElement.getAttribute(new QName(ATTRIBUTE_NAME));
-            String serviceName = serviceNameatt.getAttributeValue();
+//            OMAttribute serviceNameatt = rootElement.getAttribute(new QName(ATTRIBUTE_NAME));
+            String serviceName = DescriptionBuilder.getShortFileName(engine.getCurrentFileItem().getName());
             if (serviceName != null) {
                 axisService = (AxisService) wsdlServices.get(serviceName);
             }
@@ -79,8 +62,7 @@
                                 engine.getCurrentFileItem().getName()));
             }
             if (axisService == null) {
-                axisService = new AxisService(
-                        DescriptionBuilder.getShortFileName(engine.getCurrentFileItem().getName()));
+                axisService = new AxisService(serviceName);
             } else {
                 axisService.setWsdlfound(true);
             }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java?rev=379679&r1=379678&r2=379679&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
Tue Feb 21 20:51:23 2006
@@ -38,15 +38,13 @@
 import javax.wsdl.extensions.soap.SOAPAddress;
 import javax.wsdl.factory.WSDLFactory;
 import javax.xml.namespace.QName;
-import java.io.*;
+import java.io.OutputStream;
 import java.util.*;
 
 /**
  * Class AxisService
  */
-public class AxisService extends AxisDescription implements Serializable {
-
-    private static final long serialVersionUID = 4528303251915455363L;
+public class AxisService extends AxisDescription {
 
     private Definition definition = null;
     private Log log = LogFactory.getLog(getClass());
@@ -711,14 +709,6 @@
             return schema.getElementByName(elementQName);
         }
         return null;
-    }
-
-    private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException
{
-        // Do nothing. Service has nothing serializable.
-    }
-
-    private void writeObject(ObjectOutputStream stream) throws IOException {
-        // Do nothing. Service has nothing serializable.
     }
 
     public boolean isEnableAllTransport() {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/InstanceDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/InstanceDispatcher.java?rev=379679&r1=379678&r2=379679&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/InstanceDispatcher.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/InstanceDispatcher.java
Tue Feb 21 20:51:23 2006
@@ -19,11 +19,7 @@
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
-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.context.SessionContext;
+import org.apache.axis2.context.*;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.handlers.AbstractHandler;
@@ -36,7 +32,7 @@
  */
 public class InstanceDispatcher extends AbstractHandler {
 
-	private static final long serialVersionUID = -1928612412157492489L;
+    private static final long serialVersionUID = -1928612412157492489L;
 
 
     /**
@@ -94,11 +90,13 @@
                         msgContext);
             }
         }
-
-
+        // setting myEPR
         String transportURL = (String) msgContext.getProperty(Constants.Configuration.TRANSPORT_IN_URL);
-        if (serviceContext != null && transportURL != null) {
-           serviceContext.setMyEPRAddress(transportURL);
+        if (serviceContext != null) {
+            if (transportURL != null) {
+                serviceContext.setMyEPR(msgContext.getTo());
+            }
+            serviceContext.setMyEPR(msgContext.getTo());
         }
     }
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/ListenerManager.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/ListenerManager.java?rev=379679&r1=379678&r2=379679&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/ListenerManager.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/ListenerManager.java
Tue Feb 21 20:51:23 2006
@@ -106,8 +106,8 @@
                         startedTranports.put(tranportIn.getName().getLocalPart(), listener);
                     }
                 }
-            } catch (AxisFault axisFault) {
-                log.info(axisFault.getMessage());
+            } catch (Exception e) {
+                log.info(e.getMessage());
             }
         }
         stopped = false;



Mime
View raw message