axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r442557 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: description/AxisService.java engine/ListenerManager.java
Date Tue, 12 Sep 2006 11:03:58 GMT
Author: chinthaka
Date: Tue Sep 12 04:03:57 2006
New Revision: 442557

URL: http://svn.apache.org/viewvc?view=rev&rev=442557
Log:
Integrating the getEPRs method in to listener manager.

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/ListenerManager.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java?view=diff&rev=442557&r1=442556&r2=442557
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
Tue Sep 12 04:03:57 2006
@@ -571,11 +571,14 @@
                 TransportListener listener = transportIn.getReceiver();
                 if (listener != null) {
                     try {
-                        EndpointReference eprForService = listener.getEPRForService(getName(),
requestIP);
-                        if (eprForService != null) {
-                            String address = eprForService.getAddress();
-                            if (address != null) {
-                                eprList.add(address);
+                        EndpointReference[] eprsForService = listener.getEPRsForService(getName(),
requestIP);
+                        if (eprsForService != null) {
+                            for (int i = 0; i < eprsForService.length; i++) {
+                                EndpointReference endpointReference = eprsForService[i];
+                                String address = endpointReference.getAddress();
+                                if (address != null) {
+                                    eprList.add(address);
+                                }
                             }
                         }
                     } catch (AxisFault axisFault) {
@@ -593,11 +596,14 @@
                     TransportListener listener = transportIn.getReceiver();
                     if (listener != null) {
                         try {
-                            EndpointReference eprForService = listener.getEPRForService(getName(),
requestIP);
-                            if (eprForService != null) {
-                                String address = eprForService.getAddress();
-                                if (address != null) {
-                                    eprList.add(address);
+                            EndpointReference[] eprsForService = listener.getEPRsForService(getName(),
requestIP);
+                            if (eprsForService != null) {
+                                for (int j = 0; j < eprsForService.length; j++) {
+                                    EndpointReference endpointReference = eprsForService[i];
+                                    String address = endpointReference.getAddress();
+                                    if (address != null) {
+                                        eprList.add(address);
+                                    }
                                 }
                             }
                         } catch (AxisFault axisFault) {
@@ -1417,6 +1423,7 @@
 
     /**
      * A quick private sub routine to insert the names
+     *
      * @param nameTable
      * @param s
      */
@@ -1430,41 +1437,42 @@
 
     /**
      * Run 2  - adjust the names
-     *
      */
     private void adjustSchemaNames(List schemas, Hashtable nameTable) {
         //process the schemas in the main schema list
         for (int i = 0; i < schemas.size(); i++) {
-            adjustSchemaName((XmlSchema) schemas.get(i),nameTable);
+            adjustSchemaName((XmlSchema) schemas.get(i), nameTable);
         }
         //process all the rest in the name table
         Enumeration nameTableKeys = nameTable.keys();
         while (nameTableKeys.hasMoreElements()) {
-            adjustSchemaName((XmlSchema)nameTableKeys.nextElement(),nameTable);
+            adjustSchemaName((XmlSchema) nameTableKeys.nextElement(), nameTable);
 
         }
     }
 
     /**
      * Adjust a single schema
+     *
      * @param parentSchema
      * @param nameTable
      */
     private void adjustSchemaName(XmlSchema parentSchema, Hashtable nameTable) {
-            XmlSchemaObjectCollection includes = parentSchema.getIncludes();
-            for (int j = 0; j < includes.getCount(); j++) {
-                Object item = includes.getItem(j);
-                if (item instanceof XmlSchemaExternal) {
-                    XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal) item;
-                    XmlSchema s = xmlSchemaExternal.getSchema();
-                    adjustSchemaLocation(s, xmlSchemaExternal, nameTable);
-                }
+        XmlSchemaObjectCollection includes = parentSchema.getIncludes();
+        for (int j = 0; j < includes.getCount(); j++) {
+            Object item = includes.getItem(j);
+            if (item instanceof XmlSchemaExternal) {
+                XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal) item;
+                XmlSchema s = xmlSchemaExternal.getSchema();
+                adjustSchemaLocation(s, xmlSchemaExternal, nameTable);
             }
+        }
 
     }
 
     /**
      * Adjusts a given schema location
+     *
      * @param s
      * @param xmlSchemaExternal
      * @param nameTable

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/ListenerManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/ListenerManager.java?view=diff&rev=442557&r1=442556&r2=442557
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/ListenerManager.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/ListenerManager.java
Tue Sep 12 04:03:57 2006
@@ -38,7 +38,7 @@
 
 public class ListenerManager {
 
-	private static final Log log = LogFactory.getLog(ListenerManager.class);
+    private static final Log log = LogFactory.getLog(ListenerManager.class);
 
     public static ConfigurationContext defaultConfigurationContext;
 
@@ -72,28 +72,42 @@
             }
             if (service.isEnableAllTransports()) {
                 Iterator itr_st = startedTransports.values().iterator();
-                if (itr_st.hasNext()) {
+                while (itr_st.hasNext()) {
                     TransportListener transportListener = (TransportListener) itr_st.next();
-                    return transportListener.getEPRForService(serviceName, null);
-                } else {
-                    return null;
+                    EndpointReference[] epRsForService = transportListener.getEPRsForService(serviceName,
null);
+                    if (epRsForService != null) {
+                        return epRsForService[0];
+                    }
                 }
+
+                // if nothing can be found return null
+                return null;
+
             } else {
                 List exposeTransport = service.getExposedTransports();
                 TransportListener listener = (TransportListener)
                         startedTransports.get(exposeTransport.get(0));
+
+                EndpointReference[] eprsForService;
                 if (opName == null) {
-                    return listener.getEPRForService(serviceName, null);
-                } else return listener.getEPRForService(serviceName + "/" + opName, null);
+                    eprsForService = listener.getEPRsForService(serviceName, null);
+                } else {
+                    eprsForService = listener.getEPRsForService(serviceName + "/" + opName,
null);
+                }
+                return eprsForService != null ? eprsForService[0] : null;
             }
 
         } else {
             TransportInDescription trsIN = configctx.getAxisConfiguration()
                     .getTransportIn(new QName(transportName));
             TransportListener listener = trsIN.getReceiver();
+            EndpointReference[] eprsForService;
             if (opName == null) {
-                return listener.getEPRForService(serviceName, null);
-            } else return listener.getEPRForService(serviceName + "/" + opName, null);
+                eprsForService = listener.getEPRsForService(serviceName, null);
+            } else {
+                eprsForService = listener.getEPRsForService(serviceName + "/" + opName, null);
+            }
+            return eprsForService != null ? eprsForService[0] : null;
         }
     }
 



---------------------------------------------------------------------
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